This is my Page and I dont know where it should go and what to take out if anything.
///////////////////////////
// Add and Insert Functions
///////////////////////////
else if($ax=="add")
{
$date_added=date($date_format);
?>
<p class="bodylgbold">Add a Link</p>
<p class="bodysm"> > <a href="<?php echo $PHP_SELF; ?>">Home</a> > Add a Link</p>
<p class="bodymd">All Fields are required for link submission</p>
<form action="<?php echo $PHP_SELF; ?>?ax=insert" method="post" id="form" onsubmit="return validate_add();">
<table border="0" width="100%" cellspacing="2" cellpadding="0">
<tr>
<td class="bodymd"><span style="color:#FF0000;">*</span>Category:<br />
<select name="cat_id">
<option value="">Select a Category</option>
<?php
$result=MySQLQuery("select * from links_cat where id !=0 order by name",$QueryError_Email,$QueryError_Browser);
while($row=mysql_fetch_array($result))
{
$cat_id=$row["id"];
$cat_name=$row["name"];
echo "<option value=\"$cat_id\"> $cat_name</option>";
}
?>
</select>
</td>
</tr>
<tr><td class="bodymd">Website Name<span style="color:#FF0000;">*</span>:<br /><input name="name" type="text" size="60"/></td></tr>
<tr>
<td class="bodymd">Website Description<span style="color:#FF0000;">* <font color="#000000">(Max
255 characters)</font></span><font color="#000000">:</font><br />
<textarea name="dsc" rows="3" cols="40"></textarea></td></tr>
<tr>
<td class="bodymd">URL<span style="color:#FF0000;">*</span>: <b><font color="#0000FF">DON'T
FORGET!</font></b><br />
<input name="url" type="text" value="http://" size="60"/></td></tr>
<?php if($image_enabled=="yes"){ ?>
<tr>
<td class="bodymd">Image URL: (Images size 125x100 pixels)<br />
<input type="text" name="image" size="60" value="<?php echo $image; ?>" maxlength="100"/></td></tr>
<?php } ?>
<tr><td class="bodymd"> Email:<br /><input type="text" name="email" size="50"/></td></tr>
<tr><td class="bodymd"> Password:<br /><input type="password" name="password" size="10"/></td></tr>
<tr><td class="bodymd"><span style="color:#FF0000;">*</span> - indicates required field</td></tr>
<tr><td><input type="hidden" name="date_added" value="<?php echo $date_added; ?>"/><input type="submit" name="submit" value="Add Link"/></td></tr>
</table>
</form>
<div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#0000FF"><b><font size="2">Submit
Here For Free Traffic!</font></b></font><br>
</div>
<center><a href='http://www.linkreferral.com/cgi-bin/linkreferal/adwel.cgi?oldrefid=49776'><img src='http://www.linkreferral.com/images/linkreferal/linkbutton.gif' border=0 width='114' height='32'></a></center>
<div align="center">
<hr width="300">
<br>
</div>
<center><a href="http://mdtrafficbuilder.com/clickthru.pl?id=kane">
<img src='http://mdtrafficbuilder.com/banner.pl?id=6' border=0 alt="MD Traffic Builder">
</a></center>
<?php
}
else if($ax=="insert")
{
$cat_id=$_POST["cat_id"];
$name=$_POST["name"];
$dsc=$_POST["dsc"];
$url=$_POST["url"];
$email=$_POST["email"];
$password=$_POST["password"];
$date_added=$_POST["date_added"];
$image=$_POST["image"];
if($admin_approved=="no")
{
$approved="no";
}
else
{
$approved="yes";
}
$result=MySQLQuery("insert into links (cat_id,name,dsc,url,approved,email,password,date_added,image,rating,rates) values ('$cat_id','$name','$dsc','$url','$approved','$email','$password','$date_added','$image','0','0')",$QueryError_Email,$QueryError_Browser);
if ($result)
{
mail("$admin_mail", "Link submitted to ".$site_title."", "The link ".$name." is waiting for approval at ".$site_title."", "From: ".$admin_mail."");
if ($email && $password)
{
mail($email, "Link submitted to ".$site_title."","Your link is waiting for approval at ".$site_title.".\nTo update you listing in the future, login with \n\nURL:".$url."\nEmail:".$email."\nPassword:".$password."\n\nThanks for your submission", "From: ".$noreply_mail."");
}
echo "<p class=\"bodylgbold\">The Link Was Added</p>";
echo "<p class=\"bodysm\"><a href=\"".$PHP_SELF."\">Home</a> > <a href=\"".$PHP_SELF."?ax=add\">Add a Link</a> > Link Added</p>";
if($admin_approved=="no")
{
echo "<p class=\"bodymd\">Your link request has been sent to the site administrator for approval.</p>";
echo "<p class=\"bodymd\">An email has also been sent to you regarding your login information should you choose to edit your listing in the future.</p>";
}
else
{
echo "<p class=\"bodymd\">Your link has been added to the directory.</p>";
echo "<p class=\"bodymd\">An email has also been sent to you regarding your login information should you choose to edit your listing in the future.</p>";
}
}
else
{
echo "<p class=\"bodysm\"><a href=\"".$PHP_SELF."\">Home</a> > <a href=\"".$PHP_SELF."?ax=add\">Add a Link</a> > Error Adding Link</p>
<p class=\"bodylgbold\">Error Adding Link</p>";
}
}
If you need more of the code please let me know...it wouldnt let me put it all in here... But I think this is where it should go