Posting Ad while E-mailing Ad
Posted: Wed May 18, 2005 1:17 pm
Hi,
I've own a Classified Ad Script (Custom made). When someone makes a new ad, I want it to e-mail it to me. The Code right now is only setup to Post it. I want it to Post it and E-mail it at the same time.
Here is the code for the New Ad:
I'm also needing it to add 5 Checkmark Boxes under the text boxes that are already in the code - Just in the New Ad, don't need them in the Edit Ad.
If anyone can point me in the correct direction or give me directions on how to do any of this, it will be greatly appreciated.
THANKS!
I've own a Classified Ad Script (Custom made). When someone makes a new ad, I want it to e-mail it to me. The Code right now is only setup to Post it. I want it to Post it and E-mail it at the same time.
Here is the code for the New Ad:
Code: Select all
<?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>';
}
//If you're trying to delete an ad
if(isset($_POST['DeleteAd']))
{
//Create the CAd object, and load the data
$ad = new CAd($sql);
$ad->LoadAd($_GET['Edit']);
//If someone thinks they're really smart and tries to fake the HTTP POST transmission, we'll stop 'em... again...
if($ad->owner != $user->ID)
die('Hacking Attempt. The site owner has been notified. Further attempts will result in banning.');
//Delete ad and display success message
$ad->DeleteAd();
echo '<script language="JavaScript">alert("Success. Your ad has been deleted.");location="register.php";</script>';
}
//If you're trying to edit an ad
if(isset($_POST['EditAd']))
{
//Create the CAd object, and load the data
$ad = new CAd($sql);
$ad->LoadAd($_GET['Edit']);
//If someone thinks they're really smart and tries to fake the HTTP POST transmission, we'll stop 'em... again...
if($ad->owner != $user->ID)
die('Hacking Attempt. The site owner has been notified. Further attempts will result in banning.');
//Edit ad and display success message
if($ad->EditAd($_POST['title'], $_POST['price'], $_POST['info'], $_POST['category']))
echo '<script language="JavaScript">alert("Success. Your ad has been edited.");location="register.php";</script>';
}
//Display edit ad
if(isset($_GET['Edit']))
{
$ad = new CAd($sql);
$ad->LoadAd($_GET['Edit']);
//If someone thinks they're smart and they'll simply change the value in the URL... Terminate page execution with a nasty message
if($ad->owner != $user->ID)
die('Hacking Attempt. The site owner has been notified. Further attempts will result in banning.');
echo $ad->OutputEditAd();
}
//Display create ad
else
{
$ad = new CAd($sql);
echo $ad->OutputNewAd();
}
require('footer.php');
?>I'm also needing it to add 5 Checkmark Boxes under the text boxes that are already in the code - Just in the New Ad, don't need them in the Edit Ad.
If anyone can point me in the correct direction or give me directions on how to do any of this, it will be greatly appreciated.
THANKS!