help me about this error, my upload its not working. pls help me.
this is my upload.php
this is my upload.php
PHP Code:
<?php
echo("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Cache-Control" content="must-revalidate"/>
<title>MyChat</title>
<link rev="made" href="mailto:prodigit@w5c.info" />
<link rev="start" href="./" title="Home Page" />
<link rel="shortcut icon" type="image/x-icon" href="img/ico.gif" />
<meta http-equiv="Cache-Control" content="must-revalidate" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="description" content="description" />
<meta name="keywords" content="Downloads mp3 amr 3gp poly Free South Africa afrikaans chat & forums toplist services wapmasters" />
<style type="text/css">
a:link{color: #CCCC00;}
a:visited{color: #CCCC00;}
a:hover{color: #FFFFFF;background: #FF0000;}
a:active{color: #FFFFFF;background: #FF0000;}
a:focus{color: #FFFFFF;background: #FF0000;}
body
{
color: #ffffff;
border-width:0px 0;
border-style:solid;
border-color: #FFFFFF;
background-image:
url('data/rocky.jpg');
background-color: #000000;
background-repeat:
repeat;
background-position:
center;
background-attachment:
fixed
}
.txtmenus {
background-color: #000033;
padding: 2px 2px 2px 2px;
margin: 3px 0 0;
color: #CCCCCC;
border-width:0px 0;
border-style:solid;
border-color: #FF0000;
}
.foot {
background-color: #990000;
padding: 2px 2px 2px 2px;
margin: 3px 0 0;
color: #ffffff;
border-width:0px 0;
border-style:solid;
border-color: #FF0000;
}
</style>
</head>
<body>
<center>
<img src="data/logo.gif" alt="LOGO" />
</center>
<div class="txtmenu">
<center><b><small>Upload</small></b></center>
</div>
<b>
<small>
<?php
include ("config.php");
include ("count.php");
$brws = explode(" ",$_SERVER[HTTP_USER_AGENT] );
$ubr = $brws[0];
$ip=getenv('REMOTE_ADDR');
$brws2= mysql_fetch_array(mysql_query("SELECT * FROM ipban WHERE browser='".$ubr."' and ip='".$ip."'"));
if ($brws2){
echo '<title>Uploader</title></head>
';
echo "<p align=\"center\">";
echo "<img src=\"http://coding-talk.com/images/exit.gif\" alt=\"*\"/><br/>";
echo "If u see this this means your IP and browser has been banned from uploading<br/>";
echo "</p>";
echo "</body></html>";
exit();
}
echo '<title>Uploader</title></head>
';
if ($upload="upload"&&$superdat_name){
if (!eregi("\.(mid|gif|bmp|mid|midi|3gp|mp3|wav|mpn|nth|mpc|jar|jad|jpeg|jpg|sis|mmf|amr|thm|png|wbmp|rar|zip)$",$superdat_name)){
print "<b>Unsuported File extention!!!</b>";
}else{
$superdat_name = preg_replace(
'/[^a-zA-Z0-9\.\$\%\'\`\-\php\@\{\}\~\!\#\(\)\&\_\^]/'
,'',str_replace(array(' ','%20'),array('_','_'),$superdat_name));
if(strlen($superdat_name)>53){ print "<b>File Name to long!!!</b>";
}else{
if (empty($superdat)) {
print "<b>No input file specified!!!</b>";
}else{
if (file_exists("".$dir."/".$superdat.""))
{
echo "File already exists";
echo "<br /><small><a href=\"upload.php\">Upload xhtml</a><br /></small>";
echo "<br /><small><a href=\"index.php\">Uploads</a><br /></small>";
echo "<small><b>Script by:</b>Tommie©</small><br/>";
print "</p></body></html>";
exit();
}
copy("$superdat", "$dir/$superdat_name") or
die("Couldn't copy file.");
$fsize=round($superdat_size/1024,1);
$brws = explode(" ",$_SERVER[HTTP_USER_AGENT] );
$ubr = $brws[0];
$ip=getenv('REMOTE_ADDR');
$rev = strrev ($superdat_name);
$exp = explode (".", $rev);
$true = strrev ($exp[0]);
$trueext = strtolower ($true);
$adds=mysql_query("INSERT INTO from ibwf_upload SET file='".$superdat_name."',name='".$name."',description='".$desc."',size='".$fsize."',filename='".$fname."',ftype='".$trueext."',dir='".$dir."',browser='".$ubr."',ip='".$ip."'");
if ($adds) {
echo "added<br/>
File: $superdat_name<br/>
File Name: $fname<br/>
Name: $name<br/>
Description: $desc<br/>
File Size: $fsize KB<br/>
File Type:*.$trueext<br/>";
} else {
echo "Please try again<br/>";
}
echo "file has been successfully uploaded";
}
}
}
}
?>
<form align="left" action="upload.php" method="post" ENCTYPE="multipart/form-data">
Name:<br/><input type="text" name="name" size="30" /><br/>
File Name:<br/><input type="text" name="fname" size="30" /><br/>
Description:<br/><textarea name="desc" rows="3" cols="40"></textarea><br/>
File: <br/><input type="file" name="superdat" size="30"/><br/>
Catagory:<br/>
<select name="dir" value="">
<option value="mp3s">mp3s(<?=$c1[0]?>)</option>
<option value="wallpapers">Wallpapers(<?=$c2[0]?>)</option>
<option value="photos">Photos(<?=$c3[0]?>)</option>
<option value="videos">Videos(<?=$c4[0]?>)</option>
<option value="games">Games(<?=$c5[0]?>)</option>
<option value="ringtones">Ringtones(<?=$c6[0]?>)</option>
<option value="applications">Applications(<?=$c9[0]?>)</option>
<option value="scripts">Scripts(<?=$c7[0]?>)</option>
<option value="other">Other(<?=$c8[0]?>)</option>
</select><br/>
<input type="submit" value="Upload!"/>
</form>
</small>
</b>
<center><a href="index.php">BACK FILESHARE</a></center>
<div class="foot">
<center><small>© MyChat 2007-2010</small></center>
</div></body></html>
Comment