Problem with a simple form

windows

Guest
Now, I've attached my single-page form(only 3 simple controls)( to this thread.<br />
<br />
When the user types in his/her name in the text box and clicks the Submit button, the value(name, in this case), will be sent to my e-mail address. But for some reason, an error page always gets displayed instead. Thanks a lot!<!--content-->for one you are using FrontPage extensions. your host has to support Front page for this to work<!--content-->Thanks a lot, scoutt! :)<br />
<br />
In that case, I guess it's better to use other methods.<br />
I mean, is there any free copy-and-paste code for this kind of functionality available on the Web?<br />
<br />
Thanks a lot! :)<br />
Xeon.<!--content-->well yeah there are loads of them. but your server (host) has to support the server side language you want.<br />
<br />
you can look into matt's script archive and Download <!--more--> formmail.pl as it is one of the best.<br />
<br />
<!-- m --><a class="postlink" href="http://www.scriptarchive.com/formmail.html">http://www.scriptarchive.com/formmail.html</a><!-- m --><!--content-->Thanks a lot, scoutt! :):)<br />
<br />
<br />
well yeah there are loads of them. but your server (host) has to support the server side language you want.<br />
<br />
<br />
Suppose my web hosting provider supports the server side language needed but my web site visitor/surfer's browser/system doesn't support these server side languages. Will the form code still work in this case?<br />
<br />
Thanks a lot! :)<br />
Xeon.<!--content-->server-side doesnt have anything to do with the browser!, that's client-side!<!--content-->Hi there Leo! :)<br />
So, that means, it doesn't really matter for the client-side?! Thanks! :)<!--content-->hi xeon, <br />
yup whatever runs server-side is not affected by what browser/browser version the user has<!--content-->Thanks a lot, Leo! :):):)<!--content-->Hey Xeon, I hope I don't get in trouble for posting this but it is a really simple but great form submitter. It is called "simplephpmail". If your server supports php(most do) it should work without any problems. Be sure to change any information in the form and script specific to you such as the email address.<br />
<br />
THIS IS UPLOADED INSIDE YOUR HTML WEBPAGE FILE<br />
<br />
<form method=POST action="scripts/simplephpmail.php"><br />
<table><br />
<tr><td>Name:</td><td><input type="text" name="name" value="" size=30></td></tr><br />
<tr><td>Email:</td><td><input type="text" name="email" value="" size=30></td></tr><br />
<tr><td>Subject:</td><td><input type="text" name="subject" value="" size=30></td></tr><br />
<tr><td>Message:</td><td><br />
<textarea cols=28 rows=8 name="message"></textarea><br />
</td></tr><br />
<tr><td></td><td><input type="Submit" value="Send"><br />
</table><br />
</form><br />
<br />
<br />
<br />
THIS IS UPLOADED TO YOUR SERVER AND SAVED IN THE "scripts" directory-"simplephpmail.php".<br />
<br />
<?<br />
/* YOU MUST EDIT THIS LINE */<br />
$youremail = "[email protected]";<br />
?><br />
<br />
<? error_reporting(1); ?><br />
<html><head><title>Copperhead Web Design and Hosting Contact</title></head><body><br />
<br />
<? <br />
<br />
# stupid user check<br />
<br />
if($youremail == "user@domain") {<br />
print "You have to change one variable (email address) in this file.</body></html>"; exit;<br />
}<br />
<br />
?><br />
<br />
<?<br />
if(($message) || ($name) || ($email) || ($subject)) {<br />
<br />
if($name) { } else {<br />
print "Your message was not sent because you didn't specify your name.<br>\n";<br />
}<br />
<br />
if($email) { } else {<br />
print "Your message was not sent because you didn't specify your email.<br>\n";<br />
}<br />
<br />
<br />
if($subject) { } else {<br />
print "Your message was not sent because you didn't specify a subject.<br>\n";<br />
}<br />
<br />
<br />
if($message) { } else {<br />
print "Your message was not sent because you didn't write anything in the 'message' field.<br>\n";<br />
}<br />
<br />
print "<br>";<br />
<br />
if(($message) && ($name) && ($email) && ($subject)) {<br />
<br />
print "Your email was sent successfully. Thank you for contacting Copperhead Web Design and Hosting<br><br>\n";<br />
<br />
<br />
$to = $youremail;<br />
$from = $email;<br />
<br />
$VIRTUAL_REMOTE_HOST = gethostbyaddr( $REMOTE_ADDR );<br />
<br />
if( $REMOTE_HOST ) { } else {<br />
$REMOTE_HOST = "NULL";<br />
}<br />
<br />
if( $VIRTUAL_REMOTE_HOST ) { } else {<br />
$VIRTUAL_REMOTE_HOST = "NULL";<br />
}<br />
<br />
<br />
mail ($to, $subject, "A message from $name at $email:\r\n $message \r\n\r\n$name's remote host is $REMOTE_HOST and $name's specified hostname is $VIRTUAL_REMOTE_HOST. \r\nThe sender's IP Address is $REMOTE_ADDR and the sender's \r\nUser-Agent string is $HTTP_USER_AGENT." ) or print "An unknown error occured.<br>";<br />
<br />
$name = NULL;<br />
$email = NULL;<br />
$subject = NULL;<br />
$message = NULL;<br />
<br />
}<br />
<br />
}<br />
?><br />
<br />
<form method=POST action="<? echo $PHP_SELF; ?>"><br />
<table><br />
<tr><td>Name:</td><td><input type="text" name="name" value="<? echo $name; ?>" size=30></td></tr><br />
<tr><td>Email:</td><td><input type="text" name="email" value="<? echo $email; ?>" size=30></td></tr><br />
<tr><td>Subject:</td><td><input type="text" name="subject" value="<? echo $subject; ?>" size=30></td></tr><br />
<tr><td>Message:</td><td><br />
<textarea cols=28 rows=8 name="message"><? echo $message; ?></textarea><br />
</td></tr><br />
<tr><td></td><td><input type="Submit" value="Send"><br />
</table><br />
<br />
<br />
<br />
</body></html><!--content-->Thanks a lot, Derek! U're the man! :):):):):):)<!--content-->
 
Back
Top