PDA

View Full Version : Review Form redirection Script



CDBASE7211
03-16-2006, 06:56 PM
Hello!

I have been viewing others posts and trying it on my own ..however I keep getting an error..

The plan is to have the order submit page send the info to my email and then redirect to a page where they can pay via paypal.

here is the script( I've copied and pasted and think I made an error playing with it!
<HTML>
<HEAD>
<TITLE>Please be patient while we transfer you to checkout to complete your order</TITLE>
<META HTTP-EQUIV="Refresh" Content="0;www.nationwidemovingpros.com/thank_you.html">
<?PHP
</HEAD>
<BODY>
<H2>Thank You..WE Are Happy To Be Servicing You!!</H2>


$email = $HTTP_POST_VARS[email];
$mailto = "order@nationwidemovingpros.com";
$mailsubj = "NEW ORDER";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
</SCRIPT>

?>
</BODY>
</HTML>

The order page is www.nationwidemovingpros.com/order.html

it should be redirected to www.nationwidemovingpros.com/thank_you.html

Also I am not getting any info when the form is submitted..I checked the text box properties..to my knowledge they are all titled...

Any help would be great!!!

navaldesign
03-17-2006, 05:34 AM
<HTML>
<HEAD>
<TITLE>Please be patient while we transfer you to checkout to complete your order</TITLE>
<META HTTP-EQUIV="Refresh" Content="0;www.nationwidemovingpros.com/thank_you.html">
</HEAD>
<BODY>
<H2>Thank You..WE Are Happy To Be Servicing You!!</H2>


<?PHP

$email = $HTTP_POST_VARS[email];
$mailto = "order@nationwidemovingpros.com";
$mailsubj = "NEW ORDER";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
</SCRIPT>
header("Location: thank_you.html");
?>
</BODY>
</HTML>

Create a Thankyou page in BV with the message you want. Put the paypal button in this page. also give them some navigation button so they can keep navigating your site if they decide they don't want to go to Paypal. Better keep them on your site even if the change their mind and don't go on with payment.

Take the part in red off the script. Insert the part in blue.

You didn't get any info, indeed i think you didn't get an email at all, because the line
<META HTTP-EQUIV="Refresh" Content="0;www.nationwidemovingpros.com/thank_you.html">

redirected to the thank_you page immediately, without submitting the form info.


I have not checked all your form, but i did see that the email field was named "email " . You have a blank space after the word email. You can't see it but it's there. Delete it.

CDBASE7211
03-17-2006, 10:53 PM
THANKS!

I was able to fix the redirect issue, however I keep getting a blank email when I submit...I read the forum and searched for others having the same issue howeverI can't seem to have the issue....any suggestions???

After I work out these few kinks ..Hopefully I'll be on my way to search engine placement issues!!!!

Thanks for your response!

navaldesign
03-18-2006, 06:05 AM
Try changing the encoding type in either "" (blank, there shouldn't be anything there, or in "multipart / form data"

CDBASE7211
03-18-2006, 07:28 AM
Hi

I changed the script as you suggested..now the redirect gives me this error

Warning: Cannot modify header information - headers already sent by (output started at /home/tkcztmqm/public_html/order.php:9) in /home/tkcztmqm/public_html/order.php on line 22

any ideas?
here is the script

<HTML>
<HEAD>
<TITLE>There is one more step until we process your order</TITLE>
</HEAD>
<BODY>
<H2>You are now being redirected to payment processing!</H2>
<?PHP
$email = $HTTP_POST_VARS[email];
$mailto = "order@nationwidemovingpros.com";
$mailsubj = "From the OrderForm";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
header("Location: thank_you.html");
?>

CDBASE7211
03-18-2006, 07:31 AM
YAY..I received the info from the form..however it is upside down

last field first...should i not be picky?

Any ideas on how to fix the redirect?

navaldesign
03-18-2006, 07:38 AM
Using Pablo's script there is only one way to fix the order: redo the form, with the excact order in which you want the fields to appear.

For the error: when following instructions, please follow them completely. You should have taken the first part of the script off.
<HTML>
<HEAD>
<TITLE>There is one more step until we process your order</TITLE>
</HEAD>
<BODY>
<H2>You are now being redirected to payment processing!</H2>
<?PHP
$email = $HTTP_POST_VARS[email];
$mailto = "order@nationwidemovingpros.com";
$mailsubj = "From the OrderForm";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
header("Location: thank_you.html");
?>

Take the part in red Off your script. You don't need it either, because they get redirected to the thankyou page, you can have your message there

Please note that doing so, you must copy this code, paste it in Notepad, go to "Save as", choose File Type "All files" and save the file as "order.php" . Upload this "order.php" file on your server.

Don't use the php extension in BV page method, to upload this script. This wiil always add the first part of html code and will cause conflicts between html and php

CDBASE7211
03-18-2006, 07:40 AM
wait..1/2 of a yay..only one form worked

here is the other script www.nationwidemovingpros.com/contact.html

<HTML>
<HEAD>
<TITLE>CONTACT CONFIRMED</TITLE>
</HEAD>
<BODY>
<H2>ONE MOMENT PLEASE</H2>
<?PHP
$email = $HTTP_POST_VARS[email];
$mailto = "info@nationwidemovingpros.com";
$mailsubj = "From the Contact Form";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
header("Location: contact_confirm.html");
?>

navaldesign
03-18-2006, 08:04 AM
You have the same problem: follow the same instructions for your contact.php script