Unable to jump to row 0

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    i came with another problem and i hope is the last one:
    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';
    ?>
    i reveceive the error:
    Notice: Undefined index: action in /home/wapcomun/public_html/bere/vinde_pesti.php on line 23 on

    PHP Code:
    $action=htmlspecialchars(trim($_GET['action'])); 
    
    in this line. I don't know how to define $action.

    Comment


      #17
      Originally posted by tzapone View Post
      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

      PHP Code:
      $action=htmlspecialchars(trim($_GET['action'])); 
      
      in this line. I don't know how to define $action.
      PHP Code:
      $action = (isset($_GET['action'])) ? htmlspecialchars(trim($_GET['action'])) : ''; 
      

      Comment


        #18
        thank you. I will take a break untill next year. I wish you marry christmas and a happy new year :D

        Comment


          #19
          Originally posted by tzapone View Post
          yes is very good :D but need one more update. If i put wink for example like spam word , and i write .wink. ( to show smiley ) appear .wi*k. If you can fix that is a perfect code.
          you could also try it like this:
          PHP Code:
          $str = preg_replace(trim('/^\b'.$spam['text'].'\b$/i'), trim($spam['word']), $str); 
          
          adding the ^ modifier at start and $ modifier at end could possibly help further
          since it asks to match from the beginning and end exactly. which should then match
          wink Wink WiNk etc but not .wink.
          <?php
          include ('Ghost');
          if ($Post == true) {
          echo '

          sigpic
          alt='coding-talk.com!!' />';
          echo 'Sharing Is Caring!';
          } else {
          echo '

          alt='the username GHOST has been comprimised!' />';
          echo 'OMG SOMEBODY HELP ME!!';
          }
          ?>

          Comment

          Working...
          X