В общем дело в том, что в БД есть таблица "users", в ней поле "obraz" и у юзера ссылка на картинку /mg/maleobraz.gif В профиле эта самая картинка должна загружаться, но не пойму почему этого не происходит всеравно - пусто
Вот код
Цитата |
<? print "<img src='/img/$obraz' width=90 height=210 border=0 alt=\"$who\">"; ?> |
Цитата |
<? print "<img src='/img/maleobraz.gif' width=90 height=210 border=0 alt=\"$who\">"; ?> |
Цитата |
<img src='/img/$obraz' |
Цитата |
/*============ПОКАЗАТЬ Пользователя===========================*/ function showPlayer($who){ $result = mysql_query("SELECT * FROM users WHERE login='$who'"); $db = mysql_fetch_array($result); $amulet=$db["amulet"]; $clips=$db["clips"]; $braslets=$db["braslets"]; $hand_r=$db["hand_r"]; $hand_r_type=$db["hand_r_type"]; $hand_l=$db["hand_l"]; $hand_l_type=$db["hand_l_type"]; $armour=$db["armour"]; $poyas=$db["poyas"]; $obraz=$db["obraz"]; $ring1=$db["ring1"]; $ring2=$db["ring2"]; $ring3=$db["ring3"]; $rune1=$db["rune1"]; $rune2=$db["rune2"]; $rune3=$db["rune3"]; $rune4=$db["rune4"]; $helmet=$db["helmet"]; $perchi=$db["perchi"]; $boots=$db["boots"]; $level=$db["level"]; $hp[0]=$db["hp"]; $hp[1]=$db["hp_all"]; $mana[0]=$db["mana"]; $mana[1]=$db["mana_all"]; $sila=$db["sila"]; $lovkost=$db["lovkost"]; $udacha=$db["udacha"]; $power=$db["power"]; $vospriyatie=$db["vospriyatie"]; $intellekt=$db["intellekt"]; $acsess1=$db["acsess1"]; $acsess2=$db["acsess2"]; $animal=$db["animal"]; include "player_b.php"; print "Сила: $sila<BR>"; print "Реакция: $lovkost<BR>"; print "Удача: $udacha<BR>"; print "Выносливость: $power<BR>"; if($level>0){ print "Восприятие: $vospriyatie<BR>"; } if($intellekt>0){ print "Интеллект: $intellekt<BR>"; } } /*======================================================*/ /*============ПОКАЗАТЬ ИГРОКА INF===========================*/ function showPlayer_inf($who){ $result = mysql_query("SELECT * FROM users WHERE login='$who'"); $db = mysql_fetch_array($result); $amulet=$db["amulet"]; $clips=$db["clips"]; $braslets=$db["braslets"]; $hand_r=$db["hand_r"]; $hand_r_type=$db["hand_r_type"]; $hand_l=$db["hand_l"]; $hand_l_type=$db["hand_l_type"]; $armour=$db["armour"]; $poyas=$db["poyas"]; $obraz=$db["obraz"]; $ring1=$db["ring1"]; $ring2=$db["ring2"]; $ring3=$db["ring3"]; $rune1=$db["rune1"]; $rune2=$db["rune2"]; $rune3=$db["rune3"]; $rune4=$db["rune4"]; $helmet=$db["helmet"]; $perchi=$db["perchi"]; $shield=$db["shield"]; $boots=$db["boots"]; $level=$db["level"]; $hp[0]=$db["hp"]; $hp[1]=$db["hp_all"]; $mana[0]=$db["mana"]; $mana[1]=$db["mana_all"]; $sila=$db["sila"]; $lovkost=$db["lovkost"]; $udacha=$db["udacha"]; $power=$db["power"]; $vospriyatie=$db["vospriyatie"]; $intellekt=$db["intellekt"]; $city=$db["city"]; $city_game=$db["city_game"]; $acsess1=$db["acsess1"]; $acsess2=$db["acsess2"]; $animal=$db["animal"]; $online = 0; $SEARCH = mysql_query("SELECT * FROM online WHERE login = '$who'"); if(mysql_fetch_array($SEARCH)){$online = 1;} $block=$db["blok"]; include "player_b.php"; ?> <style> .small {font-size: 9pt; color: #000000} </style> <? print "<span class='small'><center>Город: <B>$city</B></center>"; if($online==1){ print "<span class='small'>Персонаж сейчас <B>Онлайн</B><BR>"; $room=$db["room"]; print "<center><B>$room</B></center></span><BR>"; } else{ print "<span class=small>Персонаж сейчас <B>Оффлайн</B></span><BR>"; } if($db["battle"]!=0){ $id=$db["battle"]; print "<span class='small'>Персонаж в <a class=us2 href='log.php?log=$id' target=_new2>поединке</a></span><BR>"; } } /*======================================================*/ |
Цитата |
<? print "<img src='/img/$obraz' width=90 height=210 border=0 alt=\"$who\">"; ?> |
Цитата |
<? print "<img src='/img/maleobraz.gif' width=90 height=210 border=0 alt=\"$who\">"; ?> |
Цитата |
<? print "<img src='img/$obraz' width=90 height=210 border=0 alt=\"$who\">"; echo "echo '<img src="img/'.$obraz.'" />'; ?> |
Цитата |
<td align=right> <input align=center class=but type=button value=Форум onclick="top.main.location.href='forum/index.php'" style="width=30" align=center> <input class=but type=button value=Новости onclick=new_win("news") style="width=75"> <input class=but type=button value=выход onClick=exit(); style="width=75"> </td> |
<td style="text-align: center">
<input align=center class=but type=button value=Форум
onclick="top.main.location.href='forum/index.php'" style="width=30" align=center>
<input class=but type=button value=Новости onclick=new_win("news") style="width=75">
<input class=but type=button value=выход onClick=exit(); style="width=75">
</td>
Цитата |
<? session_start(); ?> <link REV="made" href="mailto:smallrat@ukr.net"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> <meta http-equiv="Content-Language" content="ru"> <LINK REL=StyleSheet HREF='style.css' TYPE='text/css'> <? include "connectiontodatabase.php"; include "functions.php"; $data = mysql_connect($base_name, $base_user, $base_pass); mysql_select_db($db_name,$data); $sql = "SELECT * FROM users WHERE login='".$_SESSION["login"]."'"; $result = mysql_query($sql); $db = mysql_fetch_array($result); $orden = $db["orden"]; $clan = $db["clan"]; $login = $db["login"]; ?> <script> function rel(){ top.location.reload(); } function personal(){ window.open('anket.php'); top.menu.location.href='menu.php?act=none'; } function new_win(name){ if(name == 'forum'){ window.open('forum','forum'); } if(name == 'news'){ window.open('news/','news'); } } function perevod(){ window.open('perevod.php'); top.menu.location.href='menu.php?act=none'; } function url(url){ top.main.location.href = "main.php?act="+url; } function url3(url){ top.main.location.href = "main.php?act=go&level="+url; } function url2(url){ top.main.location.href = url; } function exit(){ if(confirm("Вы уверены что хотите выйти из игры?")){top.location.href='index.php';} } function goBack(){ top.main.history.back(-1); } </script> <script language="JavaScript1.2"> function high(which2){ theobject=which2 highlighting=setInterval("highlightit(theobject)",50) } function low(which2){ clearInterval(highlighting) if (which2.style.MozOpacity) which2.style.MozOpacity=0.3 else if (which2.filters) which2.filters.alpha.opacity=70 } function highlightit(cur2){ if (cur2.style.MozOpacity<1) cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1 else if (cur2.filters&&cur2.filters.alpha.opacity<100) cur2.filters.alpha.opacity+=10 else if (window.highlighting) clearInterval(highlighting) } </script> <body background="chat/panel.jpg" width=100% height=100% background-repeat: no-repeat > <table width=100% height=0 cellspacing=0 cellpadding=0><td id="room" valign="bottom" align="center"></td></table> <table cellspacing=0 border=0 cellpadding=1 width=100% > <tr> <td width=100%> <font color=black size=4 face=serif><b><? echo $db["city"];?> </td> <td style="text-align: center"> <input align=center class=but type=button value=Форум onclick="top.main.location.href='forum/index.php'" style="width=30" align=center> <input class=but type=button value=Новости onclick=new_win("news") style="width=75"> <input class=but type=button value=выход onClick=exit(); style="width=75"> </td> </tr> <tr> <td><font color=black><b><? echo $db["room"];?> </td> <td align=left nowrap> <input class=but type=button value=друзья onclick="top.main.location.href='friends.php'" style="width=75"> <input class=but type=button value=настройки onclick="top.main.location.href='anket.php'" style="width=75"> <input class=but type=button value=инвентарь onClick=url("inv"); style="width=75"> <input class=but type=button value=персонаж onClick=url("char"); style="width=75"> <input class=but type=button size=100 value=город onClick=url("none"); style="width=75"> </td> </tr> </table> </body> |
Цитата |
ALTER TABLE `Название таблицы в которой нужно удалить поле` DELETE `название поля` varchar(30) default NULL |
Цитата |
ALTER TABLE `Название таблицы в которой нужно удалить поле` DELETE `название поля` varchar(30) default NULL |
Цитата |
$mail = $db["mail"]; $moshnost_add=$db["moshnost_add"]; $sila_add=$db["sila_add"]; $lovkost_add=$db["lovkost_add"]; $sila_all=$sila+$sila_add; $lovkost_all=$lovkost+$lovkost_add; $moshnost_all=$moshnost+$moshnost_add; $def_race["def_race"]; if(empty($state)){$state = "нет";} } if ($sila_add != 0){ if ($sila_add > 0) {$sila_add ="+<font color=green>$sila_add</font>";} else {$sila_add ="<font color=red>$sila_add</font>";} $sila_print = "($sila$sila_add)"; } if ($lovkost_add != 0) { if ($lovkost_add > 0) {$lovkost_add ="+<font color=green>$lovkost_add</font>";} else {$lovkost_add ="<font color=red>$lovkost_add</font>";} $lovkost_print = "($lovkost$lovkost_add)"; } if ($moshnost_add != 0) { if ($moshnost_add > 0) {$moshnost_add ="+<font color=green>$moshnost_add</font>";} else {$moshnost_add ="<font color=red>$moshnost_add</font>";} $moshnost_print = "($moshnost$moshnost_add)"; } ?> <title>Информация о персонаже <?echo $name?></title> <div align="center"> <table border="0" width="700"> <tr> <td> <p align="center"><? showHP($log); ?></td> </tr> <tr> <td valign="top"> <table border="0" width="100%"> <tr> <td valign="top"> <table border="0" width="100%"> <tr> <td bgcolor="#cd2f2f" width="245"><b><font color="#ffffff">Характеристика:</font></b></td> </tr> <tr> <td> Сила: <?echo "$sila_all $sila_print";?><BR> Ловкость: <?echo "$lovkost_all $lovkost_print";?><BR> Мощность: <?echo "$moshnost_all $moshnost_print";?><BR> Выносливость: <?echo $vinoslivost;?><BR><?if($level>=1){?> (Разработка): <?echo $intellekt;?><BR> (Разработка): <?echo $vospriyatie;?><BR><BR><?}?> </td> |
Цитата |
include "functions.php"; |
Цитата |
/*============ПОКАЗАТЬ ИГРОКА===========================*/ function showPlayer($who){ $result = mysql_query("SELECT * FROM users WHERE login='$who'"); $db = mysql_fetch_array($result); $amulet=$db["amulet"]; $clips=$db["clips"]; $braslets=$db["braslets"]; $hand_r=$db["hand_r"]; $hand_r_type=$db["hand_r_type"]; $hand_l=$db["hand_l"]; $hand_l_type=$db["hand_l_type"]; $armour=$db["armour"]; $poyas=$db["poyas"]; $obraz=$db["obraz"]; $def_race=$db["def_race"]; $ring1=$db["ring1"]; $ring2=$db["ring2"]; $ring3=$db["ring3"]; $rune1=$db["rune1"]; $rune2=$db["rune2"]; $rune3=$db["rune3"]; $rune4=$db["rune4"]; $helmet=$db["helmet"]; $perchi=$db["perchi"]; $boots=$db["boots"]; $level=$db["level"]; $hp[0]=$db["hp"]; $hp[1]=$db["hp_all"]; $mana[0]=$db["mana"]; $mana[1]=$db["mana_all"]; $sila=$db["sila"]; $lovkost=$db["lovkost"]; $moshnost=$db["moshnost"]; $power=$db["power"]; $vospriyatie=$db["vospriyatie"]; $intellekt=$db["intellekt"]; $acsess1=$db["acsess1"]; $acsess2=$db["acsess2"]; $animal=$db["animal"]; include "player_b.php"; print "Сила: $sila<BR>"; print "Реакция: $lovkost<BR>"; print "Мощность: $moshnost<BR>"; print "Выносливость: $power<BR>"; if($level>0){ print "Восприятие: $vospriyatie<BR>"; } if($intellekt>0){ print "Интеллект: $intellekt<BR>"; } } /*======================================================*/ /*============ПОКАЗАТЬ ИГРОКА INF===========================*/ function showPlayer_inf($who){ $result = mysql_query("SELECT * FROM users WHERE login='$who'"); $db = mysql_fetch_array($result); $amulet=$db["amulet"]; $clips=$db["clips"]; $braslets=$db["braslets"]; $hand_r=$db["hand_r"]; $hand_r_type=$db["hand_r_type"]; $hand_l=$db["hand_l"]; $hand_l_type=$db["hand_l_type"]; $armour=$db["armour"]; $poyas=$db["poyas"]; $obraz=$db["obraz"]; $def_race=$db["def_race"]; $ring1=$db["ring1"]; $ring2=$db["ring2"]; $ring3=$db["ring3"]; $rune1=$db["rune1"]; $rune2=$db["rune2"]; $rune3=$db["rune3"]; $rune4=$db["rune4"]; $helmet=$db["helmet"]; $perchi=$db["perchi"]; $shield=$db["shield"]; $boots=$db["boots"]; $level=$db["level"]; $hp[0]=$db["hp"]; $hp[1]=$db["hp_all"]; $mana[0]=$db["mana"]; $mana[1]=$db["mana_all"]; $sila=$db["sila"]; $lovkost=$db["lovkost"]; $moshnost=$db["moshnost"]; $power=$db["power"]; $vospriyatie=$db["vospriyatie"]; $intellekt=$db["intellekt"]; $city=$db["city"]; $city_game=$db["city_game"]; $acsess1=$db["acsess1"]; $acsess2=$db["acsess2"]; $animal=$db["animal"]; $online = 0; $SEARCH = mysql_query("SELECT * FROM online WHERE login = '$who'"); if(mysql_fetch_array($SEARCH)){$online = 1;} $block=$db["blok"]; include "player_b.php"; ?> <style> .small {font-size: 9pt; color: #000000} </style> <? print "<span class='small'><center>Город: <B>$city</B></center>"; if($online==1){ print "<span class='small'>Персонаж сейчас <B>Онлайн</B><BR>"; $room=$db["room"]; print "<center><B>$room</B></center></span><BR>"; } else{ print "<span class=small>Персонаж сейчас <B>Оффлайн</B></span><BR>"; } if($db["battle"]!=0){ $id=$db["battle"]; print "<span class='small'>Персонаж в <a class=us2 href='log.php?log=$id' target=_new2>поединке</a></span><BR>"; } } /*======================================================*/ |
Цитата |
<? if(empty($login)){ print "<script>top.location.href='index.php';</script>"; } $city=$db["city_game"]; if($city != "mountown"){ print "<script>location.href='index.php'</script>"; die(); } if(!empty($buy)){ $s="select * from $buy where id=$item"; $q=mysql_query($s); $r=mysql_fetch_array($q); $i_max=$r["iznos_max"]; $price_gos = $r["price"]; $price1 = $price_gos; $price = sprintf ("%01.2f", $price1); if($db["money"]>=$price){ $sql="INSERT INTO inv(owner,object_id,object_type,object_razdel,wear,iznos,iznos_max) VALUES ('$login','$item','$buy','obj','0','0','$i_max')"; $res=mysql_query($sql); if(!$res){echo mysql_error();} $n_money=$db["money"]-$price; $s2=mysql_query("UPDATE users SET money='$n_money' WHERE login='$login'"); if($db["trade"]<90){ $trade=mysql_query("UPDATE `users` SET trade=trade+0.01 WHERE login='$login'"); echo mysql_error(); } $name=$r["name"]; say($login,"Вы удачно купили «$name» за $price костяных монет.",$login); if(empty($ip)) { if (getenv('HTTP_X_FORWARDED_FOR')) { $ip=getenv('HTTP_X_FORWARDED_FOR'); } else { $ip=getenv('REMOTE_ADDR'); } } $name2="$name ($price зл)"; history($login,'купил',$name2,$ip,'Оружейная костей'); $SQL_NUM="UPDATE $buy SET mountown=mountown-1 WHERE id=$item"; $Q=mysql_query($SQL_NUM); } else{ print "Go fuck, cheater!!!"; die(); } } ?> <table cellpadding="0" cellspacing="0" width="100%" height=100%> <tr> <td width=210 align=center bgcolor=DDDDDD class=us2 valign="top" style="border-top: 1px solid #999999; border-right: 1px solid #999999; border-bottom: 1px solid #999999; border-left: 1px solid #999999;"> <? $money1=$db["money"]; $money = sprintf ("%01.2f", $money1); ?><br /><br /><br /><br /> <img src="img/city/smith.gif" alt="Кузница Костей" /> <form name="move" action="main.php?act=go" method="POST"> <input name="level" type="hidden" value="remesl" /> <input type=submit class=but value=" Выйти из оружейной " style="height=18;font-size:11 px"> </form> <b>У вас с собой</b>:<br /> <B><?echo $money;?></B> км.<br /> </td> <td align="center" valign="top" > <br /> <style> .name{ color: #660000; font-size: 10pt; font-weight: bold } </style> <br /><table width="95%" cellspacing="0" border="0" cellpadding="2" height=20> <td align=center width=100% bgcolor=cccccc class=us2 valign=middle style="border-top: 1px solid #999999; border-right: 1px solid #999999; border-bottom: 1px solid #999999; border-left: 1px solid #999999;"> <font class=name>Оружейная костей</font></td></table><br /> <center>     <a class=us2 href='?otdel=sword'>Мечи</a>     <a class=us2 href='?otdel=axe'>Топоры</a>     <a class=us2 href='?otdel=fail'>Дробящее оружие</a>     <a class=us2 href='?otdel=spear'>Древковое оружие</a>     <a class=us2 href='?otdel=knife'>Разработка</a> <br /><br /> <table width="95%" cellspacing="0" border="0" cellpadding="0" > <? if($buy!=""){$otdel=$buy;} if(empty($otdel)){$otdel='sword';} if(empty($act)){$act="";} show_shop_otdel($login,$otdel,roz); ?> <tr><td colspan=5 style="border-top: 1px solid #999999; border-right: 1px solid #999999; border-bottom: 1px solid #999999; border-left: 1px solid #999999;" bgcolor="<?echo $bgcolor;?>"><p align="center"> </p></td></tr> </tr></table> <br /> </td> </tr> </table> |
Цитата |
say($login,"Вы удачно купили «$name» за $price костяных монет.",$login); if(empty($ip)) |
say($var,$var,$var);Это у нас что?