i came with another problem and i hope is the last one:
i reveceive the error:
Notice: Undefined index: action in /home/wapcomun/public_html/bere/vinde_pesti.php on line 23 on
in this line. I don't know how to define $action.
PHP Code:
<?php
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
$set['title']='Vanzare pestisori'; // заголовок Ñтраницы
include_once 'sys/inc/thead.php';
title();
err();
aut();
if(isset($user)){
//if($gconf[0]['open']!=1){
$action=htmlspecialchars(trim($_GET['action']));
switch ($action){
default:
echo "<div class='foot'>";
echo '1 pestisor = 20 de puncte<br/>';
echo '</div>';
echo "<div class='foot'>";
echo '<img src="/style/icons/fish.png" alt="+"> Ai prins <b>'.$user['extra_ball'].' pestisori</b><br/>';
echo '</div>';
echo "<div class='foot'>";
echo '<img src="/style/icons/many.gif" alt="+"> Ai in cont: <b>'.$user['balls'].'</b> puncte<br/>';
echo '</div>';
echo "<div class='p_t'>";
echo '<form action="vinde_pesti.php?action=change" method="post">';
echo 'Cati pesti vinzi?<br/>';
echo '<input name="num" type="text" value=""/><br/>';
echo '<input type="submit" value="Vinde"/>';
echo '</form>';
echo '</div>';
break;
case 'change':
$num=(int)$_POST['num'];
if(!$num || $num<1){echo 'Nu ai nici un pestisor!';break;};
if($user['extra_ball']<$num){echo 'Nu ai atati pestisori!';break;};
$baks=$num*20;
mysql_query("UPDATE `user` SET `balls`=`balls`+'$baks',`extra_ball`=`extra_ball`-'$num' WHERE `id`='".$user['id']."'");
echo 'Ai vandut cu succes pestisorul!';
break;
}
;
//}else{echo '<div class="msg">Jocul este oprit de catre administrator!</div>';};
}else{
echo '<div class="msg">Numai utilizatorii autentificati au acces!</div>';
};
echo '<div class="foot"><a href="/umenu.php">Meniul meu</a></div>';
include_once 'sys/inc/tfoot.php';
?>
Notice: Undefined index: action in /home/wapcomun/public_html/bere/vinde_pesti.php on line 23 on
PHP Code:
$action=htmlspecialchars(trim($_GET['action']));
Comment