Codice PHP:
include("../web/core.php");
include("../web/config.php");
connectdb();
$uip = getip();
$action = $_GET["action"];
$sid = $_GET["sid"];
$page = $_GET["page"];
$who = $_GET["who"];
$uid = getuid_sid($sid);
$sid = $_GET["sid"];
$site = $_GET["site"];
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
$sitename = $sitename[0];
if(($action != "") && ($action!="terms"))
{
$uid = getuid_sid($sid);
if((islogged($sid)==false)||($uid==0))
{
echo '<card id="main" title="wapaa.lv">';
echo '<p align="center">';
echo 'You are not logged in
';
echo 'Or your session has been expired
';
echo '[url="index.php"]Home[/url]';
echo '</p>';
echo '</card>';
echo '</wml>';
exit();
}
}
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html"/>
<meta http-equiv="Cache-Control" content="no-cache" forua="true"/>';
echo "<title>$sitename Upload Files</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" vlink=\"#800080\">";
if ($upload="upload"&&$superdat_name){
if (!eregi("\.(mid|gif|bmp|mid|midi|3gp|mp3|wav|jar|jad|jpeg|jpg|sis|mmf|amr|png|wbmp)$",$superdat_name)){
print "[b]Unsupported File Extention![/b]";
}else{
$superdat_name = preg_replace(
'/[^a-zA-Z0-9\.\$\%\'\`\-\@\{\}\~\!\#\(\)\&\_\^]/'
,'',str_replace(array(' ','%20',"'"),array('_','_', ""),$superdat_name));
if(strlen($superdat_name)>53){ print "[b]Nome del file è troppo lungo![/b]";
}else{
if (empty($superdat)) {
print "[b]Nessun file specificato!!![/b]";
}else{
copy("$superdat", "files/$superdat_name") or
die("Couldn't copy file.");
$ok = array("image/png","image/bmp","image/jpeg", "image/jpg", "image/gif");
if(!in_array($_FILES["file"]["type"], $ok))
exit("Estensione file non consentita!");
$date=(date("D, j F Y"));
$fsize=round($superdat_size/1024,1);
$text = "&&$superdat_name&&$fsize KB&&$date&&$REMOTE_ADDR&&";
$fz = "$fsize KB";
if("$text"!="$check[1]"){
$mysql=mysql_query("INSERT INTO ibwf_uploads SET id='', uid='".$uid."', filename='".$superdat_name."', filesize='".$fsize." KB', date='".$date."', uip='".$REMOTE_ADDR."'");
echo mysql_error();
}
echo "[b]$superdat_name[/b] il tuo file è stato caricato con successo";
}
}
}
}
?>
<?php
echo "<FORM align=\"center\" ACTION=\"upload.php?sid=$sid&site=$site\" METHOD=\"POST\" ENCTYPE=\"multipart/form-data\">";
?>
[b]Seleziona file da caricare :[/b]
<input align="center" type="file" name="superdat">
<input align="center" type="hidden" name="upload" value="upload"/>
<INPUT align="center" TYPE=SUBMIT NAME="submit" VALUE="Upload File!">
</small>
[b]<u>I file da caricare devono avere questi formati:</u>[/b]
.jpg, .jpeg, .gif, .png, .bmp, wbmp, .mid, .midi, .mpg, .mmf, .amr, .mp3, .wav, .wmv , .avi, .3gp, .sis, .jar, .jad, .zip, .rar, .txt
Nota es.: L'Indirizzo della tua Foto/Immagine sarà [url]http://universal3000.altervista.org/chat_universal2/uploaded/files/Animation6.gif[/url]
----------
<?php echo "
[size="1"]<a href=\"index.php?sid=$sid&site=$site\">Files Caricati</a>[/size]"; ?>
</FORM>
<?php
if($site=="wap"){
echo "
<a href=\"../wap/index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
}else{
echo "
<a href=\"../web/index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
}
?>
</body>
</html>
..e vorrei mettere CSS interno, ma non so come fare?