Jump to content

madox

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

madox's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Here is the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Email Form </title> </head> <body> <form method="post" action="sendeail.php"> <!-- DO NOT change ANY of the php sections --> <?php $ipi = getenv("REMOTE_ADDR"); $httprefi = getenv ("HTTP_REFERER"); $httpagenti = getenv ("HTTP_USER_AGENT"); ?> <input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" /> <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" /> Your Name: <br /> <input type="text" name="visitor" size="35" /> <br /> Your Email:<br /> <input type="text" name="visitormail" size="35" /> <br /> Your phone number:<br /> <input type="text" name="phone" size="35" /> <br /> <br /> Attention:<br /> <select name="attn" size="1"> <option value=" Sales n Billing ">Sales n Billing </option> <option value=" General Support ">General Support </option> <option value=" Technical Support ">Technical Support </option> <option value=" Webmaster ">Webmaster </option> </select> <br /><br /> Mail Message: <br /> <textarea name="notes" rows="4" cols="40"></textarea> <br /> <input type="submit" value="Send Mail" /> <br /> </form> </body> </html> my php code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Sendemail Script</title> </head> <body> <!-- Reminder: Add the link for the 'next page' (at the bottom) --> <!-- Reminder: Change 'YourEmail' to Your real email --> <?php $ip = $_POST['ip']; $httpref = $_POST['httpref']; $httpagent = $_POST['httpagent']; $visitor = $_POST['visitor']; $visitormail = $_POST['visitormail']; $notes = $_POST['notes']; $attn = $_POST['attn']; $phone = $_POST['phone']; if (eregi('http:', $notes)) { die ("Do NOT try that! ! "); } if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($visitor) || empty($visitormail) || empty($notes )) { echo "<h2>Use Back - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $attn = $attn ; $subject = $attn; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Attention: $attn \n Message: $notes \n From: $visitor ($visitormail)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $visitormail\r\n"; mail("email address", $subject, $message, $from, $phone); ?> <p align="center"> Date: <?php echo $todayis ?> <br /> Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> ) <br /> Attention: <?php echo $attn ?> <br /> Message:<br /> <?php $notesout = str_replace("\r", "<br/>", $notes); echo $notesout; ?> <br /> <?php echo $ip ?> <br /><br /> <a href="index.html"> Next Page </a> </p> </body> </html> It will not send out all the information
  2. Guys, The below code works, but I tried to add a phone number to the code and it doesn't work. Here is the form code <form method="post" action="sendeail.php"> <!-- DO NOT change ANY of the php sections --> <?php $ipi = getenv("REMOTE_ADDR"); $httprefi = getenv ("HTTP_REFERER"); $httpagenti = getenv ("HTTP_USER_AGENT"); ?> <input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" /> <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" /> Your Name: <br /> <input type="text" name="visitor" size="35" /> <br /> Your Email:<br /> <input type="text" name="visitormail" size="35" /> <br /> <br /> <br /> Attention:<br /> <select name="attn" size="1"> <option value=" Sales n Billing ">Sales n Billing </option> <option value=" General Support ">General Support </option> <option value=" Technical Support ">Technical Support </option> <option value=" Webmaster ">Webmaster </option> </select> <br /><br /> Mail Message: <br /> <textarea name="notes" rows="4" cols="40"></textarea> <br /> <input type="submit" value="Send Mail" /> <br /> </form> Here is the php code. to send on the email <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Sendemail Script</title> </head> <body> <!-- Reminder: Add the link for the 'next page' (at the bottom) --> <!-- Reminder: Change 'YourEmail' to Your real email --> <?php $ip = $_POST['ip']; $httpref = $_POST['httpref']; $httpagent = $_POST['httpagent']; $visitor = $_POST['visitor']; $visitormail = $_POST['visitormail']; $notes = $_POST['notes']; $attn = $_POST['attn']; if (eregi('http:', $notes)) { die ("Do NOT try that! ! "); } if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($visitor) || empty($visitormail) || empty($notes )) { echo "<h2>Use Back - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $attn = $attn ; $subject = $attn; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Attention: $attn \n Message: $notes \n From: $visitor ($visitormail)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $visitormail\r\n"; mail("my e-mail address", $subject, $message, $from); ?> <p align="center"> Date: <?php echo $todayis ?> <br /> Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> ) <br /> Attention: <?php echo $attn ?> <br /> Message:<br /> <?php $notesout = str_replace("\r", "<br/>", $notes); echo $notesout; ?> <br /> <?php echo $ip ?> <br /><br /> <a href="index.html"> Next Page </a> </p> </body> </html>
  3. Sorry I fixed my code. I must have deleted it somehow. Here is the code again, plus I fix the tag. <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); $subject="from ".$_GET['your_name']; $headers= "From: ".$_GET['your_email']."\n"; $phone="from: ".$_GET['your_phone']; $address="from: ".$_GET['your_address']; $headers.='Content-type: text/html; charset=iso-8859-1'; mail("my email address", $subject, " <html> <head> <title>Contact letter</title> </head> <body> <br> ".$_GET['message']." </body> </html>" , $headers); echo ("Your message was successfully sent!"); ?> <script> resizeTo(300, 300) //window.close() </script>
  4. yes. you are correct. I want to learn php and just start trying to learn it.
  5. I added the code to the contact.php file and it didn't give me any error's. Here is my contact.php code <? ini_set ("display_errors", "1"); error_reporting(E_ALL); $subject="from ".$_GET['your_name']; $headers= "From: ".$_GET['your_email']."\n"; $phone="from: ".$_GET['your_phone']; $address="from: ".$_GET['your_address']; $headers.='Content-type: text/html; charset=iso-8859-1'; mail("my-e-mail address" <html> <head> <title>Contact letter</title> </head> <body> <br> ".$_GET['message']." </body> </html>" , $headers); echo ("Your message was successfully sent!"); ?> <script> resizeTo(300, 300) //window.close() </script> <form action="contact.php" method="get"> <div class="container1"> <div class="col-3"> <div class="h"><input type="text" name="your_name" value="name"></div> <div class="h"><input type="text" name="your_address" value="name"/></div> <div class="h"><input type="text" name="your_phone" value="name"/></div> <div class="h"><input type="text" name="your_address" value="name" /></div> </div> <div class="col-4"> <textarea name="message" cols="35" rows="35">message</textarea><br /> <div class="fright"> <div class="link-2"><em><b><a href="#" onclick="document.getElementById('contact.php').submit()">Send</a></b></em></div> <div class="indent"><div class="link-2"><em><b><a href="#" onclick="document.getElementById('contact.php').reset()">Clear</a></b></em></div></div> </div> </div> <br class="clear" /> </div> </form>
  6. That didn't work. Nothing in my e-mail box.
  7. The e-mail never comes to my inbox.
  8. I don't get any errors that I can tell, no I did not echo error. This form will supply me with the info to my e-mail address
  9. Guys, I am new to php and I am sure this question has come up, I don't see why it is not working. I have this in two parts: Here is my html code for the form <form action="contact.php" method="get"> <div class="container1"> <div class="col-3"> <div class="h"><input type="your_name" value="name" /></div> <div class="h"><input type="your_email" value="e-mail" /></div> <div class="h"><input type="your_phone" value="phone" /></div> <div class="h"><input type="your_address" value="address" /></div> </div> <div class="col-4"> <textarea name="message" cols="35" rows="35">message</textarea><br /> <div class="fright"> <div class="link-2"><em><b><a href="#" onclick="document.getElementById('contact.php').submit()">Send</a></b></em></div> <div class="indent"><div class="link-2"><em><b><a href="#" onclick="document.getElementById('contact.php').reset()">Clear</a></b></em></div></div> </div> </div> <br class="clear" /> </div> </form> contact.php <? $subject="from ".$_GET['your_name']; $headers= "From: ".$_GET['your_email']."\n"; $phone="from: ".$_GET['your_phone']; $address="from: ".$_GET['your_address']; $headers.='Content-type: text/html; charset=iso-8859-1'; mail("my-emailaddress@here" <html> <head> <title>Contact letter</title> </head> <body> <br> ".$_GET['message']." </body> </html>" , $headers); echo ("Your message was successfully sent!"); ?> <script> resizeTo(300, 300) //window.close() </script> Any help would be great.
×
×
  • 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.