File size: 3.8Kb
<?
header("Cache-Control: no-cache");
header("Content-type:text/vnd.wap.wml");
$ref=rand(10000,1000000);
require("inc.php");
$link = @mysql_pconnect ($MySQL_Hostname, $MySQL_Username, $MySQL_Password)
or die ("<wml>
<card id=\"error\" title=\"error\">
<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\">Can not connect to MySQL<br/>".mysql_error()."</p>
</card>
</wml>");
@mysql_select_db($MySQLDatabasename) or die ("<wml>
<card id=\"error\" title=\"error\">
<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\">error select the database...<br/>".mysql_error()."</p>
</card>
</wml>");
$result = @mysql_query ("Select pass,user,fsize from users where id='".$id."'");
if (mysql_affected_rows() == 0) {
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card id=\"error\" title=\"Ошибка\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>\n";
echo "<p align=\"center\">\n";
echo "User was not found\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close($link);
exit;
}
$row = mysql_fetch_array ($result);
if ($ps !== $row["pass"]){
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card id=\"error\" title=\"Ошибка\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>\n";
echo "<p align=\"center\">\n";
echo "Your login failed\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close($link);
exit;
}
if($row['fsize'] == "small") { $fsize1 = "<small>"; $fsize2 = "</small>"; }
elseif($row['fsize'] == "big") { $fsize1 = "<big>"; $fsize2 = "</big>"; }
else { $fsize1 = ""; $fsize2 = ""; }
$user = $row["user"];
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>";
echo "<card id=\"cabinet\" title=\"Импорт фото\">";
echo "<p>";
$foto=$id.".gif";
if (isset($file)){
$par = GetImageSize("http://$file");
if(($par[2]!==2)&&($par[2]!==1)) {$msg="<b>Нe верный формат изображения, либо вы указали не верный адрес картинки!</b><br/>---<br/>";}
if(($par[0]>174)||($par[1]>174)) {$msg="<b>Размер изображения не больше 174x174!</b><br/>---<br/>";}
if(!$msg){
if (file_exists("photos/$foto")){unlink ("photos/$foto");}
copy("http://$file", "photos/$foto");
@mysql_query ("Update users set img='".$foto."' where id ='".$id."'");}
}
$r3 = mysql_query ("select img, user from users where id = '".$id."'");
$row = mysql_fetch_array($r3);
echo $fsize1;
echo "$msg";
echo "Фото для <b>".$user."</b><br/>";
echo $divide;
echo $fsize2;
if($row["img"]!=""){echo "<img src=\"fr.php?id=$id\" alt=\"".$user."\"/><br/>\n";}
echo $fsize1;
echo "Aдрес Фотo в сети:<br/>";
echo "http://";
echo $fsize2;
echo "<input name=\"file\" title=\"file\" maxlength=\"200\"/><br/>";
echo $fsize1;
echo "<anchor title=\"go\">Установить<go href=\"fotoimp.php?id=$id&ps=$ps&ref=$ref\" method=\"post\">";
echo "<postfield name=\"file\" value=\"$(file)\"/>";
echo "</go></anchor>";
echo $fsize2;
echo "<br/>";
echo $fsize1;
echo $divide;
if (isset ($rm))echo "<a href=\"chat.php?id=$id&ps=$ps&rm=$rm\">В чат</a><br/>\n";
echo "<a href=\"cabinet.php?id=$id&ps=$ps&ref=$ref\">Личный кабинет</a><br/>";
echo "<a href=\"enter.php?id=$id&ps=$ps\">Прихожая</a><br/>\n";
echo $fsize2;
echo "</p></card></wml>";
mysql_close($link);
?>