473,668 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to layout php header location with a variable as the location?

5 New Member
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
Expand|Select|Wrap|Line Numbers
  1.  header("Location:".$urlback);
Is this the right layout the redirect. I keep finding it is not redirecting and is just ignoring the request.




Kind regards Matthew
May 26 '23 #1
1 17066
Niheel
2,456 Recognized Expert Moderator Top Contributor
Check the variable $urlback by echoing it before the header statement.

If that checks out.

Then try this.
header("Locatio n: $urlback");
Jun 5 '23 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
6252
by: Jeff | last post by:
I've been able to find this question on a Google group search but not the answer. Plus I'm a late convert to php transferring over from ASP. I hope this isn't too many strikes against me. When I issue a "header(Location:/myscript.php?key1=value1&key2=value2);" the redirect happens just fine but the url in the address field keeps the previous url instead of the url I passed in the header call. This seems to happen only with I.E....
6
18270
by: Filth | last post by:
Hi this is probably very easy to sort but I want to do the following:- header( "Location: subscribe_form.php?name='.$_GET.'&email='.$_GET.'"); but this pulls up the error:- Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
10
5640
by: Margaret MacDonald | last post by:
I'm seeing a problem that has me flummoxed. The only thing I can think of is that I'm violating some rule I don't know about. I have some code that does some processing and then does a header('Location: ...) jump to page A on success or falls through to the jump to page B. This is the code: if ( mysql_query( 'LOCK TABLES tableX WRITE', $link ) ) { mysql_query( $q, $link ) ; // store the record
4
3486
by: Marc-Olivier BERNARD | last post by:
Hi there, I need to create a classic layout like this: ------------------------\ top | ------------------------| | | | left| center |right|
23
3626
by: lwoods | last post by:
I am trying to pass some info to another page on my site. I set "session_start()" in page 1, assign a session variable to a value, then execute a "header('Location: ....')." But on the target page I don't get any session variable values! BTW, I used a relative location in the Location header, not an absolute URL. The behavior looks like it started another session, but it should not have. Ideas? TIA,
2
8898
by: Ladbroke | last post by:
Hiya, got a little prob with the syntax for header ( ' Location .... with variable). Usually examples are given with a complete URL, like: ..... header( 'Location: login/testsite/start.php' ); I'd like to use particular read out data from my database (URL) (variable $result).
6
5448
by: P-Rage | last post by:
Hello everyone, I was wondering what could possibly cause Internet Explorer 6 to loop a page usging a header(Location:) statement. For example, a page called 'page1.php': if((isset($_POST)) && ($name='valid')){ // insert some data into MySQL.
4
2044
by: fruityfreak | last post by:
is it possible to have more than one header(location: ); or can i have one header('Refresh: 3; url=login.php'); and echo header('location: index.php');
4
1824
by: Big Moxy | last post by:
I've successfully tested sending the variable "msg" back to login.php. However further down I am sending the variable "id" to menu.php but it is not being sent. It does not appear in the URL in the format http://{domain}/menu.php?id={value}. It is also not retrievable via $_GET; I don't see any differences yet one works the other doesn't. Please help! Thank you! Tim
8
39855
by: pedalpete | last post by:
I thought this should be simple, but i can't seem to get it to work. I'm trying to do a simple redirect to a page, but need to pass a variable. I've tried a few things, but nothing seems to work. here's what I've tried header('Location: edit.php?sid=$sid');
0
8381
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8799
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.