Hi there... I'd appreciate any help... and I'm by no means asking anyone to do my work for me. If any knows of any tutorials or anything that may help me, I'd appreciate!
Basically I have a form (not an email form) that when you hit submit it calls another php file for the processing. In that file it has the header(Location:... for the redirect.
HOWEVER, I don't want it to redirect based on that. I want in the form to be able to specify a hidden field (or however best to do it) called "redirect" and the value be a URL.
So that way when someone clicks submit it will call the other php file to process (and ignore the headerLocation-- or I can just remove that) and then redirect to the page specified in the form.
THANKS so much in advance for any advice, help or pointing me somewhere to learn.
Redirect Question, Thanks for any help!
Moderator: General Moderators
Re: Redirect Question, Thanks for any help!
Assuming you have your URL in a variable called $url_for_redirect:
In the form:
In the form processing script:
At end of script:
In the form:
Code: Select all
<input type="hidden" name="redirect" value="<?php echo $url_for_redirect; ?>" />Code: Select all
<?php
$url_to_go_to = $_POST['redirect'];
?>
Code: Select all
<?php
header('Location: ' . $url_to_go_to);
?>
Re: Redirect Question, Thanks for any help!
I made a silly mistake, which is why I edited this to take it away.
That ended up working like a charm once I found what I did wrong.
Anyway- THANKS so much!
That ended up working like a charm once I found what I did wrong.
Anyway- THANKS so much!