This will be the last question for awhile, the rest of my codes I know how to do it.
This code is suppose to send me an e-mail with the Title and Category the Ad is placed in. It is also suppose to tell me if any of the checkmark boxes are checked.
Here is the code:
[code=php]<?php
require(‘header.php’);
//If you’re not logged in…
if($user->name == ”)
{
echo ‘Sorry, you must be logged in to post an ad…’;
require(‘footer.php’);
die(”);
}
//If you’re trying to post a new ad
if(isset($_POST[‘NewAd’]))
{
//Create the CAd object, and create the ad
$ad = new CAd($sql);
var_dump($_POST);
var_dump($_FILES);
if($ad->NewAd($user->ID, $_POST[‘title’], ((isset($_POST[‘image_l’]) && $_POST[‘image_l’] != ”) ? $_POST[‘image_l’] : $_FILES[‘image_f’]), $_POST[‘category’], $_POST[‘price’], nl2br($_POST[‘info’]), $_POST[‘location’]))
echo ‘<script language=”JavaScript”>alert(“Success. Your ad has been placed.”);</script>’;
}
echo ‘<input type=”checkbox” name=”premier” value=”permier”>’;
echo ‘<input type=”checkbox” name=”bold” value=”bold”>’;
echo ‘<input type=”checkbox” name=”border” value=”border”>’;
if(isset($_POST[‘premier’])) echo “this checkbox has been checked!”;
if(isset($_POST[‘bold’])) echo “this checkbox has been checked!”;
if(isset($_POST[‘border’])) echo “this checkbox has been checked!”;
if(isset($_POST[‘NewAd’]))
{
$to = “”;
$content = $_POST[‘title’] . $_POST[‘category’] . $_POST[‘premier’] . $_POST[‘bold’] . $_POST[‘border’];
mail($to,”);
}
I get an e-mail with the Title and Category, but when I click on the checkbox, it doesn’t send me an e-mail telling me it has been checked.
The Checkmarks, Title, and Category all are being sent to me in one e-mail, not seperate.
Thanks again, this site has really been helpful! ?