Просмотр файла top/prof.php

Размер файла: 2.65Kb
<?php
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
print '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"'.
' "http://www.wapforum.org/DTD/wml_1.1.xml">'.
'<wml><head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>';

require ("db.php");

function autorize() {
	global $link, $id, $pass;
	
	$q = @mysql_query("select * from `top` where id='$id' and pass='$pass' limit 1;");
	
	$duser = @mysql_fetch_array($q);
	
	return $duser;

}

$link = autorize();

print '<card title="&#1055;&#1088;&#1086;&#1092;&#1080;&#1083;&#1100;">'.
'<p align="left">';

if(empty($id))
print "<small>&#1053;&#1077; &#1074;&#1074;&#1077;&#1076;&#1077;&#1085; ID!</small><br/>";
if(empty($pass))
print "<small>&#1053;&#1077; &#1074;&#1074;&#1077;&#1076;&#1077;&#1085; &#1055;&#1072;&#1088;&#1086;&#1083;&#1100;!</small><br/>";
if($link) {
if($action==go) {
print '<small>&#1085;&#1072;&#1079;&#1074;&#1072;&#1085;&#1080;&#1077;:</small><br/>'.
'<input type="text" name="title" value="'.$link['title'].'"/><br/>'.
'<small>URL:</small><br/>'.
'<input type="text" name="link" value="'.$link['link'].'"/><br/>'.
'<small>&#1055;&#1072;&#1088;&#1086;&#1083;&#1100;:</small><br/>'.
'<input type="password" name="newpass" value="'.$link['pass'].'"/><br/>'.
'<small>&#1054;&#1087;&#1080;&#1089;&#1072;&#1085;&#1080;&#1077;:</small><br/>'.
'<input type="text" name="opis" value="'.$link['opis'].'"/><br/>'.

'<small><anchor>&#1048;&#1079;&#1084;&#1077;&#1085;&#1080;&#1090;&#1100;<go href="prof.php?action=edit&amp;id='.$id.'&amp;pass='.$pass.'" method="post">'.
'<postfield name="action" value="edit"/>'.
'<postfield name="link" value="$(link)"/>'.
'<postfield name="title" value="$(title)"/>'.
'<postfield name="pass" value="$(pass)"/>'.
'<postfield name="opis" value="$(opis)"/></go></anchor></small><br/>';

}
if($action==edit)
{

@mysql_query("update `top` set link='$link', title='$title',pass='$pass',opis='$opis'  where id='$id';");
print "<small>&#1042;&#1072;&#1096; &#1087;&#1088;&#1086;&#1092;&#1080;&#1083;&#1100; &#1080;&#1079;&#1084;&#1077;&#1085;&#1077;&#1085;!</small><br/>";}

print "<small><a href=\"index.php\">&#1042; &#1088;&#1077;&#1081;&#1090;&#1080;&#1085;&#1075;</a></small><br/>";
print "<small><a href=\"../index.php\">amlet.com.ru</a></small><br/>";


print "<small><u><anchor>&#1053;&#1072;&#1079;&#1072;&#1076;<prev/></anchor></u></small><br/>";
} else { print "<small>&#1053;&#1077; &#1074;&#1077;&#1088;&#1085;&#1099;&#1077; &#1076;&#1072;&#1085;&#1085;&#1099;&#1077;!<br/></small>"; }

print '</p>'.
'</card>'.
'</wml>';

@mysql_close();
?>