Can anyone help me with this email situation?I have created a form in html. I have setup a cgi form folder And placed a mail cgi file I am able to access the email form from the website. It looks correct in the browser. I can enter the information. Then after I click on 'submit'I get the following-------Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator and inform them of the time the error occurred and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache/1.3.39 Server at sellinfo org Port 80----------------------------------Please help. Thanks in advance!
Hum... I know personally I am a fan of using B&T's php version for sending mail () as it's rather fool proof. Could you share the file in question (filter anything you don't want to share such as email address). AMDbuilder
This is the sample of what I am trying now.<body><!-- Website Contact Form Generator --><!-- --><!-- This script is free to use as long as you --><!-- retain the credit link --><form method="POST" action="contact php">Fields marked (*) are required<p>Email From:* <br><input type="text" name="EmailFrom"><p>Subject: <br><input type="text" name="Subject"><p>FirstName:* <br><input type="text" name="FirstName"><p>LastName:* <br><input type="text" name="LastName"><p><input type="submit" name="submit" value="Submit"></form><p><!-- Contact Form credit link -->Created by <a target="_blank" href="http://www tele-pro co uk/scripts/contact_form/">Contact Form Generator</a></body></html>Here is the PHP side Also how to I set this up??? I am trying to install in the www directory with the htm. Is that right?<?php// Website Contact Form Generator // // This script is free to use as long as you // retain the credit link // get posted data into local variables$EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); $EmailTo = "support@XXXXX com";$Subject = Trim(stripslashes($_POST['Subject'])); $FirstName = Trim(stripslashes($_POST['FirstName'])); $LastName = Trim(stripslashes($_POST['LastName'])); // validation$validationOK=true;if (Trim($EmailFrom)=="") $validationOK=false;if (Trim($FirstName)=="") $validationOK=false;if (Trim($LastName)=="") $validationOK=false;if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error htm\">"; exit;}// prepare email body text$Body = "";$Body.= "FirstName: ";$Body.= $FirstName;$Body.= "\n";$Body.= "LastName: ";$Body.= $LastName;$Body.= "\n";// send email $success = mail($EmailTo. $Subject. $Body. "From: <$EmailFrom>");// redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=ok htm\">";}else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error htm\">";}?>There it is. Any steps of what I am leaving out? I have looked at your link to the one script. Do you have to change all the 'red' highlighted code with specific server information? I am new to this. I appreciate your asssistance.
Hello,First a note... www just points to public_html (the real folder) Using www isn't going to cause any problems but just a note everyone will likely referance public_html... Moving on... It might just simplier to have you use B&T's form mailer as it's all one file and simple to use. All you need to do is edit the first 3 lines where it tells you to edit things. All the important code for sending the email and such is put at the very top of the page above everything else. Then the rest of your page is just like a normal page. Your form seams simple enough that just copying and pasting B&T's version would do the trick for you. AMDbuilderKeep in mind the php file must be php
Well. I have named everything the html form to form php and the text script to php and I am still trying to setup the site. I guess part of the server is down still. No response from tech support. Onward.
Hello. I went with BT's script. Here is what I have. Any further instructions would be helpful. I know that visual studio developer does not like anything php so I am using nvu to test. <?php// modify the three lines below$htmlMail = "no"; // "yes" to send html mail - otherwise sends text mail$emailAddress = "support@sellinfo org"; // your email address$thankyouPage = "thankyoupage1a htm"; // leave empty to return to the form after a message has been sent - put in a url (or relative page) to go to a Thank You page// modify the three lines abovesession_start();if (isset($_POST['send']) AND isset($_SESSION['mail_count'])) { if (!preg_match("(^[-\w\.]+@([-a-z0-9]+\.)+[a-z]{2,4}$)i". $_POST['email'])) $alert = "You have entered an invalid email address."; if ($_SESSION['mail_count'] >= "3") $alert = "Only 3 messages can be sent per session."; if (empty($alert)) { $_SESSION['mail_count']++; if (!get_magic_quotes_gpc()) foreach ($_POST as $key=>$value) $_POST[$key] = addslashes($_POST[$key]); foreach ($_POST as $key=>$value) $_POST[$key] = wordwrap($_POST[$key],65); if ($htmlMail == "yes") { $headers = 'MIME-Version: 1.0' . "\r\n"; $headers.= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $message = "<table border='1'>"; foreach ($_POST as $key => $value) if (!preg_match("(^send)". $key)) $message.="<tr><td><b>$key</b></td><td>$value</td></tr>"; $message.= "</table>"; } else { foreach ($_POST as $key => $value) if (!preg_match("(^send)". $key)) $message.= $key. "->\n " . $value. "\n\n"; } $subject = $_SERVER['HTTP_HOST'] . " Message"; $headers.= "From: <" . $_POST['email'] . ">\r\n"; mail($emailAddress,$subject,$message,$headers); if (!empty($thankyouPage)) { header('location: ' . $thankyouPage); die(); } unset($_POST); $alert = "Your message has been sent."; }}if (!isset($_SESSION['mail_count'])) $_SESSION['mail_count'] = 0;?><html><head></head><body><form method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>"><div style="text-align: center; height: 450px; width: 500px; margin-top: 50; border: solid 1px black;"><br>Send me a message<br><br>your name<br><input type="text" style="width: 330px;" name="name" value="<?php echo $_POST['name']; ?>" maxlength="50"><br><br>your email address<br><input type="text" style="width: 330px;" name="email" value="<?php echo $_POST['email']; ?>" maxlength="50"><br><br>your message<br><textarea name="content" style="width: 330px; height: 100px;" rows="6" cols="80"><?php echo $_POST['content']; ?></textarea><br><br><input type="submit" name="send" value="submit"> </div></form> <?php if (isset($alert)) echo "<script type='text/javascript'>alert('$alert');</script>"; ?></body></html>
Forex Groups - Tips on Trading
Related article:
http://forums.site5.com/showthread.php?t=22007
comments | Add comment | Report as Spam
|