Jump to content

HanneSThEGreaT

Members
  • Posts

    52
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

HanneSThEGreaT's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can't believe I missed that. Thank you very much!
  2. Thanks I now have a problem with my radio buttons not sending info to my php file I do this in my order page : <td colspan = "4"><p style="color: #FFFFFF; font-family:Arial, Helvetica, sans-serif">Delivery :<br> SpeedService (Counter to Counter) – R70 <input type="radio" name = "Delivery" value "SpeedService"></p> <p>UTI Courier Fee (Door to Door Delivery) – R75 <input type="radio" name = "Delivery" value "UTI"></p> <p>Delivery charges might increase depending on the weight of your parcel(s)</p></td> </tr> Then I try to use it in php like this : if (isset($_POST['Delivery'])) { $Delivery = $_POST['Delivery']; if ($Delivery == 'SpeedService') { $SS = 70; } else if ($Delivery == 'UTI') { $UTI = 75; } } $Tot = $prodTot1 + $prodTot2 + $prodTot3 + $prodTot4 + $prodTot5 + $prodTot6 + $prodTot7 + $prodTot8 + $prodTot9 + $prodTot10 + $prodTot11 + $prodTot12 + $prodTot13 + $prodTot14 + $prodTot15 + $SS + $UTI; But it doesn't pick up anything. What am i doing wrong?
  3. Hi guys. I just cannot seem to get the order confirmation sent out correctly. It just gives me echo $OrderStr; instead of the actual order and delivery. If I try to add the $Delivery into the message, I get errors Here is my code in question : $OrderStr = 'You Ordered the Following :<br> <br>'; if(isset($_POST['BreathslimQuantity'])) { $prodAmt1 = $_POST['BreathslimPrice'] * $_POST['BreathslimQuantity']; $prod1 = $_POST['Breathslim']; $OrderStr = $OrderStr . $prod1 . ' at ' . $prodAmt1 . ' Each.'; } $Delivery = $_POST['Delivery']; if ($Delivery == 'SpeedService') { $SS = 70; } $first_name = $_POST['Name']; // required $last_name = $_POST['Surname']; // required $telephone = $_POST['Contact']; // not required $address = $_POST['Address']; // required if (isset($_POST['Email'])) { $email = $_POST['Email']; function died($error) { // error code echo "We are very sorry, but there were error(s) found with the email you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } } $Tot = $prodAmt1 + $SS; echo 'Hi ' . $first_name . ' ' . $last_name . '<br>' . $OrderStr . '<p>Delivery Method : ' . $Delivery; // multiple recipients $to = '[email protected]' . ', '; // note the comma $to .= $email; // subject $subject = 'BreathSlim® Order Confirmation'; // message $message = ' <html> <head> <title>BreathSlim® Order Confirmation</title> </head> <body> echo $OrderStr; </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); ?> Thank you for contacting us. We will be in touch with you very soon. </p> </div> </body> </html> can anyone help?
  4. OK, I managed to get this sorted out. Still a mystery as to why it didn't work the first time. This is my code : <html> <head> <title>Practice</title> </head> <body> <table border="1"> <tr> <td> <?php error_reporting(E_ALL | E_STRICT); ini_set("display_errors", 1); if(!empty($_POST['uname'])){ $yourname=$_POST['uname']; $yoursurname=$_POST['usurname']; echo 'hello </td> <td>' .' ' . $yourname . ' ' . $yoursurname . '</td> </tr>'; } else{ echo '<tr> <td> enter your name </td> </tr>'; } if(isset($_POST['gender'])){ /*isset is what it is set to can be used */ $gender=$_POST['gender']; echo '<tr> <td> You are a </td> <td> ' . ' ' . $gender . ' </td> </tr>'; } else{ echo '<tr> <td> Select Gender </td> </tr>'; } if(isset($_POST['plang'])){ $plang=$_POST['plang']; echo '<tr> <td> You are interested in </td> <td> ' . ' ' . $plang . ' </td> </tr>'; } else{ echo '<tr> <td> Select Programming language </td> </tr>'; } print '<tr> <td> Your qualification is </td> <td>'; foreach ($_POST['qlevel'] as $level){ print $level . '<BR>'; } // multiple recipients $to = '[email protected]' . ', '; // note the comma $to .= '[email protected]'; // subject $subject = 'confirmation'; // message $message = ' <html> <head> <title>Confirmation</title> </head> <body> <p>Hello ' . $yourname . ' ' . $yoursurname . '</p> <table> <tr> <th>Gender</th><th>Interests</th><th>Qualification(s)</th> </tr> <tr> <td>' . $gender . '</td><td>' . $plang . '</td><td>'; foreach($_POST['qlevel'] as $level){ $message .= $level . '<BR>'; } $message.= '</td> </tr> </table> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Hannes <[email protected]>, Dirk <[email protected]>' . "\r\n"; $headers .= 'From: TESTING123 <[email protected]>' . "\r\n"; $headers .= 'Cc: [email protected]' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); ?> </td> </tr> </table> </body> </html> Thanks anyways for reading!
  5. Thank you for your reply! OK, Yes I did it now : error_reporting(E_ALL); ini_set('display_errors',1); $emailto="[email protected]"; $emailsubject="confirmation"; $emailfrom="[email protected]"; But still, I am getting nowhere
  6. Hi guys, me again. I have been using mail to send emails ( With your great help ) successfully in about three websites. For some reason, my email doesn't want to work with the site I am busy with now. This is my code : <html> <head> <title>Practice</title> </head> <body> <table border="1"> <tr> <td> <?php $emailto="[email protected]"; $emailsubject="confirmation"; $emailfrom="[email protected]; if(!empty($_POST['uname'])){ $yourname=$_POST['uname']; $yoursurname=$_POST['usurname']; echo "hello </td> <td>" ." " . "$yourname" . " " . "$yoursurname </td> </tr>"; $emailbody="hello </td> <td>" ." " . "$yourname" . " " . "$yoursurname </td> </tr>"; } else{ echo"<tr> <td> enter your name </td> </tr>"; $emailbody .="<tr> <td> enter your name </td> </tr>"; } if(isset($_POST['gender'])){ /*isset is what it is set to can be used */ $gender=$_POST['gender']; echo "<tr> <td> You are a </td> <td> " . " " . "$gender </td> </tr>"; $emailbody .="<tr> <td> You are a </td> <td> " . " " . "$gender </td> </tr>"; } else{ echo "<tr> <td> Select Gender </td> </tr>"; $emailbody .="<tr> <td> Select Gender </td> </tr>"; } if(isset($_POST['plang'])){ $plang=$_POST['plang']; echo "<tr> <td> You are interested in </td> <td> " . " " . "$plang </td> </tr>"; $emailbody .="<tr> <td> You are interested in </td> <td> " . " " . "$plang </td> </tr>"; } else{ echo "<tr> <td> Select Programming language </td> </tr>"; $emailbody .="<tr> <td> Select Programming language </td> </tr>"; } print "<tr> <td> Your qualification is </td> <td>"; $emailbody .= "<tr> <td> Your qualification is </td> <td>"; foreach ($_POST['qlevel'] as $level){ print "$level<BR>"; $emailbody .="$level<BR>"; } $headers='From:'. $emailfrom; mail($emailto,$emailsubject,$emailbody,$headers); ?> </td> </tr> </table> </body> </html>
×
×
  • 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.