Jump to content


Photo

Need help with mail script


  • Please log in to reply
2 replies to this topic

#1 smclay

smclay
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 12 September 2006 - 12:26 PM

Hi ive used a simple mail script showen below, what i need is information from a mysql database to be showen in the sections Game, Slots etc.. i

Email.php

$mail = $email;
$subject = "Your Order from KandoServers Order Id: $id ";
$body = "Thank you for your order $fname $lname,

Order Id:
Username: $user
Password: $pass
Game:
Number of Slots:
Voice Server:
Additional Voice Slots:
Access:
Contract Period:
Branding:
Server Name:
Server Rcon:
Server Location:
Price:

Once your payment has been veryfied you will recive an email with your Game Control Panel information please do not hesitate to contact us at support@kandoservers.net if you have any questions regarding your Order";

$hh123 = "From: noreply@kandoservers.net\n";
mail($mail,$subject,$body,$hh123);

Information Needed to be Showen

viewcart.php

$pagetitle = "Viewing Cart";
$pagecontent = "<div align=\"left\"  style=\" margin-top:31px;  \">";
$sid = session_id();
$query_cart = "SELECT * FROM `cart` WHERE ct_session_id = '$sid'";
$cart = mysql_query($query_cart, $conn) or die(mysql_error());
$row_cart = mysql_fetch_assoc($cart);
$totalRows_cart = mysql_num_rows($cart);

$carttotal = mysql_query("SELECT * FROM `cart` WHERE ct_session_id = '$sid'");
$total = 0;
while($row_carttotal = mysql_fetch_assoc($carttotal)){
  $pricehandle = $row_carttotal['ct_qty'] * $row_carttotal['pd_price'];
  $total = $total + $pricehandle;
}
$totalformat = $_SESSION['cy_symbol'];
$totalhandle = $total * $_SESSION['cy_multiplier'];
$totalformat .= number_format($totalhandle, 2);

$pagecontent .= "<form name=\"updatecart\" action=\"func/updatecart.php\" method=\"post\">
<div align=\"center\">
<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <td height=\"3\"><hr size=\"1\" color=\"#999999\" noshade></td>
  </tr>
  <tr>
    <td><div align=\"left\"><span class=\"lt_text\">Viewing Cart </span></div></td>
  </tr>
  <tr>
    <td height=\"3\"><hr size=\"1\" color=\"#999999\" noshade></td>
  </tr>";
  if ($totalRows_cart == 0){
  $pagecontent .= "<tr>
    <td><div align=\"left\"><span class=\"lt_text\">Cart is currently empty </span></div></td>
  </tr>
  <tr>
    <td height=\"3\"><hr size=\"1\" color=\"#999999\" noshade></td>
  </tr>";
  } else {
  do{
  $prodinfo = $row_cart['pd_info'];
  $pagecontent .= "<tr>
    <td height=\"3\"><div align=\"left\">
      <table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
        <tr>
          <td valign=\"top\" class=\"lt_text\">";
    list($server[game], $server[location], $server[size], $server[rental], $server[access], $server[branding], $server[voicet], $server[voice], $server[name], $server[rcon]) = split("ß", $prodinfo, 10);
foreach($server as $key => $value){
  list($title, $content) = split(":", $server[$key], 2);
  $gamez = str_replace("Game: ", "", $server[game]);
  if($title == "Voice"){
    $row = mysql_fetch_assoc(mysql_query("SELECT * FROM `games` WHERE Name = '$gamez'"));
if($row['Voice'] == 1){
  $content = $content +16;
}
if($content == 0){
  $content = "None";
} else {
  $content .= " man";
}
  } elseif($title == "Voice Type"){
    $voice = trim($content);
    $row = mysql_fetch_assoc(mysql_query("SELECT * FROM `voice` WHERE Handle = '$voice'"));
$content = " ".$row['Name'];
  } elseif($title != "Server Rcon" && $title != "Server Name") {
    $content = trim($content);
$content = ucfirst($content);
$content = " " . $content;
  }
  $pagecontent .= "<strong>".$title."</strong>: ".$content."<br>";
}
            $pagecontent .= "</td><td width=\"80\"><table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
            <tr>
              <td width=\"45%\" class=\"lt_text\"><strong>Qty:</strong></td>
              <td><input name=\"p_info[]\" type=\"hidden\" value=\""; $pagecontent .= $prodinfo; $pagecontent .= "\">
  <input name=\"cart_id[]\" type=\"hidden\" value=\""; $pagecontent .= $row_cart['ct_id']; $pagecontent .= "\">
  <input name=\"qty[]\" value=\""; $pagecontent .= $row_cart['ct_qty']; $pagecontent .= "\" type=\"text\" class=\"f_text form2\" size=\"3\"></td>
            </tr>
          </table></td>
          <td width=\"80\" class=\"lt_text\"><strong>Price:</strong> ";
  $tempprice = $row_cart['pd_price'];
  $tempprice = $tempprice * $_SESSION['cy_multiplier'];
  $priceformat = $_SESSION['cy_symbol'];
  $priceformat .= number_format($tempprice, 2);
 
  $pagecontent .= $priceformat;
 
  $pagecontent .= "</td>
          <td width=\"111\"><a href=\"func/removecart.php?c_id=" . $row_cart['ct_id'] . "\"><img alt=\"\" border=\"0\" src=\"images/xi0s_remove.gif\"></a></td>
        </tr>
      </table>
    </div></td>
  </tr>
  <tr>
    <td height=\"3\"><hr size=\"1\" color=\"#999999\" noshade></td>
  </tr>";
  } while ($row_cart = mysql_fetch_assoc($cart)); }
  $pagecontent .= "<tr>
    <td height=\"3\"><table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
      <tr>
        <td>&nbsp;</td>
        <td width=\"80\" class=\"lt_text\"><strong>Total:</strong> "; $pagecontent .= $totalformat; $pagecontent .= "</td>
        <td width=\"111\">";
if ($totalRows_cart != 0 ){
$pagecontent .= "<a href=\"javascript:document.updatecart.submit();\"><img alt=\"\" border=\"0\" src=\"images/xi0s_update.gif\"></a>";
} else {
$pagecontent .= "&nbsp;";
} $pagecontent .= "</td>
      </tr>";
  if ($totalRows_cart != 0) {
  $pagecontent .= "<tr>
    <td>&nbsp;</td>
<td>&nbsp;</td>
<td class=\"lt_text\"><a href=\"index.php?p=paymentinfo\"><img style=\"margin-top: 2px;\" alt=\"\" border=\"0\" src=\"images/xi0s_finalise.gif\"></a></td>
  </tr>";
  }
    $pagecontent .= "</table></td>
  </tr>
  <tr>
    <td height=\"3\"><hr size=\"1\" color=\"#999999\" noshade></td>
  </tr>
</table>
</div>
</form>";
$pagecontent .= "</div>";

?>

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 12 September 2006 - 01:38 PM

And the question is?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 smclay

smclay
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 12 September 2006 - 02:08 PM

what i need is information from a mysql database to be showen in the sections Game, Slots etc..


list($server[game], $server[location], $server[size], $server[rental], $server[access], $server[branding], $server[voicet], $server[voice], $server[name], $server[rcon]) = split("ß", $prodinfo, 10);

the above variabkes need to be added to the mail template

add me to msn (no1_mexican@hotmail.co.uk) or yahoo (scott_mclay10) and i will try to explian, sorry but im a noob =(




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users