вкарване на else в кода

cmsfan

Registered
Код:
<?php
define('IN_VALID', true); 
include('conf.php');
$username =  $phpbb_user->data['username'];
mysql_query("SET NAMES UTF8"); 
$id = $_GET['id'];
if (!$_POST['verrify'])
{
$our = mysql_query("SELECT * FROM 468x60ads where username468x60='$username' ");
while($r=mysql_fetch_array($our)){
?>
<form method="POST">
<b>Линк:</b><br /> <input type="text" value="<?PHP echo"$r[link468x60]"; ?>" name="link468x60" style='width:200px;'><br />
<b>URL към банера:</b><br /> <input type="text" value="<?PHP echo"$r[banner468x60]"; ?>" name="banner468x60" style='width:200px;'><br /><br />
<input name="verrify" type="submit" value="Промени!" class="button">
</form>
<?
}
}
else{

$banner468x60 = $_POST['banner468x60'];
$link468x60 = $_POST['link468x60'];
$banner468x60 = htmlspecialchars($banner468x60);
$link468x60 = htmlspecialchars($link468x60);
echo ("<center><b>Успешно променен линк!</b></center>");
echo "<meta http-equiv=\"refresh\" content=\"1; url=editsmsadvs.php\">";
$update = mysql_query("Update 468x60ads set banner468x60 = '$banner468x60' , link468x60 = '$link468x60' where username468x60 = '$username'");
}
?>
Някой може ли да добави едно "else" (някъде) - когато няма намерена информация на съответния username да изписва:
"Вие не сте добавили 486х60 банери"
Благодаря!
 

eddyy93

Registered
PHP:
<?php
define('IN_VALID', true);
include('conf.php');
$username =  $phpbb_user->data['username'];
mysql_query("SET NAMES UTF8");
$id = $_GET['id'];
if (!$_POST['verrify'])
{
$our = mysql_query("SELECT * FROM 468x60ads where username468x60='$username' ");
if(mysql_num_rows($our)>0){
while($r=mysql_fetch_array($our)){
?>
<form method="POST">
<b>Линк:</b><br /> <input type="text" value="<?PHP echo"$r[link468x60]"; ?>" name="link468x60" style='width:200px;'><br />
<b>URL към банера:</b><br /> <input type="text" value="<?PHP echo"$r[banner468x60]"; ?>" name="banner468x60" style='width:200px;'><br /><br />
<input name="verrify" type="submit" value="Промени!" class="button">
</form>
<?
        }

    }
else{echo 'Не сте добавили банер';}
}
else{

$banner468x60 = $_POST['banner468x60'];
$link468x60 = $_POST['link468x60'];
$banner468x60 = htmlspecialchars($banner468x60);
$link468x60 = htmlspecialchars($link468x60);
echo ("<center><b>Успешно променен линк!</b></center>");
echo "<meta http-equiv=\"refresh\" content=\"1; url=editsmsadvs.php\">";
$update = mysql_query("Update 468x60ads set banner468x60 = '$banner468x60' , link468x60 = '$link468x60' where username468x60 = '$username'");
}
?>
 

Горе