amarquez
09-08-2003, 09:54 AM
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, "$Name\t $Address\t $City\t $State\t $Zip\t $Phone\t $Email\t $Unit\t $Current\t $Interest\t $Age\t $Reference\t $Comments\n");
fclose($addemail);
}
else
{
// since file doesn't already exist, let's create for first time
$newfile = fopen("results/residences_list.txt", "a");
fputs($newfile, "$Name\t $Address\t $City\t $State\t $Zip\t $Phone\t $Email\t $Unit\t $Current\t $Interest\t $Age\t $Reference\t $Comments\n");
fclose($newfile);
chmod("results/residences_list.txt", 0666);
}
// BELOW IS THE EMAIL PORTION OF THE FORM
mail( " ",
//mail( "",
"Midtown East",
$message = "Name: $Name\n
Email: $Email\n
Address: $Address, $City, $State $Zip\n
Phone: $Phone\n
Unit Size And Price: $Unit\n
Currently: $Current\n
Interest: $Interest\n
Age: $Age\n
Reference: $Reference\n
Comments: $Comments",
"From: $Email" );
//**** AUTO RESPONDER EMAIL
mail("$Email",
"Thank You!",
$message = "PLEASE DO NOT REPLY TO THIS AUTOMATED NOTIFICATION!\n\n
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. \n\n
We appreciate your interest in Midtown East and look forward to being in touch again soon.\n\n
Sincerely, \n\n
The Midtown East Sales Team\n
THE MAYHOOD COMPANY\n
Agent for the Seller",
"From: " ); //<-- REPLACE WITH CORRECT EMAIL
header( "Location: midtown/midtown_thankyou.htm" ); //<--- THIS IS THE REDIRECT PAGE
?>
<?
//***************************** 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, "$Name\t $Address\t $City\t $State\t $Zip\t $Phone\t $Email\t $Unit\t $Current\t $Interest\t $Age\t $Reference\t $Comments\n");
fclose($addemail);
}
else
{
// since file doesn't already exist, let's create for first time
$newfile = fopen("results/residences_list.txt", "a");
fputs($newfile, "$Name\t $Address\t $City\t $State\t $Zip\t $Phone\t $Email\t $Unit\t $Current\t $Interest\t $Age\t $Reference\t $Comments\n");
fclose($newfile);
chmod("results/residences_list.txt", 0666);
}
// BELOW IS THE EMAIL PORTION OF THE FORM
mail( " ",
//mail( "",
"Midtown East",
$message = "Name: $Name\n
Email: $Email\n
Address: $Address, $City, $State $Zip\n
Phone: $Phone\n
Unit Size And Price: $Unit\n
Currently: $Current\n
Interest: $Interest\n
Age: $Age\n
Reference: $Reference\n
Comments: $Comments",
"From: $Email" );
//**** AUTO RESPONDER EMAIL
mail("$Email",
"Thank You!",
$message = "PLEASE DO NOT REPLY TO THIS AUTOMATED NOTIFICATION!\n\n
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. \n\n
We appreciate your interest in Midtown East and look forward to being in touch again soon.\n\n
Sincerely, \n\n
The Midtown East Sales Team\n
THE MAYHOOD COMPANY\n
Agent for the Seller",
"From: " ); //<-- REPLACE WITH CORRECT EMAIL
header( "Location: midtown/midtown_thankyou.htm" ); //<--- THIS IS THE REDIRECT PAGE
?>