Log in

View Full Version : PHP form landing Page Help



_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>';

?>

kobo1d
05-26-2010, 12:00 PM
well this is just a part of the script... to less to be sure of what is the problem..
but i suppose this part:

$url = 'http://sameday-usa.com/thankyou.html';

is the landing page..
so make sure u have a 'thankyou.html' in your root folder and put the message you have in the echo now over in the 'thankyou.html'..

_sameday
05-26-2010, 06:27 PM
Thank you, I am new to Dreamweaver, and I have taught myself everything I know...as you can see, but I will try this out.....

_sameday
05-26-2010, 07:47 PM
Thank you for the help, but I am still having a bit of trouble. So I made sure that 'thankyou.html' was in the root folder, which it was, and then i changed the echo to be echo 'http://sameday-usa.com/thankyou.html';
This only changed the echo text and didn't redirect them to a the actual thankyou page. Any help?? Thanks.