Jump to content

Recommended Posts

I am trying to send some information from a post in sendmail.  I get most of the information, but not the category_id and in the information sent to the client I get no information.  I am posting the code, could someone tell me what is wrong with this:

 

$category = $_POST["category"];

 

if(strlen($category)>0)

{

foreach ($_POST['category'] as  $category)

{

if ($category == "1")

{

$_SESSION['snack'] = "";

}

if ($category == "2")

{

$_SESSION['colddrink'] = "";

}

if ($category == "3")

{

$_SESSION['frozen'] = "";

}

if ($category == "4")

{

$_SESSION['hotbeverage'] = "";

}

if ($category == "5")

{

$_SESSION['watercooler'] = "";

}

if ($category == "6")

{

$_SESSION['bsupplies'] = "";

}

 

}

$category = $_POST["category"];

 

}

 

if ($_SESSION['ss_cust_id'] != "")

{

$sql = "SELECT tblcustcat.category_id,categoryName FROM tblcustcat,tblcategory where tblcustcat.category_id=tblcategory.category_id and cust_id=".$_SESSION['ss_cust_id'];

$result = mysql_query($sql);

$noofrow = mysql_num_rows($result);

}

 

$cnt = 0;

if ($_SESSION['snacktype'] != "")

{

 

$cnt = $cnt + 1;

}

if ($_SESSION['drinktype'] != "")

{

$cnt = $cnt + 1; }

if ($_SESSION['coffeetype'] != "")

{

$cnt = $cnt + 1; }

if ($_SESSION['foodtype'] != "")

{

$cnt = $cnt + 1; }

if ($_SESSION['water_coolertype'] != "")

{

$cnt = $cnt + 1; }

if ($_SESSION['suppliestype'] != "")

{

$cnt = $cnt + 1; }

 

 

?>

 

                  <td width="100%" class="GeneralText"><span style="mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Times New Roman; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"><? if ($cnt != 0) { echo " $cnt Items Selected "; }?></span>

                    <p></td>

                </tr>

                <tr>

                  <td width="100%"><?php

?>

<form method=post action=new_cust_final.php>

<?

if ($_SESSION['ss_cust_id'] != "")

{

echo "<table border=0 cellpadding=5 cellspacing=5 bordercolor=maroon width=90%>";

if ($_SESSION['snack'] != "")

{

$query = "select * from tblcategory where category_id=".$_SESSION['snack'];

$result = mysql_query($query);

$no = mysql_num_rows($result);

$array = mysql_fetch_object($result);

if ($no > 0)

{

echo "<tr><Td width=10><input type=checkbox name=category[] value=".$_SESSION['snack']."></td><td class=GeneralText>".$array->categoryName."</td></tr>";

}

}

if ($_SESSION['colddrink'] != "")

{

$query = "select * from tblcategory where category_id=".$_SESSION['colddrink'];

$result = mysql_query($query);

$no = mysql_num_rows($result);

$array = mysql_fetch_object($result);

if ($no > 0)

{

echo "<tr><Td width=10><input type=checkbox name=category[] value=".$_SESSION['colddrink']."></td><td class=GeneralText>".$array->categoryName."</td></tr>";

}

}

if ($_SESSION['frozen'] != "")

{

$query = "select * from tblcategory where category_id=".$_SESSION['frozen'];

$result = mysql_query($query);

$no = mysql_num_rows($result);

$array = mysql_fetch_object($result);

if ($no > 0)

{

echo "<tr><Td width=10><input type=checkbox name=category[] value=".$_SESSION['frozen']."></td><td class=GeneralText>".$array->categoryName."</td></tr>";

}

 

}

if ($_SESSION['hotbeverage'] != "")

{

$query = "select * from tblcategory where category_id=".$_SESSION['hotbeverage'];

$result = mysql_query($query);

$no = mysql_num_rows($result);

$array = mysql_fetch_object($result);

if ($no > 0)

{

echo "<tr><Td width=10><input type=checkbox name=category[] value=".$_SESSION['hotbeverage']."></td><td class=GeneralText>".$array->categoryName."</td></tr>";

}

 

}

if ($_SESSION['bsupplies'] != "")

{

$query = "select * from tblcategory where category_id=".$_SESSION['bsupplies'];

 

$result = mysql_query($query);

$no = mysql_num_rows($result);

$array = mysql_fetch_object($result);

if ($no > 0)

{

echo "<tr><Td width=10><input type=checkbox name=category[] value=".$_SESSION['bsupplies']."></td><td class=GeneralText>".$array->categoryName."</td></tr>";

}

 

}

 

if ($_SESSION['watercooler'] != "")

{

$query = "select * from tblcategory where category_id=".$_SESSION['watercooler'];

$result = mysql_query($query);

$no = mysql_num_rows($result);

$array = mysql_fetch_object($result);

if ($no > 0)

{

echo "<tr><Td width=10><input type=checkbox name=category[] value=".$_SESSION['watercooler']."></td><td class=GeneralText>".$array->categoryName."</td></tr>";

}

 

}

?>

              </center>

<Tr><Td colspan=2 align=center>

        <p align="left">

<?

if ($_SESSION['snack'] == "" && $_SESSION['colddrink'] == "" && $_SESSION['frozen'] == "" && $_SESSION['hotbeverage'] == "" && $_SESSION['watercooler'] == "")

{

}

else

{

?>

<input type=submit value=Remove class=button1>

<?

}

?>

        </p>

 

</td></tr></table>

 

              <center>

<?

}

?></center></td>

                </tr>

                <tr>

                  <td width="100%"><br>

<?   if ($_SESSION['snack'] == "" && $_SESSION['colddrink'] == "" && $_SESSION['bsupplies'] == "" && $_SESSION['frozen'] == "" && $_SESSION['hotbeverage'] == "" && $_SESSION['watercooler'] == "")

{

}

else

{ ?>

 

  <input type="submit" value="Finish / Submit" name="B1" class="button3"><? } ?></td>

<?

  $subject = "Request For Vending Services";

 

$msg = "Customer Name: $_POST[customer_name]\n";

$msg .= "Company Name: $_POST[company_name]\n";

$msg .= "Phone: $_POST[phone]\n";

$msg .= "Address: $_POST[address]\n";

$msg .= "City: $_POST[city]\n";

$msg .= "No. of Employees: = $_POST[no_emp]\n";

                    $msg .= "E-Mail:  $_POST\n";

$msg .= "Category: $_POST[category_id]\n";

 

 

//Mail to Client

 

                        $mailheaders = "From: info@georgiavendingservices.com\n";

   

        $mailheaders .= "Bcc: deemurphy_us@yahoo.com"."\r\n";

// $headers .= "Bcc: raju@mavininfotech.com"."\r\n";

// $mailheaders .= "Bcc: rsmith_gvs@bellsouth.net"."\r\n";

$mailheaders .= "MIME-Version: 1.0\n";

$mailheaders .= "Content-type: text/html; charset=iso-8859-1\n";

$mailheaders .= "X-Priority: 1\n";

$mailheaders .= "X-MSMail-Priority: High\n";

$mailheaders .= "X-Mailer: php\n";

$To=$email;

mail($To, $subject, $msg, $mailheaders);

?>

 

Please help with this.

 

Thank you

LadyDee

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.