_sameday
05-25-2010, 10:03 PM
I have a contact form up and running, I want to change the landing page the user gets once their info has been submitted. I wasn't able to get the landing page to work, so for the meantime I set up an echo. Below is the code. Can anyone help me set up the landing page to you to a .htm/thankyou page? Thanks for the help.
<?php
//--------------------------Set these paramaters--------------------------
$subject = 'Request more info';
$emailadd = 'info@sameday-usa.com';
$url = 'http://sameday-usa.com/thankyou.html';
$req = '0';
// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<h1>Thank You!</h1>'.'<p>Your info has been received. We will contact you shortly.</p>';
?>
<?php
//--------------------------Set these paramaters--------------------------
$subject = 'Request more info';
$emailadd = 'info@sameday-usa.com';
$url = 'http://sameday-usa.com/thankyou.html';
$req = '0';
// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<h1>Thank You!</h1>'.'<p>Your info has been received. We will contact you shortly.</p>';
?>