I need help please.
I have one page on which I have an <a href="control.php">
In control.php I have to do some "things" with the datas and the database, and then I have to redirect to the <a href>.
This is what I though:
first_page
<a href="control.php?link=www.google.com">google</a>
control.php
...control of the data...
Header
My question is, how do I have to do the header? Any other solution?
Thank you.
a href with header
Moderator: General Moderators
Re: a href with header
I dont get what you're trying to do.. header? the header has a lot of functions like redirecting, caching, xml contents blah blah blah.. what are you trying to achieve?
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
Re: a href with header
If you're trying to redirect the user after processing data, then:
However, be aware that no output may be sent to the browser before this function call, so all the processing needs to be data/server processing and not browser processing.
And you should call exit(); right after it to terminate the script if there is any code after the call.
Code: Select all
header("Location:http://www.google.com");And you should call exit(); right after it to terminate the script if there is any code after the call.
Re: a href with header
In my code, I've been using die(). Any reason to go back and change it to exit()?Bill H wrote:you should call exit(); right after it to terminate the script if there is any code after the call.
Re: a href with header
die() and exit() are essentially the same.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: a href with header
Please post threads in the appropriate forum. This one was moved from General Discussion to PHP Code.