i made some revisions on Tommie. scripts and wizards script..
upload.php
<?php
include("config.php");
include("core.php");
//session_start();
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>$title</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/default.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"Natasu\">
<meta name=\"keywords\" content=\"free, natasu, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
$bcon = connectdb();
if (!$bcon)
{
echo "<img src=\"images/exit.gif\" alt=\"*\"/>
";
echo "ERROR! cannot connect to database
";
echo "This error happens usually when backing up the database, please be patient, The site will be up any minute
";
echo "you can temperoray be in this site <a href=\"$siteurl\">$title</a> while $title is offline
";
echo "[b]THANK YOU VERY MUCH[/b]";
echo "</p>";
echo "</html>";
echo "</body>";
exit();
}
$brws = explode(" ",$_SERVER[HTTP_USER_AGENT] );
$ubr = $brws[0];
$uip = getip();
$action = $_GET["action"];
$sid = $_GET["sid"];
$page = $_GET["page"];
$who = $_GET["who"];
$uid = getuid_sid($sid);
cleardata();
if(isipbanned($uip,$ubr))
{
if(!isshield(getuid_sid($sid)))
{
echo "<p align=\"center\">";
echo "<img src=\"images/notok.gif\" alt=\"x\"/>
";
echo "This IP address is blocked
";
echo "
";
echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over
";
$banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 "));
//echo mysql_error();
$remain = $banto[0] - time();
$rmsg = gettimemsg($remain);
echo " IP: $rmsg
";
echo "</p>";
echo "
";
echo "<form align=\"left\" action=\"login.php\" method=\"post\" ENCTYPE=\"multipart/form-data\">";
echo "UserID: <input name=\"loguid\" format=\"*x\" maxlength=\"30\"/>
";
echo "Password: <input type=\"password\" name=\"logpwd\" maxlength=\"30\"/>
";
echo "<postfield name=\"loguid\" value=\"$(loguid)\"/>";
echo "<postfield name=\"logpwd\" value=\"$(logpwd)\"/>";
echo "<input type=\"submit\" value=\"Login!\"/>
";
echo "</form>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
}
if(($action != "") && ($action!="terms"))
{
$uid = getuid_sid($sid);
if((islogged($sid)==false)||($uid==0))
{
echo "You are not logged in
";
echo "Or Your session has been expired
";
echo "<a href=\"index.php\">Login</a>
";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
}
//echo isbanned($uid);
if(isbanned($uid))
{
echo "<p align=\"center\">";
echo "<img src=\"images/notok.gif\" alt=\"x\"/>
";
echo "You are [b]Banned[/b]
";
$banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));
$banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
$remain = $banto[0]- time();
$rmsg = gettimemsg($remain);
echo "Time to finish your penalty: $rmsg
";
echo "Ban Reason: $banres[0]";
//echo "<a href=\"index.php\">Login</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
$res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");
if($action=="uploader")
{
addvisitor();
addonline(getuid_sid($sid),"User Pic Uploader","");
$nick = getnick_sid($sid);
$uid = getuid_sid($sid);
$nopl = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$uid."'"));
if($nopl[0]=='M')
{
$usex = "M";
}else if($nopl[0]=='F'){
$usex = "F";
}else{
$usex = "M";
}
echo "Welcome $nick
";
//get file name
if ($upload="upload"&&$file_name){
if (!eregi("\.(jpeg|jpg)$",$file_name)){
print "[b]Unsuported File extention!!![/b]";
}else{
$file_name = preg_replace(
'/[^a-zA-Z0-9\.\$\%\'\`\-\@\{\}\~\!\#\(\)\&\_\^]/'
,'',str_replace(array(' ','%20'),array('_','_'),$file_name));
if(strlen($file_name)>53){ print "[b]File Name to long!!![/b]";
}else{
if (empty($file)) {
print "[b]No input file specified!!![/b]";
}else{
if (file_exists($file_name))
{
echo "Pic already exists";
echo "
<a href=\"upload.php\">Upload xhtml</a>
";
echo "
<a href=\"index.php\">Uploads</a>
";
echo "[b]Natasu ©[/b]
";
print "</p></body></html>";
exit();
}
$pics = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM gallery where uid='".$uid."'"));
$cpic = $pics[0]+1;
$rev = strrev ($file_name);
$exp = explode (".", $rev);
$true = strrev ($exp[0]);
$trueext = strtolower ($true);
$picn = "$nick$cpic.$trueext";
copy("$file", "gallery/$file_name") or
die("Couldn't copy file.");
$adds = mysql_query("INSERT INTO gallery SET uid='".$uid."', file='$file_name', sex='".$usex."'");
if ($adds) {
echo "added pic $file_name
";
} else {
echo "Please try again
";
}
echo "file has been successfully uploaded";
}
}
}
}
?>
<?php
echo "<form align=\"left\" action=\"upload.php?action=uploader&sid=$sid\" method=\"post\" ENCTYPE=\"multipart/form-data\">
File:
<input type=\"file\" name=\"file\" size=\"30\"/>
<input type=\"submit\" value=\"Upload\"/>
<a href=\"pics.php?action=gallery&sid=$sid\">Back to Gallery</a>
<a href=\"index.php?action=main&sid=$sid\">Home</a>
<font color=\"red\">Natasu ©</font>";
}
echo "</form>
</body>
</html>";
?>
ch777 the folder gallery..