Reply to basic help needed..

Your name:

Reply:


Posted by Trypt on 07/24/05 03:44

Hi, I made a bunch of forms in dreamweaver, and created a basic php
script to process the form and email me the results. So far so good,
here is the script:

<?
$Name=$_POST['Name'];
$Email=$_POST['Email'];
$Comments=$_POST['Message'];
$to="contact@webhost.com";
$message="$Name just filled in your contact form. Message
was:\n$Message\n\nTheir E-Mail address was: $Email";
if(mail($to,"Comments From Your Site",$message,"From: $Email\n")) {
echo "Your message was delivered successfully. Please use the back
button of your browser to return to Webhost.";
} else {
echo "There was a problem sending the mail. Please check that you filled
in the form correctly.";
}
?>

It works fine, it send a message to my email (i changed the email in the
script, the one thats showing is just a generic email).

However, I don't like the fact that when the submit button is pushed,
and the form is executed successfully, the only thing it does is take
the user to a blank white page with the echo message above:

"Your message was delivered successfully. Please use the back button of
your browser to return to Webhost."

I really don't want the user to have to push the back button, and on top
of that to be taken back to the same form page which is all filled in.

Here is what I would like to add to this script if it is possible:

A. Instead of the echo message above, just something simple like:
"Click <here> to return to "webhost"", where <here> is a link of my
choosing.

but even better would be

B. A redirection to a html page. For example, when the user completes
the form, I'd like them to be taken to a success.html page if
successful, or error.html if not.

Is there anyway to do this simply in the same above script to replace
the echo messages? Option B is what I really want, although I'll settle
for A if the above requires advanced programming.

Thank you very much.

--
Regards from Trypt!
trypt2000@(remove)yahoo.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация