håber det er den rigtige kodedel, men jeg tar chancen:
<?PHP
INCLUDE "config.php";
if($sAction == "plug")
{
if(!verifyhtml($sPlugurl)){DIE ($sStyle . $sPlugsconfirmheaderHTML . $sAdminbeforeHTML . "The plug url you entered contained HTML characters, please go back and change this.");}
if(!verifyhtml($sPlugname)){DIE ($sStyle . $sPlugsconfirmheaderHTML . $sAdminbeforeHTML . "The plug name you entered contained HTML characters, please go back and change this.");}
if(!verifyhtml($sPlugdescription)){DIE ($sStyle . $sPlugsconfirmheaderHTML . $sAdminbeforeHTML . "The plug description you entered contained HTML characters, please go back and change this.");}
if(!verifyhtml($sPlugtype)){DIE ($sStyle . $sPlugsconfirmheaderHTML . $sAdminbeforeHTML . "The plug type you entered contained HTML characters, please go back and change this.");}
$sIP = getenv("REMOTE_ADDR");
$sStripurl = $sPlugurl;
preg_match("/^(http:\/\/)?([^\/]+)/i",$sStripurl, $sMatches);
$sStripurl = $sMatches[2];
preg_match("/[^\.\/]+\.[^\.\/]+$/",$sHost,$sMatches);
$sStripurl == $sMatches[0];
$sStripurl = str_replace("www.", "", $sStripurl);
func_MysqlConnect6();
$sQuery = "SELECT * FROM plugathug WHERE plugurlshort='$sStripurl'";
$sQueryresult = mysql_query($sQuery) or die ("<font face=verdana>Error: " . mysql_error());
$sNum = mysql_numrows(mysql_query($sQuery));
if ($sNum == 1)
{
while ($sRow = mysql_fetch_array($sQueryresult))
{
$sLastIP = $sRow["ip"];
$sLastposttime = $sRow["lastposted"];
$sIsbanned = $sRow["banned"];
}
$sTotaltime = $sWaitdays * 86400;
$sLastposttime = time() - $sLastposttime;
if($sLastposttime > $sTotaltime AND $sIsbanned == "false")
{
$sDate = date($sDateformat);
$sTime = time();
if($sValidate == "yes"){$sBanned = "true";}else{$sBanned = "false";}
$sQuery = "UPDATE plugathug SET ip='$sIP', plugurl='$sPlugurl', dateposted='$sDate', lastposted='$sTime', plugdescription='$sPlugdescription', plugname='$sPlugname', plugtype='$sPlugtype' WHERE plugurlshort='$sStripurl'";
$sQueryresult = mysql_query($sQuery) or trigger_error("MySQL error nr ".mysql_errno().": ".mysql_error());
}
else
{
DIE ($sStyle . $sPlugsconfirmheaderHTML . $sAdminbeforeHTML . "You are banned or are posting your plug again too soon, you must wait $sWaitdays days before the original post date before posting this again.");
}
}
else
{
if($sPlugurl != "" AND $sPlugurl != "
http://" AND $sPlugname != "Sitename" AND $sPlugdescription != "Description")
{
$sDate = date($sDateformat);
$sTime = time();
if($sValidate == "yes"){$sBanned = "true";}else{$sBanned = "false";}
mysql_query ("INSERT INTO plugathug (ip, plugname, plugurl, plugurlshort, plugdescription, plugtype, dateposted, lastposted, banned) VALUES ('$sIP', '$sPlugname', '$sPlugurl', '$sStripurl', '$sPlugdescription', '$sPlugtype', '$sDate', '$sTime', '$sBanned')") or trigger_error("MySQL error nr ".mysql_errno().": ".mysql_error());
}
else
{
DIE ($sStyle . $sPlugsconfirmheaderHTML . $sAdminbeforeHTML . "Some of the fields you entered were missing or invalid.");
}
}
if($sValidate == "yes")
{
$sReturnurl = getenv("HTTP_REFERER");
DIE ($sStyle . $sPlugsconfirmheaderHTML . $sAdminbeforeHTML . "Your plug was submitted successfully!<BR>The administrator requires each plug to be verified before it is listed.<BR>To return to the page you came from click <A HREF=$sReturnurl>here</A>");
}
else
{
$sReturnurl = getenv("HTTP_REFERER");
PRINT "<script language=\"JavaScript\">window.location='$sReturnurl'</script>";
}
mysql_close();
}
elseif($sAction == "out")
{
func_Addclickout($sPlugurl);
}