Script Afta Dark Problem

Started on the old forum in November 2007 · view the original in the archive · old links redirect here

3 replies · 863 views · started 19 years ago · 1 min read

3 participants
sweetangel Lead · 885 posts #1

Any1 have a page /smilies/index.php ??? I not can upload new smiley with this code...

<?php  

header(location:../index.php);

?>

tnks

if like my post click:

External image (may be gone)

WhiteWarrior Principal · 1,419 posts #3

CODE<?php include("../wap/config.php"); include("../wap/core.php"); connectdb(); $brw = $HTTP_USER_AGENT; $brws = explode("/",$HTTP_USER_AGENT); $ubr = $brws[0]; $uip = getip(); $action = $_GET["action"]; $sid = $_GET["sid"]; $page = $_GET["page"]; $who = $_GET["who"]; $uid = getuid_sid($sid); $nick = getnick_uid($uid); $upload = $_GET["upload"]; $theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'")); $bcon = connectdb(); $script = $_GET["script"];

if($script=="wml"){ header("Content-type: text/vnd.wap.wml"); header("Cache-Control: no-store, no-cache, must-revalidate"); echo '<?xml version="1.0"?' . '>'; echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; }else{ header("Content-type: text/html; charset=ISO-8859-1"); header("Cache-Control: no-cache, must-revalidate, max-age=0"); header("Pragma: no-cache"); echo '<?xml version="1.0"?' . '>'; echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"; } if($script=="wml"){ echo "<wml>"; }else{ echo "<html xmlns="http://www.w3.org/1999/xhtml">"; }

/////////////////////////////Database Error/////////////////////////////

if (!$bcon) { if($script=="wml"){ echo "<card id="main" title="Error!!!">"; }else{ echo "<head>"; echo "<title>Error!!!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/white.css">"; echo "</head>"; echo "<body>"; } echo " "; 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..."; echo " "; if($script=="wml"){ echo "</card>"; echo "</wml>"; }else{ echo "</body>"; echo "</html>"; } exit(); }

cleardata(); /////////////////////////////Ip Banned/////////////////////////////

if(isipbanned($uip,$ubr)) { if(!isshield(getuid_sid($sid))) { echo "<head>"; echo "<title>Ip Block!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme">"; echo "</head>"; echo "<body>"; echo " "; 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 " "; echo "

"; echo "<form action="../web/login.php" method="get">"; echo "UserID: <input name="loguid" format="*x" maxlength="30"/> "; echo "Password: <input type="password" name="logpwd" maxlength="30"/> "; echo " <input name="LOGIN" type="submit" value="Submit"></form>"; echo "<img src="../images/banner.gif" alt=""/> "; echo "

Not registered yet? <a href="../web/register.php">SignUp</a> "; echo "<a href="../web/index.php?action=terms&sid=$sid">Site Rules</a> "; echo " "; echo "</body>"; echo "</html>"; exit(); } } /////////////////////////////Session Expired/////////////////////////////

if(($action != "") && ($action!="terms")) { $uid = getuid_sid($sid); if((islogged($sid)==false)||($uid==0)) { if($script=="wml"){ echo "<card id="main" title="Error!!!">"; }else{ echo "<head>"; echo "<title>Error!!!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/white.css">"; echo "</head>"; echo "<body>"; } echo " "; echo "You are not logged in "; echo "Or Your session has been expired

"; if($script=="wml"){ echo "<a href="../wap/index.php">Login</a>"; }else{ echo "<a href="../web/index.php">Login</a>"; } echo " "; if($script=="wml"){ echo "</card>"; echo "</wml>"; }else{ echo "</body>"; echo "</html>"; } exit(); } } /////////////////////////////Banned/////////////////////////////

if(isbanned($uid)) { if($script=="wml"){ echo "<card id="main" title="Error!!!">"; }else{ echo "<head>"; echo "<title>Error!!!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme">"; echo "</head>"; echo "<body>"; } echo " "; echo "<img src="images/notok.gif" alt="x"/> "; echo "You are Banned

"; $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid 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 Left:$rmsg "; $nick = getnick_uid($banto[2]); echo "By:$nick "; echo "Reason:$banto[1]"; //echo "<a href="../web/index.php">Login</a>"; echo " "; if($script=="wml"){ echo "</card>"; echo "</wml>"; }else{ echo "</body>"; echo "</html>"; } exit(); } /////////////////////////////smilies/////////////////////////////

else if($action=="smilies") { addonline(getuid_sid($sid),"Viewing Smilies",""); if($script=="wml"){ echo "<card id="main" title="Gallery Pics">"; echo " "; }else{ echo "<head>"; echo "<title>Smilies</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo ""; } $items_per_page = "10"; if (!isset($page)) {$page = 0;} $total = 0; if(!($dp = opendir("./"))) die ("Cannot open ./"); $file_array = array();

while ($file = readdir ($dp)) { if(substr($file,0,1) != '.' and $file != "index.php") { $file_array[] = $file; } } $file_count = count ($file_array); sort ($file_array); echo "Smilies "; if ($file_count > 0) { $first_record = $page * $items_per_page; $last_record = $first_record + $items_per_page; while (list($fileIndexValue, $file_name) = each ($file_array)) { if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record)) {

if((isowner(getuid_sid($sid)))||(isheadadmin(getuid_sid($sid)))) { $delpic=" <a href="index.php?action=smilies&page=$page&sid=$sid&script=$script&delete=$file_name"><img src="../images/notok.gif" alt="[x]"/></a> "; } echo "<a href="$file_name">$file_name</a> ". round(filesize($file_name)/1024,1) . "kb$delpic "; $delete = $_GET["delete"]; if($delete=="$file_name"){ if((isowner(getuid_sid($sid)))||(isheadadmin(getuid_sid($sid)))) { unlink("./$file_name"); echo " $file_name deleted successfully "; if($script=="wml"){ echo "<card id="refresh" title="refresh" ontimer="index.php?action=smilies&page=$page&sid=$sid&script=$script">"; echo "<timer value="1"/>pls wait while browser redirects</card> </card></wml>"; exit(); }else{ echo "<meta http-equiv=Refresh content=1;url=index.php?action=smilies&page=$page&sid=$sid&script=$script>"; echo "

</body></html>"; exit(); } } } $total = $total + filesize($file_name); } } echo " "; $pages =(int) ceil($file_count / $items_per_page); $pages = ($pages -1);

if (($file_count > 0) AND ($page != 0)) { $prev_page = $page -1; echo "<a href="".$_SERVER["PHP_SELF"]."?action=smilies&page=$prev_page&sid=$sid&script=$script"><img src="../images/prev.gif" alt="Prev"/></a> |"; } if (($file_count > 0) AND ($last_record < $file_count)) { $next_page = $page + 1; echo " <a href="".$_SERVER["PHP_SELF"]."?action=smilies&page=$next_page&sid=$sid&script=$script"><img src="../images/next.gif" alt="Next"/></a>"; } if ($file_count > 10) { if($script=="wml"){ $rets = " Jump (0-$pages/$page) <input name="pg" format="*N" size="2"/>"; $rets .= "<anchor>goto page"; $rets .= "<go href="index.php" method="get">"; $rets .= "<postfield name="action" value="$action"/>"; $rets .= "<postfield name="sid" value="$sid"/>"; $rets .= "<postfield name="script" value="$script"/>"; $rets .= "<postfield name="page" value="$(pg)"/>"; $rets .= "</go></anchor> "; echo $rets; }else{ $rets = "<form action="index.php" method="get">"; $rets .= "Jump (0-$pages/$page) <input name="page" style="-wap-input-format: '*N'" size="2"/>"; $rets .= "<input type="hidden" name="action" value="$action">"; $rets .= "<input type="hidden" name="sid" value="$sid">"; $rets .= "<input type="hidden" name="script" value="$script">"; $rets .= "<input type="Submit" name="Submit" Value="goto page"></form>"; echo $rets; } echo " "; } echo " Directory: $file_count "; if ($file_count == 1) {echo "file";} else {echo "files";} }

echo " "; if((strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.XHTML+XML") > 0)||( strpos(strtoupper($HTTP_ACCEPT),"XHTML+XML") > 0)||($ubr=="Mozilla")) { echo "<a href="index.php?action=upload&sid=$sid&script=xhtml&prevscript=$script">Upload</a> "; } if(isowner(getuid_sid($sid))) { if($script=="wml") { echo "<a href="../wap/ownercp.php?action=addsml&sid=$sid">Link Smilies into site</a> "; }else{ echo "<a href="../web/ownercp.php?action=addsml&sid=$sid">Link Smilies into site</a> "; } }else if(isheadadmin(getuid_sid($sid))) { if($script=="wml") { echo "<a href="../wap/headadmincp.php?action=addsml&sid=$sid">Link Smilies into site</a> "; }else{ echo "<a href="../web/headadmincp.php?action=addsml&sid=$sid">Link Smilies into site</a> "; } } closedir($dp); if($script=="wml"){ echo "<a href="../wap/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; echo " "; echo "</card>"; }else{ echo "0<a accesskey="0" href="../web/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; echo ""; echo "</body>"; } } /////////////////////////////upload//////////////////////////////

else if($action=="upload") { if((isowner(getuid_sid($sid)))||(isheadadmin(getuid_sid($sid)))) { $script2 = $_GET["prevscript"]; addonline(getuid_sid($sid),"Uploading Smilies",""); if($script=="wml"){ echo "<card id="main" title="Gallery Pics">"; }else{ echo "<head>"; echo "<title>Upload Smilie</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; } echo " "; echo "Upload "; echo "Image Files "; $size_bytes = 2048000; $kb = $size_bytes / 1024; $mb = $kb / 1024; echo "Max $mb Mb "; if($script=="wml"){ echo "<img src="../images/point.gif" alt="!"/>Browser not compatible wif xhtml uploader"; }else{ echo "<form method="post" enctype="multipart/form-data" action="index.php?action=upload&sid=$sid&upload=add&script=$script&prevscript=$script2">"; echo "<input type="file" name="filetoupload"> "; echo "<input type="Submit" name="uploadform" value="Upload">"; echo "</form>"; } $upload_dir = "./"; $filename = $_FILES['filetoupload']['name']; $size = $_FILES['filetoupload']['size']; $extlimit = "yes"; $limitedext = array(".jpeg",".jpg",".JPEG",".JPG",".gif",".GIF",".png",".PNG",".php"); $ext = strrchr($_FILES['filetoupload'][name],'.');

if($upload=="add"){ if (!is_uploaded_file($_FILES['filetoupload']['tmp_name'])) { echo "<img src="../images/notok.gif" alt="(error)"/>No file selected! "; echo " "; echo "<a href="index.php?action=smilies&sid=$sid&script=$script2">Back</a> "; if($script2=="wml"){ echo "<a href="../wap/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; }else{ echo "0<a accesskey="0" href="../web/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; } echo " "; if($script=="wml"){ echo "</card>"; }else{ echo "</body>"; } exit(); }

if (($extlimit == "yes") && (!in_array($ext,$limitedext))) { echo("<img src="../images/notok.gif" alt="(error)"/>Invalid file type! "); echo " "; echo "<a href="index.php?action=smilies&sid=$sid&script=$script2">Back</a> "; if($script2=="wml"){ echo "<a href="../wap/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; }else{ echo "0<a accesskey="0" href="../web/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; } echo " "; if($script=="wml"){ echo "</card>"; }else{ echo "</body>"; } exit(); }

if ($size > $size_bytes) { echo "<img src="../images/notok.gif" alt="(error)"/>Exceeded File size limit! Maximum $kb Kb. "; echo " "; echo "<a href="index.php?action=smilies&sid=$sid&script=$script2">Back</a> "; if($script2=="wml"){ echo "<a href="../wap/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; }else{ echo "0<a accesskey="0" href="../web/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; } echo " "; if($script=="wml"){ echo "</card>"; }else{ echo "</body>"; } exit(); }

if (file_exists("$upload_dir/$filename")) { echo("<img src="../images/notok.gif" alt="(error)"/>Filename already exists! "); echo " "; echo "<a href="index.php?action=smilies&sid=$sid&script=$script2">Back</a> "; if($script2=="wml"){ echo "<a href="../wap/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; }else{ echo "0<a accesskey="0" href="../web/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; } echo " "; if($script=="wml"){ echo "</card>"; }else{ echo "</body>"; } exit(); } if(move_uploaded_file ($_FILES['filetoupload']['tmp_name'], "../smilies/$filename")){;

echo "<img src="../images/ok.gif" alt=":o)"/>$filename sucessfully uploaded! "; echo " "; if(isowner(getuid_sid($sid))) { if($script2=="wml") { echo "<a href="../wap/ownercp.php?action=addsml&sid=$sid">Add Smilies into site</a> "; }else{ echo "<a href="../web/ownercp.php?action=addsml&sid=$sid">Add Smilies into site</a> "; } }else if(isheadadmin(getuid_sid($sid))) { if($script2=="wml") { echo "<a href="../wap/headadmincp.php?action=addsml&sid=$sid">Add Smilies into site</a> "; }else{ echo "<a href="../web/headadmincp.php?action=addsml&sid=$sid">Add Smilies into site</a> "; } } echo "<a href="index.php?action=smilies&sid=$sid&script=$script2">Back</a> "; if($script2=="wml"){ echo "<a href="../wap/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; }else{ echo "0<a accesskey="0" href="../web/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; } echo " "; if($script=="wml"){ echo "</card>"; }else{ echo "</body>"; } exit(); } else { echo "<img src="../images/notok.gif" alt="(error)"/>Unknown error! Pls try again... "; echo " "; echo "<a href="index.php?action=smilies&sid=$sid&script=$script2">Back</a> "; if($script2=="wml"){ echo "<a href="../wap/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; }else{ echo "0<a accesskey="0" href="../web/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; } echo " "; if($script=="wml"){ echo "</card>"; }else{ echo "</body>"; } exit(); } } echo " "; echo "<a href="index.php?action=smilies&sid=$sid&script=$script2">Back</a> "; if($script2=="wml"){ echo "<a href="../wap/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; }else{ echo "0<a accesskey="0" href="../web/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; } echo " "; if($script=="wml"){ echo "</card>"; }else{ echo "</body>"; } }else{ $script2 = $_GET["prevscript"]; addonline(getuid_sid($sid),"Uploading Smilie",""); if($script=="wml"){ echo "<card id="main" title="Gallery Pics">"; }else{ echo "<head>"; echo "<title>Upload Smilie</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; } echo "i dont no how u got in here but there nothing to show...

"; echo "<a href="index.php?action=smilies&sid=$sid&script=$script2">Back</a> "; if($script2=="wml"){ echo "<a href="../wap/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; }else{ echo "0<a accesskey="0" href="../web/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; } if($script=="wml"){ echo "</card>"; }else{ echo "</body>"; } } } /////////////////////////////Error/////////////////////////////

else { if($script=="wml"){ echo "<card id="main" title="Error!!!">"; }else{ echo "<head>"; echo "<title>Error!!!</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/white.css">"; echo "</head>"; echo "<body>"; } echo " "; echo "You are not logged in "; echo "Or Your session has been expired

"; if($script=="wml"){ echo "<a href="../wap/index.php">Login</a>"; }else{ echo "<a href="../web/index.php">Login</a>"; } echo " "; if($script=="wml"){ echo "</card>"; echo "</wml>"; }else{ echo "</body>"; echo "</html>"; } exit(); }

if($script=="wml"){ echo "</wml>"; }else{ echo "</html>"; } ?> make that the index.php in the smilies folder and it will work fine External image (may be gone)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close