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
Grand National
Started on the old forum in May 2008 · view the original in the archive · old links redirect here
you have not mentioned which language you used to make this game+seems you like hiding your codes.
you have not mentioned which language you used to make this game+seems you like hiding your codes.
why do i like hiding my codes ............... also its in html its on my site but not working fully
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
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
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
now post your code to get it fixed
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 " "; ?>
<?php $Connect = mysql_connect("$server","$user","$pass"); mysql_select_db("$dbname"); $result=mysql_query("select * from members where username='$username' and password='$password'"); $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&password=$password\">(Try Again)</a>";} else { echo "The horses are numbered between 1 and 8 "; echo "who will win the next race "; echo "<form action=\"gn2.php?username=$username&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&password=$password\">(Main Menu)</a>"; }} echo " "; 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 " "; ?>
<?php $Connect = mysql_connect("$server","$user","$pass"); mysql_select_db("$dbname"); $result=mysql_query("select * from members where username='$username' and password='$password'"); $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='$username' "); while($row = mysql_fetch_array($sql)){ $new = $row['gamepoints'] + 50; } mysql_query("UPDATE members SET gamepoints='$new' WHERE username='$username' "); echo "YaY!! well done! You now have $new game points "; echo "<a href=\"gn.php?username=$username&password=$password\">Play Again</a> "; } if ($guess <> $result){ $sql = mysql_query("SELECT * FROM members where username='$username' "); while($row = mysql_fetch_array($sql)){ $new = $row['gamepoints'] - 5; } mysql_query("UPDATE members SET gamepoints='$new' WHERE username='$username' "); echo "Awww sorry but your horse lost! You now have $new game points "; echo "<a href=\"gn.php?username=$username&password=$password\">Play Again</a> "; } } } echo " "; echo "</body>"; echo "</html>"; mysql_close(); ?>thats the fixed 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='$username' and password='$password'");
$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&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&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&password=$password\">(Main Menu)</a>";
}}
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
?>
and
<?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='$username' and password='$password'");
$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='$username' ");
while($row = mysql_fetch_array($sql)){
$new = $row['gamepoints'] + 50;
}
mysql_query("UPDATE members SET gamepoints='$new' WHERE username='$username' ");
echo "The WINNER is horse number $result
";
echo "YaY!! well done! You now have $new game points
";
echo "<a href=\"gn.php?username=$username&password=$password\">Play Again</a>
";
}
if ($guess <> $result){
$sql = mysql_query("SELECT * FROM members where username='$username' ");
while($row = mysql_fetch_array($sql)){
$new = $row['gamepoints'] - 5;
}
mysql_query("UPDATE members SET gamepoints='$new' WHERE username='$username' ");
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&password=$password\">Play Again</a>
";
}
}
}
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
?>
Use ...[ /code] to post codes
here is another type but I think this one is better
<?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='$username' and password='$password'");
$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&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&password=$password\">(Main Menu)</a>";
}
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
?>
<?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='$username' and password='$password'");
$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='$username' ");
while($row = mysql_fetch_array($sql)){
$new = $row['gamepoints'] + 50;
}
mysql_query("UPDATE members SET gamepoints='$new' WHERE username='$username' ");
echo "The WINNER is horse number $result
";
echo "YaY!! well done! You now have $new game points
";
echo "<a href=\"gn.php?username=$username&password=$password\">Play Again</a>
";
}
if ($guess <> $result){
$sql = mysql_query("SELECT * FROM members where username='$username' ");
while($row = mysql_fetch_array($sql)){
$new = $row['gamepoints'] - 5;
}
mysql_query("UPDATE members SET gamepoints='$new' WHERE username='$username' ");
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&password=$password\">Play Again</a>
";
}
}
echo "</p>";
echo "</body>";
echo "</html>";
mysql_close();
?>
thanks 4 sorting it was it hard to do and did i make many mistakes
You made some technical mistakes thats why your code was not working properly,compare your codes to mine to find out your mistakes
You made some technical mistakes thats why your code was not working properly,compare your codes to mine to find out your mistakes
ok no probs least it works now lol