Results 1 to 4 of 4

Thread: PHP form landing Page Help

  1. #1
    Join Date
    May 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP form landing Page Help

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

    ?>

  2. #2
    Join Date
    Jun 2007
    Posts
    64
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    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'..

  3. #3
    Join Date
    May 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.....

  4. #4
    Join Date
    May 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •