File size: 2.94Kb
<?php
header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
echo "<head><title>Edit site</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"wapirate.net :)\">
<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
?>
<wml>
<?php
echo "<onevent type=\"onenterforward\"><refresh><setvar name=\"lnk\" value=\"http://\"/><setvar name=\"imgu\" value=\"http://\"/><setvar name=\"dsc\" value=\"\"/><setvar name=\"snm\" value=\"\"/></refresh></onevent>";
?>
<p align="center">
<?php
include("func.php");
include("conf.php");
$uid=$_GET["uid"];
$pwd=$_GET["pwd"];
$sid=$_GET["sid"];
connect($dbserver,$dbname,$dbuser,$dbpass);
$suid = mysql_fetch_array(mysql_query("SELECT uid,sitename,sitelink,slogo,email,dscr,keywords,cid FROM sites WHERE id='".$sid."'"));
$duid = mysql_fetch_array(mysql_query("SELECT id FROM tusers WHERE name='".$uid."'"));
$catnm = mysql_fetch_array(mysql_query("SELECT id FROM cats where id='".$suid[7]."'"));
if($suid[0]==$duid[0])
{
$canedit = true;
}else{
$canedit = false;
}
if((isadmin($uid,$pwd)) || ($canedit))
{
echo "<form action=\"edts2.php?uid=$uid&pwd=$pwd\" method=\"post\">";
echo "Site Name:<input name=\"snm\" maxlength=\"30\" type=\"text\" value=\"$suid[1]\"/><br/>";
echo "Site Link: <input name=\"lnk\" maxlength=\"200\" type=\"text\" value=\"$suid[2]\"/><br/>";
echo "Logo URL: <input name=\"imgu\" maxlength=\"200\" type=\"text\" value=\"$suid[3]\"/><br/>";
echo "Email: <input name=\"email\" maxlength=\"200\" type=\"text\" value=\"$suid[4]\"/><br/>";
echo "Description: <input name=\"dsc\" maxlength=\"200\" type=\"text\" value=\"$suid[5]\"/><br/>";
echo "Keywords: <input name=\"kwrd\" maxlength=\"200\" type=\"text\" value=\"$suid[6]\"/><br/>";
echo "<select name=\"$catnm[0]\" >";
//cats
$cats = mysql_query("SELECT * FROM cats ORDER BY name;");
while ($cat = mysql_fetch_array($cats))
{
echo "<option value=\"$cat[0]\">$cat[1]</option>";
}
//cats
echo "</select><br/>";
echo "<input type=\"submit\" value=\"Edit Site\"/>";
echo "<br/><a href=\"cpanel.php?uid=$uid&pwd=$pwd&logm=gt\">Cancel</a><br/>";
echo "</p><p align=\"center\">";
}else{
echo "You don't have the privileges to do this";
}
echo "<br/><a href=\"index.php?uid=$uid&pwd=$pwd\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
?>
</p>
</body>
</html>