topical media & game development

talk show tell print

game-php-score-vu-submitscore.php / php



  <?
  server = mysql_connect("localhost",  "USER", "PASS"); 
      mysql_select_db("DB", server);    
  //  session_start(); 
  //define('nextGenGaming', true ); 
  time=timee=time();
  datum = date("d-m-Y H:i");
  
                  realIP= _SERVER['REMOTE_ADDR'];
                  
          game=addslashes(_REQUEST['game']); 
                   score=addslashes(_REQUEST['score']); 
                   name=addslashes(strip_tags(_REQUEST['name'])); 
                   level=addslashes(_REQUEST['level']); 
                   
          secretKey="mySec45retKey"; # Change this value to match the value stored in the client javascript below  
          real_hash = md5(game.name.score.secretKey.level); 
          //score=number_format(score, 2, '.', '');
          score=str_replace(",", ".", score);
                  if(real_hash == hash && strlen(name)>=1) { 
              // Send variables for the MySQL database class. 
              debug="[score]";
              resultaaat = mysql_query( "SELECT ID FROM highscores WHERE game='game', name='name' && score='score' LIMIT 1");    
                          aantal = mysql_num_rows(resultaaat); 
                          if(aantal!=1){
                                  sql = "INSERT INTO highscores (time, name, score, IP, game, debug, level)
                                  VALUES ('timee', 'name', 'score', 'realIP', 'game', 'debug', 'level')";     
                                  mysql_query(sql) or die("error report INSERT 2");
                          }                        
          }
          
          
          
  ?>


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.