Forum Moderators: coopster
Probably a simple answer to this...
I am writing a simple PHP contact form. The form is in an include that will be in the header of every page in the website. When the form is submitted I want the user to be returned to whichever page they came from. Therefore in the <form action="" method="post"> i want the action="" to point to the URL that the user is currently on - how do i do this?
Thanks!
<form action="/path/to/processing_script.php" method="post">
<input type="hidden" name="return_to" value="<?php echo $_SERVER['REQUEST_URI'];?>" />
</form>
Then, in the processing script:
if($form_submitted_successfully){
header('Location: http://'.$_SERVER['SERVER_NAME'].$_POST['return_to']);
}
[edited by: eelixduppy at 4:00 pm (utc) on Aug. 15, 2007]
[edit reason] delinked code [/edit]
How would i do the same sort of thing but with the page title.
How are you displaying the title in the first place?
Is it something like the following:
<title> echo $title </title>
then you can use $title on the rest of the page.
If you post part of your code including this part, you might get a better response.
Habtom