Location: PHPKode > projects > H-tracker > advertise.php
<?
//
//  H-Tracker v0.2
//    http://h-tracker.org
//    Based on TorrentTrader (http://www.torrenttrader.org)
//
//
require_once("backend/functions.php");
dbconn();
loggedinonly();
if ($_SERVER["REQUEST_METHOD"] == "POST") {

$name = $_POST["name"];
$email = $_POST["email"];
$month = $_POST["months"];
$url = $_POST["url"];
$banners = $_POST["banners"];
$notes = $_POST["notes"];
$ip = getip();

if (empty($name) || empty($email) || empty($url) || empty($month) || empty($banners))
show_error_msg("Error", "Missing form data.");

if (!validemail($email))
show_error_msg("Error", "It appears that the email address you entered is not valid.");

if (!(is_numeric($month) && ($month > 0) && (floor($month) == $month)))
show_error_msg("Error", "Please enter a numeric value for the number of months you would like to advertise.");

mysql_query("INSERT INTO ads (added, name, email, site_url, months, banners, notes, ip) VALUES ('".get_date_time()."', ".sqlesc($name).", ".sqlesc($email).", ".sqlesc($url).", ".sqlesc($month).", ".sqlesc($banners).", ".sqlesc($notes).", ".sqlesc(ip2long($ip)).")") or die(mysql_error());

show_error_msg("Thank you", "Your response will be emailed to you soon.");
}

stdhead("Advertise with us");
begin_frame("Advertise with us");
print("<form method=post action=advertise.php>");
print("<table align=center class=tablebg width=100% cellspacing=0 cellpadding=5>");
print("<tr><td class=row1>Name:</td><td class=row2><input type=text name=name size=25></td></tr>");
print("<tr><td class=row1>Email address:</td><td class=row2><input type=text name=email size=50></td></tr>");
print("<tr><td class=row1>Site URL:</td><td class=row2><input type=text name=url size=50></td></tr>");
print("<tr><td class=row1>Months:</td><td class=row2><input type=text name=months size=4></td></tr>");
print("<tr><td class=row1>Banner URL(image):</td><td class=row2><textarea cols=45 rows=1 name=banners>exemple:http://yoursite.com/bannerimage.jpg</textarea></td></tr>");
print("<tr><td class=row1>Notes:</td><td class=row2><textarea cols=45 rows=3 name=notes></textarea></td></tr>");
print("<tr><td colspan=2 align=center class=rowend><input type=submit value=Advertise!></td></tr>");
print("</td></tr></table>");
print("</form>");
end_frame();
stdfoot();

?>
Return current item: H-tracker