Ok... I am at home now.
Try doing this for me:
while ($row = mysql_fetch_array($result)) {
$job_id = $row['job_id'];
$job_title = $row['job_title'];
// Display checkboxes using the job data
if ($_HTTP_POST_VARS['job[$job_id]'] == '$job_title') {
echo ("<input type=\"checkbox\" name=\"job[$job_id]\" value=\"$job_title\" checked> $job_title<br>\n");
} else {
echo ("<input type=\"checkbox\" name=\"job[$job_id]\" value=\"$job_title\"> $job_title<br>\n");
}
} // end while loop
if the doesn't work then try this:
while ($row = mysql_fetch_array($result)) {
$job_id = $row['job_id'];
$job_title = $row['job_title'];
// Display checkboxes using the job data
if ($_HTTP_POST_VARS['job[$job_id]'] == '$job_id') {
echo ("<input type=\"checkbox\" name=\"job[$job_id]\" value=\"$job_title\" checked> $job_title<br>\n");
} else {
echo ("<input type=\"checkbox\" name=\"job[$job_id]\" value=\"$job_title\"> $job_title<br>\n");
}
} // end while loop
See if that works out. If not then do this one:
while ($row = mysql_fetch_array($result)) {
$job_id = $row['job_id'];
$job_title = $row['job_title'];
// Display checkboxes using the job data
echo "$_HTTP_POST_VARS['job[$job_id]'] || COMPARED TO || $job_title || OR || $job_id<br>";
$temp_posted_jobid = $_HTTP_POST_VARS['job[$job_id']'];
echo "$temp_posted_jobid<br>";
if($temp_posted_jobid == $job_id)
{
echo "We have a match HOUSTON!<br>";
}
} // end while loop
That way you can disect EXACTLY your results. If you get a match somewhere then heck you know how to take what your expected is and make it into what you want. I wish I could help you further but man it's hard to test something like this without being on the server. I will show you how I did it a while back:
<?php
// This page was part of the form. Then it would be called
// using $PHPSELF. Then it would run the next script.
// This is an include of the connection strings.
include("connection.inc");
// First I get everything from categories.
$sql = "select * from categories";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
// I then get the category_id.
$category_id = $row['category_id'];
$category_name = $row['category_name'];
// This just outputs the category name
echo "\r\r<p><strong>$category_name<br>";
$sqla = "select * from subcategories where ref_cat='$category_id'";
$resulta = mysql_query($sqla);
while ($row = mysql_fetch_array($resulta)) {
$sub_id = $row['sub_catid'];
$sub_title = $row['sub_title'];
echo "\r<input name='checkbox[]' type='checkbox' class='text_boxes_contractor' value='$sub_id'></strong>$sub_title<br>";
}
}
?>
<?php
$sql = "select * from member_accounts where account_type='4'";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$owner_id = $row['member_id'];
$owner_email = $row['member_email'];
$sqla = "select * from profiles where owner_id='$owner_id'";
$resulta = mysql_query($sqla);
while ($rowa = mysql_fetch_array($resulta)){
$categories_served = $rowa['categories_served'];
$cat_served_array = explode(",",$categories_served);
foreach($cat_served_array as $cat_id)
{
foreach($checkbox as $checkbox_value)
{
if($cat_id == $checkbox_value)
{
//This will be where we mail the suppliers!
// It will also disallow duplicate emails to the suppliers.
// Good.
MailSupplierRFP ($url,$start_date,$ending_date,$project_title,$project_description,$owner_email);
$done = 1;
}
if($done == 1)
{
break;
}
}
}
}
}
?>
That is a really long winded thing but basically what I did is take the categories and checked them against a database to see if a user had this marked as a category they were interested in. If so then it would send an email to them. But it would not duplicate an email, hence if you had 3 categories you wanted to get an email on and all 3 were listed it would not send you 3 emails just one. Making it easier for you and the customer. :-D Let me know if this helps you out at all. I hope it did and I guess my signature really shines through with this coding. Haha.
Lata,
Chad