It doesn't insert it into the database and the "Link Added Succesfully" doesn't even appear...I think it has something to do with the ($poll).
<?
$pagetitle="Add a Link";
include("../include/head.php");
echo $harsss;
function auth($userid, $password) {
$sql="SELECT username FROM users WHERE username='$userid' AND userpass='$password'";
$result=mysql_query($sql);
if(!mysql_num_rows($result)) return 0;
else {
$query_data=mysql_fetch_row($result);
return $query_data[0];
}
}
$username=auth($uname,$pword);
if (!$username)
{
echo "<table border=1 cellspacing=0 width=100%>
<tr><td>You are not authorized to view this page.</td></tr>
</table>
";
include("../include/foot.php");
exit;
}
echo "<table border=1 cellspacing=0 width=100%>
<tr><td colspan=3 align=center><font size=6>Add a Link</td></tr>
<tr><td colspan=3 align=center class=dark><i>Return to: <a class=menu href=\"../boards/index.php\">Board List</a>";
if ($board) { echo " | <a class=menu href=\"../boards/gentopic.php?board=$board\">Topic List</a>"; }
if ($topic) { echo " | <a class=menu href=\"../boards/genmessage.php?board=$board&topic=$topic>Message List</a>"; }
echo " | <a href=\"../links.php\">Links</a></i></td></tr>";
echo "<tr><td align=center>If you post explicit pictures is terms for immediate suspension. In other words, DON'T do it!, you'll just get yourself suspended.</td></tr>";
if (($post) && ($linkid) && ($linkname) && ($linkdesc)) {
$query="INSERT INTO link (linkid,linkname,linkdesc,user) VALUES ('".$linkid."','".$linkname."','".$linkdesc."')";
$dbresult=mysql_query($query);
echo "<tr><td colspan=3 align=center>Link added successfully.</td></tr>";
}
echo "<tr><td colspan=3 class=dark align=center><font size=3>Add New Link</font></td></tr>";
echo "<form action=\"addlink.php";
if ($board) { echo "?board=$board"; }
if ($topic) { echo "&topic=$topic"; }
echo "\" method=\"post\">
<tr><td class=cell1>URL: <input type=\"text\" name=\"link\" value=\"\" size=\"30\" maxlength=\"30\"></td></tr>
<tr><td class=cell2>Link Name: <input type=\"text\" name=\"linkname\" value=\"\" size=\"30\" maxlength=\"25\"></td></tr>
<tr><td colspan=2 class=cell1>Link Description:
<input type=\"text\" name=\"linkdesc\" size=\"30\" maxlength=\"300\"></td></tr>
<tr><td colspan=3 class=cell2 align=center><input type=\"submit\" name=\"post\" value=\"Add Link\"></td></tr></form></table>";
include("../foot.php");
?>