Jump to content

chrisrice

Members
  • Posts

    4
  • Joined

  • Last visited

chrisrice's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Would you be able to provide me the recommended code?
  2. I entered that portion into the code and it still let me submit with the name field blank.
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>MSM Offer</title> </head> <body style="color: rgb(0, 0, 0); background-color: rgb(8, 8, ;" alink="#000099" link="#000099" vlink="#990099"> <div style="text-align: center;"><img style="width: 534px; height: 272px;" alt="" src="http://offer.mirrorshow.com/offerpage3.jpg"><br> <br> <form method="post" action="contact.php">Fields marked (*) are required <p>NN<span style="color: rgb(246, 246, 246);"><span style="font-weight: bold;">Name</span></span>ame:<br> <input name="Name" type="text"> </p> <p>Co <span style="color: rgb(246, 246, 246);"><span style="font-weight: bold;">Company</span></span>pany:<br> <input name="Company" type="text"> </p> <p>Telep<span style="color: rgb(246, 246, 246);"><span style="font-weight: bold;">Telephone</span></span>hone:<br> <input name="Telephone" type="text"> </p> <p>Em<span style="color: rgb(246, 246, 246);"><span style="font-weight: bold;">Email</span></span>ail:<br> <input name="Email" type="text"> </p> <p><input name="submit" value="Submit" type="submit"></p> </form> <p></p> <a href="http://mirrorshowmanagement.com"><img style="border: 0px solid ; width: 447px; height: 125px;" alt="" src="http://offer.mirrorshow.com/logo.jpg"></a></div> </body> </html> <?php // Website Contact Form Generator // http://www.tele-pro.co.uk/scripts/contact_form/ // This script is free to use as long as you // retain the credit link // get posted data into local variables $EmailFrom = "[email protected]"; $EmailTo = "[email protected]"; $Subject = "Offer Submission"; $Name = Trim(stripslashes($_POST['Name'])); $Company = Trim(stripslashes($_POST['Company'])); $Telephone = Trim(stripslashes($_POST['Telephone'])); $Email = Trim(stripslashes($_POST['Email'])); // validation $validationOK=true; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Company: "; $Body .= $Company; $Body .= "\n"; $Body .= "Telephone: "; $Body .= $Telephone; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $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\">"; } ?>
  4. Hello, I know very little about php and I used a php form generator for a contact page and I'm not sure how to go about making the fields required. Attached is the htm and php files. Your help is greatly appreciated! contact.php contact.htm
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.