Jump to content

I Tired...


divinedesigns1

Recommended Posts

So i try to do something totally different, and this is what my code was looking like "hahahaha"

<?php$firstname = $_POST['firstname'];$lastname = $_POST['lastname'];$email = $_POST['email'];$comment = $_POST['text'];$senderFirstname = "";$senderLastname = "";$senderEmail = "";$senderMessage = "";if($_POST['firstname']){//form is trying to post variable//Gather variable name in post variables$senderFirstname = $_POST['firstname'];$senderLastname = $_POST['lastname'];$senderEmail = $_POST['email'];$senderMessage = $_POST['text'];//Make sure all variable are filled, else do not send messageif(!$senderFirstname || !$senderLastname || !$senderEmail || !$senderMessage){  $errormessage = "<div style='color:#000;'>Fill in all fields, thank you</div>";}else {  //run filter for each field  $senderFirstname = strip_tags($senderFirstname);  $senderFirstname = stripslashes($senderFirstname);  $senderLastname = strip_tags($senderLastname);  $senderLastname = stripslashes($senderLastname);  $senderEmail = strip_tags($senderEmail);  $senderEmail = stripslashes($senderEmail);  $senderMessage = strip_tags($senderMessage);  $senderMessage = stripslashes($senderMessage);   //end fliter  $to = "";  $from = "$email";  $subject = "Customers Request";   //begin message  $message = "  $senderFirstname  $senderLastname  $senderEmail  $senderMessage  ";  // Set headers configurations	    $headers  = 'MIME-Version: 1.0' . "rn";	    $headers .= "Content-type: textrn";	    $headers .= "From: $fromrn";	    // Mail it now using PHP's mail function	    mail($to, $subject, $message, $headers);	    $formMessage = "Thank You, your message has been sent.";	    $senderName = "";	    $senderEmail = "";	    $senderMessage = "";}}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Contact Us</title><style type="text/css">body {margin:0px;padding:0px;}.cont {width: 700px;margin-top: 0px;margin-right: auto;margin-bottom: 0px;margin-left: auto;}#contacttitle {background-image: url(contact%20title.jpg);height: 45px;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #FFF;}label {font-family:Verdana, Geneva, sans-serif;color:#000;padding-top:25px;padding-bottom:25px;margin-bottom: 20px;}.error {color:#F00;font-family:Arial, Helvetica, sans-serif;font-style:italic;font-size:9px;}form {margin-top:10px;}.form form #firstname {color: #666;text-decoration: none;margin-bottom:10px;width:30%;height: 25px;border: 1px solid #900;}.form form #lastname {color: #666;text-decoration: none;margin-bottom:10px;width:30%;height: 25px;border: 1px solid #900;}.form form #email {color: #666;text-decoration: none;margin-bottom:10px;width:30%;height: 25px;border: 1px solid #900;}.form form #text {color: #666;text-decoration: none;margin-bottom:10px;width:40%;height: 100px;border: 1px solid #900;}#button {background-color: #900;color: #FFF;font-weight: bold;padding: 5px;margin-top: 5px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;filter: DropShadow(Color=000, OffX=5, OffY=5, Positive=center);}#button:hover {background-color: #000;color: #FFF;font-weight: bold;padding: 5px;margin-top: 5px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;filter: DropShadow(Color=000, OffX=5, OffY=5, Positive=center);}</style></head><body><div class="cont"><div id="contacttitle"></div><div class="form"><div class="error"><? echo $errormessage; ?></div><form action="contact2012.php" method="post"><label for="firstname">First Name: </label><br/><input name="firstname" id="firstname" value="<? echo $senderFirstname; ?>" /><br/><label for="lastname">Last Name: </label><br/><input name="lastname" id="lastname" value="<? echo $senderLastname; ?>" /></div><label for="email">Email: </label><br/><input name="email" id="email" value="<? echo $senderEmail; ?>" /></div><label for="text">Message: </label><br/><textarea name="text" id="text"><? echo $senderMessage; ?></textarea><br/><input id="button" name="Submit" value="Send Message" type="submit" /></form></div></div></body></html>

nice code and cssbut look what the outcome was hehehehehehttp://www.divinedesigns1.com/contact/contact2012.php :rofl: totally didnt expect it to come out like this at all, i was very hype with it and :rofl:, i think i needed that table after all, what yall think? i made a mistake somewhere didnt i?

Link to comment
Share on other sites

I would validate the page:http://validator.w3.orgIt will tell you any errors you have on that page. it won't validate PHP, only HTML.

Link to comment
Share on other sites

page not found error-404your page is missing.

Link to comment
Share on other sites

oh i had to take it down right quick, i notice something on it hehehehe but thats just a demo, im gonna have the real contact page up soon

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...