Grand National

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

    Grand National

    i built a game based on a horse racing game and built it out of the high low game but i need some 1 to help me with it as the results dont tally correctly for example if i pick horse number 3 and it wins it says i dont and sometimes if i lose it says i win lol if there is a good coder out there who can help that be great thanks...................... p.s i reposted this as some 1 thought they would delete it

    #2
    you have not mentioned which language you used to make this game+seems you like hiding your codes.

    Comment


      #3
      you have not mentioned which language you used to make this game+seems you like hiding your codes.[/b]


      why do i like hiding my codes ............... also its in html its on my site but not working fully

      Comment


        #4
        idk the reason,but you are hinding the code,and thats the main problem to give you a solution.Btw if you php booleans,check it and correct it

        Comment


          #5
          idk the reason,but you are hinding the code,and thats the main problem to give you a solution.Btw if you php booleans,check it and correct it[/b]


          lol im not hiding the code if some 1 will make it work ill put it up 4 ppl to use ................ if i could correct it i would have and i wouldnt be in this post asking for some 1 who knows how to if they would ........ you catching my drift yet

          Comment


            #6
            now post your code to get it fixed

            Comment


              #7
              now post your code to get it fixed[/b]


              ok ill post it now lets see you fix it

              Comment


                #8
                cant find how to upload a file so ill have to copy paste it

                heres the 1st file it comes in two parts name 1 file gn and the other gn2

                <?php
                /*
                * immortalwap
                * created by russell morris april 6th 2008 based on the hilow game
                *
                * do not remove
                *
                */



                include("config.inc.php");


                header("Content-type: text/html; charset=ISO-8859-1");
                echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
                echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
                echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";

                echo "<head>";

                echo "<title>$stitle</title>";
                echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"theme/theme.css\" />";
                echo "</head>";

                echo "<body>";
                echo "<p align=\"center\">";
                ?>
                <?php
                $Connect = mysql_connect("$server","$user","$pass");
                mysql_select_db("$dbname");
                $result=mysql_query("select * from members where username=&#39;$username&#39; and password=&#39;$password&#39;");
                $number_of_rows = mysql_num_rows($result);
                if ($number_of_rows>0)
                {
                include("check.inc.php");
                }
                if ($ok>0)
                {
                include("online.inc.php");

                echo "THE IMMORTALWAP GRANDNATIONAL
                ";
                echo "pick a winner
                ";

                $re1= rand(1, ;
                if ($re1 == 0){
                echo "ARGH! the numbers are the same, whats the point?

                <a href=\"gn.php?username=$username&amp;password=$pas sword\">(Try Again)</a>";}
                else {
                echo "The horses are numbered between 1 and 8
                ";
                echo "[/b]who will win the next race
                ";
                echo "<form action=\"gn2.php?username=$username&amp;password=$ password\" method=\"post\">";
                echo "<select name=\"guess\">";
                echo "<option value=\"1\">Red Rum</option>";
                echo "<option value=\"2\">Choccys Arse</option>";
                echo "<option value=\"3\">Witchys Couldron</option>";
                echo "<option value=\"4\">The Omyom Flyer</option>";
                echo "<option value=\"5\">Shergar</option>";
                echo "<option value=\"6\">Party Politics</option>";
                echo "<option value=\"7\">Dancing Brave</option>";
                echo "<option value=\"8\">Immortal</option>";





                echo "</select>";

                echo "<input type=\"submit\" value=\"bet\"/>";
                echo "</form>";
                echo "
                ";
                echo "<a title=\"Enter\" href=\"welcome.php?username=$username&amp;password =$password\">(Main Menu)</a>";

                }}
                echo "</p>";
                echo "</body>";
                echo "</html>";
                mysql_close();
                ?>


                and here is gn2 file



                <?php
                /*
                * immortalwap
                * created by russell morris april 6th 2008 based on the hilow game
                *
                * do not remove
                *
                */


                include("config.inc.php");


                header("Content-type: text/html; charset=ISO-8859-1");
                echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
                echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
                echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";

                echo "<head>";

                echo "<title>$stitle</title>";
                echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"theme/theme.css\" />";
                echo "</head>";

                echo "<body>";
                echo "<p align=\"center\">";
                ?>
                <?php
                $Connect = mysql_connect("$server","$user","$pass");
                mysql_select_db("$dbname");
                $result=mysql_query("select * from members where username=&#39;$username&#39; and password=&#39;$password&#39;");
                $number_of_rows = mysql_num_rows($result);
                if ($number_of_rows>0)
                {
                include("check.inc.php");
                }
                if ($ok>0)
                {

                $re2 = rand(1, ;
                if ($re1 == $re2){
                echo "ERROR!";}
                else {
                echo "IMMORTALWAP GRANDNATIONAL
                ";
                echo "The WINNER is horse number $re2
                ";
                if ($re1 < $re2){
                $result ="1";}
                if ($re1 > $re2){
                $result ="2";}
                if ($re1 > $re2){
                $result ="3";}
                if ($re1 > $re2){
                $result ="4";}
                if ($re1 > $re2){
                $result ="5";}
                if ($re1 > $re2){
                $result ="6";}
                if ($re1 > $re2){
                $result ="7";}
                if ($re1 > $re2){
                $result ="8";}



                if ($guess == $result){
                $sql = mysql_query("SELECT * FROM members where username=&#39;$username&#39; ");
                while($row = mysql_fetch_array($sql)){
                $new = $row[&#39;gamepoints&#39;] + 50;
                }
                mysql_query("UPDATE members SET gamepoints=&#39;$new&#39; WHERE username=&#39;$username&#39; ");
                echo "YaY!! well done! You now have $new game points
                ";
                echo "<a href=\"gn.php?username=$username&amp;password=$pas sword\">Play Again</a>
                ";
                }
                if ($guess <> $result){
                $sql = mysql_query("SELECT * FROM members where username=&#39;$username&#39; ");
                while($row = mysql_fetch_array($sql)){
                $new = $row[&#39;gamepoints&#39;] - 5;
                }
                mysql_query("UPDATE members SET gamepoints=&#39;$new&#39; WHERE username=&#39;$username&#39; ");
                echo "Awww sorry but your horse lost! You now have $new game points
                ";
                echo "<a href=\"gn.php?username=$username&amp;password=$pas sword\">Play Again</a>
                ";
                }
                }
                }
                echo "</p>";
                echo "</body>";
                echo "</html>";
                mysql_close();
                ?>

                Comment


                  #9
                  thats the fixed code
                  Code:
                  <?php
                  /*
                  * immortalwap
                  * created by russell morris april 6th 2008 based on the hilow game
                  *
                  * do not remove
                  *
                  */
                  
                  
                  
                  include("config.inc.php");
                  
                  
                  header("Content-type: text/html; charset=ISO-8859-1");
                  echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
                  echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
                  echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
                  
                  echo "<head>";
                  
                  echo "<title>$stitle</title>";
                  echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"theme/theme.css\" />";
                  echo "</head>";
                  
                  echo "<body>";
                  echo "<p align=\"center\">";
                  ?>
                  <?php
                  $Connect = mysql_connect("$server","$user","$pass");
                  mysql_select_db("$dbname");
                  $result=mysql_query("select * from members where username=&#39;$username&#39; and password=&#39;$password&#39;");
                  $number_of_rows = mysql_num_rows($result);
                  if ($number_of_rows>0)
                  {
                  include("check.inc.php");
                  }
                  if ($ok>0)
                  {
                  include("online.inc.php");
                  
                  echo "[b]THE IMMORTALWAP GRANDNATIONAL[/b]
                  ";
                  echo "[b]pick a winner[/b]
                  ";
                  
                  $re1= rand(1,8);
                  if ($re1 == 0){
                  echo "ARGH! the numbers are the same, whats the point?
                  
                  <a href=\"gn.php?username=$username&amp;password=$password\">(Try Again)</a>";}
                  else {
                  echo "[size="1"]The horses are numbered between 1 and 8[/size]
                  ";
                  echo "[/b]who will win the next race
                  ";
                  echo "<form action=\"gn2.php?username=$username&amp;password=$password\" method=\"post\">";
                  echo "<select name=\"guess\">";
                  echo "<option value=\"1\">1.Red Rum</option>";
                  echo "<option value=\"2\">2.Choccys Arse</option>";
                  echo "<option value=\"3\">3.Witchys Couldron</option>";
                  echo "<option value=\"4\">4.The Omyom Flyer</option>";
                  echo "<option value=\"5\">5.Shergar</option>";
                  echo "<option value=\"6\">6.Party Politics</option>";
                  echo "<option value=\"7\">7.Dancing Brave</option>";
                  echo "<option value=\"8\">8.Immortal</option>";
                  echo "</select>";
                  echo "<input type=\"hidden\" name=\"re1\" value=\"$re1\">";
                  echo "<input type=\"submit\" value=\"bet\"/>";
                  echo "</form>"; 
                  echo "
                  ";
                  echo "<a title=\"Enter\" href=\"welcome.php?username=$username&amp;password=$password\">(Main Menu)</a>";
                  
                  }}
                  echo "</p>"; 
                  echo "</body>"; 
                  echo "</html>"; 
                  mysql_close();
                  ?>
                  and
                  Code:
                  <?php
                  /*
                  * immortalwap
                  * created by russell morris april 6th 2008 based on the hilow game
                  *
                  *  do not remove
                  *
                  */
                  include("config.inc.php");
                  header("Content-type: text/html; charset=ISO-8859-1");
                  echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
                  echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
                  echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
                  
                      echo "<head>";
                  
                      echo "<title>$stitle</title>";
                      echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"theme/theme.css\" />";
                      echo "</head>";
                  
                      echo "<body>";
                  echo "<p align=\"center\">";
                  ?>
                  <?php
                  $re1 = $_POST["re1"];
                  $guess = $_POST["guess"];
                  $Connect = mysql_connect("$server","$user","$pass");
                  mysql_select_db("$dbname");
                  $result=mysql_query("select * from members where username=&#39;$username&#39; and password=&#39;$password&#39;");
                  $number_of_rows = mysql_num_rows($result);
                  if ($number_of_rows>0)
                  {
                      include("check.inc.php");
                  }
                  if ($ok>0)
                  {
                  $re2 = rand(1, 8);
                  if ($re1 == $re2){
                  echo "ERROR!";}
                  else {
                  echo "[b]IMMORTALWAP GRANDNATIONAL[/b]
                  ";
                  if ($re1 < $re2){
                  $result ="1";}
                  if ($re1 > $re2){
                  $result ="2";}
                  if ($re1 > $re2){
                  $result ="3";}
                  if ($re1 > $re2){
                  $result ="4";}
                  if ($re1 > $re2){
                  $result ="5";}
                  if ($re1 > $re2){
                  $result ="6";}
                  if ($re1 > $re2){
                  $result ="7";}
                  if ($re1 > $re2){
                  $result ="8";}
                  if ($guess == $result){
                  $sql = mysql_query("SELECT * FROM members where username=&#39;$username&#39; "); 
                  while($row = mysql_fetch_array($sql)){ 
                  $new = $row[&#39;gamepoints&#39;] + 50;
                  }
                  mysql_query("UPDATE members SET gamepoints=&#39;$new&#39; WHERE username=&#39;$username&#39; ");
                  echo "The WINNER is horse number $result
                  ";
                  echo "YaY!! well done! You now have $new game points
                  ";
                  echo "<a href=\"gn.php?username=$username&amp;password=$password\">Play Again</a>
                  ";
                  }
                  if ($guess <> $result){
                  $sql = mysql_query("SELECT * FROM members where username=&#39;$username&#39; "); 
                  while($row = mysql_fetch_array($sql)){ 
                  $new = $row[&#39;gamepoints&#39;] - 5;
                  }
                  mysql_query("UPDATE members SET gamepoints=&#39;$new&#39; WHERE username=&#39;$username&#39; ");
                  echo "The WINNER is horse number $result
                  ";
                  echo "Awww sorry but your horse lost! You now have $new game points
                  ";
                  echo "<a href=\"gn.php?username=$username&amp;password=$password\">Play Again</a>
                  ";
                  }
                  }
                  }
                  echo "</p>"; 
                  echo "</body>"; 
                  echo "</html>"; 
                  mysql_close();
                  ?>
                  Use [code]...[ /code] to post codes

                  Comment


                    #10
                    here is another type but I think this one is better
                    Code:
                    <?php
                    /*
                    * immortalwap
                    * created by russell morris april 6th 2008 based on the hilow game
                    *
                    * do not remove
                    *
                    */
                    
                    
                    
                    include("config.inc.php");
                    
                    
                    header("Content-type: text/html; charset=ISO-8859-1");
                    echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
                    echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
                    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
                    
                    echo "<head>";
                    
                    echo "<title>$stitle</title>";
                    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"theme/theme.css\" />";
                    echo "</head>";
                    
                    echo "<body>";
                    echo "<p align=\"center\">";
                    ?>
                    <?php
                    $Connect = mysql_connect("$server","$user","$pass");
                    mysql_select_db("$dbname");
                    $result=mysql_query("select * from members where username=&#39;$username&#39; and password=&#39;$password&#39;");
                    $number_of_rows = mysql_num_rows($result);
                    if ($number_of_rows>0)
                    {
                    include("check.inc.php");
                    }
                    if ($ok>0)
                    {
                    include("online.inc.php");
                    
                    echo "[b]THE IMMORTALWAP GRANDNATIONAL[/b]
                    ";
                    echo "[b]pick a winner[/b]
                    ";
                    echo "[size="1"]The horses are numbered between 1 and 8[/size]
                    ";
                    echo "[/b]who will win the next race
                    ";
                    echo "<form action=\"gn2.php?username=$username&amp;password=$password\" method=\"post\">";
                    echo "<select name=\"guess\">";
                    echo "<option value=\"1\">1.Red Rum</option>";
                    echo "<option value=\"2\">2.Choccys Arse</option>";
                    echo "<option value=\"3\">3.Witchys Couldron</option>";
                    echo "<option value=\"4\">4.The Omyom Flyer</option>";
                    echo "<option value=\"5\">5.Shergar</option>";
                    echo "<option value=\"6\">6.Party Politics</option>";
                    echo "<option value=\"7\">7.Dancing Brave</option>";
                    echo "<option value=\"8\">8.Immortal</option>";
                    echo "</select>";
                    echo "<input type=\"submit\" value=\"bet\"/>";
                    echo "</form>"; 
                    echo "
                    ";
                    echo "<a title=\"Enter\" href=\"welcome.php?username=$username&amp;password=$password\">(Main Menu)</a>";
                    
                    }
                    echo "</p>"; 
                    echo "</body>"; 
                    echo "</html>"; 
                    mysql_close();
                    ?>
                    Code:
                    <?php
                    /*
                    * immortalwap
                    * created by russell morris april 6th 2008 based on the hilow game
                    *
                    *  do not remove
                    *
                    */
                    include("config.inc.php");
                    header("Content-type: text/html; charset=ISO-8859-1");
                    echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
                    echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
                    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
                    
                        echo "<head>";
                    
                        echo "<title>$stitle</title>";
                        echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"theme/theme.css\" />";
                        echo "</head>";
                    
                        echo "<body>";
                    echo "<p align=\"center\">";
                    ?>
                    <?php
                    $guess = $_POST["guess"];
                    $Connect = mysql_connect("$server","$user","$pass");
                    mysql_select_db("$dbname");
                    $result=mysql_query("select * from members where username=&#39;$username&#39; and password=&#39;$password&#39;");
                    $number_of_rows = mysql_num_rows($result);
                    if ($number_of_rows>0)
                    {
                        include("check.inc.php");
                    }
                    if ($ok>0)
                    {
                    $result = rand(1, 8);
                    
                    if ($guess == $result){
                    $sql = mysql_query("SELECT * FROM members where username=&#39;$username&#39; "); 
                    while($row = mysql_fetch_array($sql)){ 
                    $new = $row[&#39;gamepoints&#39;] + 50;
                    }
                    mysql_query("UPDATE members SET gamepoints=&#39;$new&#39; WHERE username=&#39;$username&#39; ");
                    echo "The WINNER is horse number $result
                    ";
                    echo "YaY!! well done! You now have $new game points
                    ";
                    echo "<a href=\"gn.php?username=$username&amp;password=$password\">Play Again</a>
                    ";
                    }
                    if ($guess <> $result){
                    $sql = mysql_query("SELECT * FROM members where username=&#39;$username&#39; "); 
                    while($row = mysql_fetch_array($sql)){ 
                    $new = $row[&#39;gamepoints&#39;] - 5;
                    }
                    mysql_query("UPDATE members SET gamepoints=&#39;$new&#39; WHERE username=&#39;$username&#39; ");
                    echo "The WINNER is horse number $result
                    ";
                    echo "Awww sorry but your horse lost! You now have $new game points
                    ";
                    echo "<a href=\"gn.php?username=$username&amp;password=$password\">Play Again</a>
                    ";
                    }
                    }
                    echo "</p>"; 
                    echo "</body>"; 
                    echo "</html>"; 
                    mysql_close();
                    ?>

                    Comment


                      #11
                      thanks 4 sorting it was it hard to do and did i make many mistakes

                      Comment


                        #12
                        thanks 4 sorting it was it hard to do and did i make many mistakes[/b]
                        You made some technical mistakes thats why your code was not working properly,compare your codes to mine to find out your mistakes

                        Comment


                          #13
                          You made some technical mistakes thats why your code was not working properly,compare your codes to mine to find out your mistakes[/b]


                          ok no probs least it works now lol

                          Comment

                          Working...
                          X