I am currently working on a form that submits to a php file. Everything works in the code except the redirecting portion at the end of the code. I want it to redirect to midtown_thankyou.htm but nothing happens. All the files are located in the same folder so there is no looking for the file. Belowe is the code. Please help!
<?
//***************************** TEXT FILE
if(file_exists(“results/residences_list.txt”))
{
$newfile = fopen(“results/residences_list.txt”, “r”);
while(!feof($newfile))
{
$duplicate = fgetss($newfile, 255);
}
fclose($newfile);
$addemail = fopen(“results/residences_list.txt”, “a”);
fputs($addemail, “$Namet $Addresst $Cityt $Statet $Zipt $Phonet $Emailt $Unitt $Currentt $Interestt $Aget $Referencet $Commentsn”);
fclose($addemail);
}
else
{
// since file doesn’t already exist, let’s create for first time
$newfile = fopen(“results/residences_list.txt”, “a”);
fputs($newfile, “$Namet $Addresst $Cityt $Statet $Zipt $Phonet $Emailt $Unitt $Currentt $Interestt $Aget $Referencet $Commentsn”);
fclose($newfile);
chmod(“results/residences_list.txt”, 0666);
}
// BELOW IS THE EMAIL PORTION OF THE FORM
mail( ” “,
//mail( “”,
“Midtown East”,
$message = “Name: $Namen
Email: $Emailn
Address: $Address, $City, $State $Zipn
Phone: $Phonen
Unit Size And Price: $Unitn
Currently: $Currentn
Interest: $Interestn
Age: $Agen
Reference: $Referencen
Comments: $Comments”,
“From: $Email” );
//**** AUTO RESPONDER EMAIL
mail(“$Email”,
“Thank You!”,
$message = “PLEASE DO NOT REPLY TO THIS AUTOMATED NOTIFICATION!nn
Thank you for your interest in Midtown East, the first luxury condominium tower in Midtown, Reston Town Center’s most exciting new addition. We have placed your name on our Priority Preview List. We will send you more information about these fabulous new condominium homes, as it becomes available and before our opening to the general public. At Midtown East, you will experience the vitality and convenience of a true urban neighborhood, while enjoying the style, fine finishes and spa-like amenities of your new condominium home. nn
We appreciate your interest in Midtown East and look forward to being in touch again soon.nn
Sincerely, nn
The Midtown East Sales Teamn
THE MAYHOOD COMPANYn
Agent for the Seller”,
“From: ” ); //<– REPLACE WITH CORRECT EMAIL
header( “Location: midtown/midtown_thankyou.htm” ); //<— THIS IS THE REDIRECT PAGE
?>