Code:
<?php
if (isset($_REQUEST['Submit'])) {
# Feudel.co.uk Advertising Manager
$sql = "INSERT INTO $db_table(RefNum,Site,Contact,AddressLine1,AddressLine2,TownCounty,PostCode,TelNo,InvoiceEmail,PayMethod,StartDate,EndDate,bannerurl) values ('".mysql_real_escape_string(stripslashes($_REQUEST['RefNum']))."','".mysql_real_escape_string(stripslashes($_REQUEST['Site']))."','".mysql_real_escape_string(stripslashes($_REQUEST['Contact']))."','".mysql_real_escape_string(($_REQUEST['bannerurl']))."','".mysql_real_escape_string(($_REQUEST['TelNo']))."','".mysql_real_escape_string(($_REQUEST['InvoiceEmail']))."','".mysql_real_escape_string(($_REQUEST['PayMethod']))."','".mysql_real_escape_string(($_REQUEST['StartDate']))."','".mysql_real_escape_string(($_REQUEST['EndDate']))."','".mysql_real_escape_string(($_REQUEST['AddressLine1']))."','".mysql_real_escape_string(($_REQUEST['AddressLine2']))."','".mysql_real_escape_string(($_REQUEST['TownCounty']))."','".mysql_real_escape_string(($_REQUEST['PostCode']))."')";
if($result = mysql_query($sql ,$db)) {
echo '<div class="ocontentsection">
<div class="contenttext"><table class="gltable" cellpadding="0" cellspacing="0"><center>Thank you<br>Your information has been entered.<br><img src="http://www.feudel.co.uk/arcade/plugins/site/themes/GreyJohnsSkin/header/header_r1_c1.gif"><br><br><a href="http://www.feudel.co.uk/arcade/ads">Return</a>';
} else {
echo "ERROR: ".mysql_error();
}
} else {
?><div class="ocontentsection">
<div class="contenttext"><table class="gltable" cellpadding="0" cellspacing="0"><center>
If you have accepted an advertisement, Please enter information here, a reference number will then be generated and all staff will use this number when contacting the buyer of advertisements!</center>
<form method="post" action="">
<center>
<input type="hidden" name="RefNum" value="<?php $random = rand(000000000,999999999); echo $random; ?>">
<br>
<b>Site URL:</b> <br>
<input type="text" name="Site">
<br>
<b>Contact:</b><br>
<input type="text" name="Contact">
<br>
<b>Company Address:</b> <br>
<input type="text" name="AddressLine1">
<br><input type="text" name="AddressLine2">
<br><input type="text" name="TownCounty">
<br><input type="text" name="PostCode">
<br>
<b>Company Telephone Number:</b> <br>
<input type="text" name="TelNo">
<br>
<b>Invoice email address (Leave blank if the same as contact email address):</b> <br>
<input type="text" name="InvoiceEmail">
<br>
<b>Pay Method:</b> <br>
<input type="text" name="PayMethod">
<br>
<b>Start Date:</b> <br>
<input type="text" name="StartDate">
<br>
<b>End Date:</b> <br>
<input type="text" name="EndDate">
<br>
<b>Banner URL:</b><br>
<input type="text" name="bannerurl">
<br><br>
<input type="submit" name="Submit" value="Submit">
</center></form>
<?php
}
?>
Okay i decided to give up on that one so i did this, i have my form, but when i submit it it sorta jiggles all of the results around into the wrong fields, BTW on their i haven't included my database connect but i do have one :]