Jump to content

djs13

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by djs13

  1. Thank you that fixed my first issue. But I'm getting this error now: "Parse error: syntax error, unexpected T_BOOLEAN_OR in /homepages/9/d228392232/htdocs/Endorsebro/phpdoc.php on line 58" It's referring to the if/else statement that I have: <?php if(!isset($_POST['name']))||(empty($_POST['name']))||(trim($_POST['name']) == ""){echo "Please Provide your Name.";} // just making sure something is posted with the form else{ $timeofMsg = date('m d, Y g:ia', time()); $ipOfPoster = getRealIpAddr(); $toWho = 'sales@endorsebro.com'; $fromWho = $_POST['Email']; $sysSubj = 'Sales Inquiry'; $sysMsg = " Why is that not working?
  2. Thank you for clearing that up. I hate to be annoying and ask you another question, but if you don't mind I'm getting a syntax error on line 2 and 18 where it starts with "public function..." and on 58/59 where the if/else statement is. Do you know why this would be happening? <?php public function getRealIpAddr() { if(!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip=$_SERVER['HTTP_CLIENT_IP']; } elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip=$_SERVER['REMOTE_ADDR']; }return $ip; } public function mailSomeone($toWho, $fromWho, $sysSubj, $sysMsg) { $msgTemplate = ' <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>'.$sysSubj.'</title> <style type="text/css"> background-color: #f1f1f1; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: normal; color: #666666; text-decoration: none; </style> </head> <body> <table width="650" border="0" bgcolor="#FFF" id="wrapper"> <tr> <td align="center" valign="top">'.$sysMsg.'</td> </tr> </table> </body> </html>'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'Content-type: text/html; charset=us-ascii' . "\r\n"; $headers .= 'From:' .$fromWho. "\r\n"; $headers .= 'Reply-To: ' .$fromWho. "\r\n"; $headers .= '1\r\nX-MSMail-Priority: High' . "\r\n"; $headers .= 'X-Mailer: RiversHacia, LLC Mail Controller v2.0' . "\r\n"; mail($toWho, $sysSubj, $sysMsg, $headers); } ?> <?php if(!isset($_POST['name']))||(empty($_POST['name']))||(trim($_POST['name']) == ""){echo "Please Provide your Name.";} // just making sure something is posted with the form else{ $timeofMsg = date('m d, Y g:ia', time()); $ipOfPoster = getRealIpAddr(); $toWho = 'sales@endorsebro.com'; $fromWho = $_POST['Email']; $sysSubj = 'Sales Inquiry'; $sysMsg = " Name: $name <br> Business Name: $business_name <br> Phone Number: $phone_number <br> Email Address: $Email <br> Website: $website <br> State: $state <br> Budget: $budget <br> Comments: $comments <br> <br> <br> <br> Time/Date: timeofMsg <br> IP Posted: $ipOfPoster "; mailSomeone($toWho, $fromWho, $sysSubj, $sysMsg); } ?>
  3. Wow, thank you for the help! I really appreciate it. I know I'm going to sound extremely inexperienced which is exactly what I am, but I have a question how to implement the code you've given me. As I said I'm using dreamweaver (I'm not sure if you're familiar with it) but basically my form is in an html document and then I wrote my php code in a seperate php document. Then made the call to action on the form to utilize the php code. But you've provided me with two php codes which has made me a bit confused. How exactly do I implement it? Again I apologize for the extremely beginner questions.
  4. Hello! My name is DJ and I am new to PHP. Basically I designed a website with dreamweaver and on one of the pages I have a contact form. I used an internet tutorial to use php in order to finish the form. But now when someone submits their form, I don't receive an email and they just end up at a blank page. I don't understand why it's not working. Can you help me? <?php /* Subject and Email Variables */ $emailSubject = 'Sales Inquiry'; $webMaster = 'sales@endorsebro.com'; /* Gathering Data Variables */ $name = $_POST['name']; $business_name = $_POST['business_name']; $phone_number = $_POST['phone_number']; $Email = $_POST['Email']; $website = $_POST['website']; $state = $_POST['state']; $budget = $_POST['budget']; $comments = $_POST['comments']; $body = <<<EOD <br><hr><br> Name: $name <br> Business Name: $business_name <br> Phone Number: $phone_number <br> Email Address: $Email <br> Website: $website <br> State: $state <br> Budget: $budget <br> Comments: $comments <br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as html */ $theResults = <<<EOD <html> <head> <title>Endorsebro</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { background-color: #f1f1f1; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: normal; color: #666666; text-decoration: none; } --> </style> </head> <div> <div align="left">Thank you for your interest! We will be in contact soon!</div> </div> </body> </html> EOD; echo "$theResults"; ?> Thank you for your time.
×
×
  • 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.