Search the Community
Showing results for tags 'game'.
-
Best, I am currently working on a mafia crime game. But there is something wrong with my script. I have 1 error on my news. php, and will you even error + the script here. I know that my script is messy but am still but a novice It would be great if this solved hit! And sorry for my bad English. (IM a Belgian) Here the error + script: error: Parse error: syntax error, unexpected $end in C:\xampp\htdocs\_menu_l.php on line 881 and here the script: <?php $__admin = 16; $__gmod = 8; $__fmod = 4; $__help = 2; include("./includes/_mysql_connection.php"); include("./includes/_functions.php"); include("_functies.php"); if(!isset($_SESSION['__id'])){ header("location: index.php"); } define("ID", $_SESSION['__id']); $select = mysql_query("SELECT `username`, `ip`, `lastclick`, `id` FROM `users` WHERE `id` = ".ID." LIMIT 1") or die(mysql_error()); if(mysql_num_rows($select) == 0){ header("location: index.php"); } $res = mysql_fetch_assoc($select); $naam = $res['username']; $SESSID = $_COOKIE['PHPSESSID']; $s = mysql_query("SELECT `id` FROM `sessions` WHERE `id`=".ID." AND `SESSID`='".mr($SESSID)."' LIMIT 1") or die(mysql_error()); if(mysql_num_rows($s) == 0){ $sql = mysql_query("SELECT `id` FROM `sessions` WHERE `id`=".ID." LIMIT 1") or die(mysql_error()); if(mysql_num_rows($sql) == 0){ mysql_query("INSERT INTO `sessions`(`id`, `SESSID`) VALUES (".ID.", '".mr($_COOKIE['PHPSESSID'])."')") or die(mysql_error()); } /* else { unset($_SESSION); header("location: index.php"); }*/ if(mysql_num_rows($s) > 0 AND !isset($_SESSION['logged'])) { unset($_SESSION); header("location: index.php"); } } mysql_query("UPDATE `sessions` SET `SESSID`='".$SESSID."' WHERE `id`=".ID." LIMIT 1") or die(mysql_error()); // Selecteer wat data $sql = mysql_query("SELECT `speldata`. * , `landen`.`land` , `familie`.`naam` FROM `speldata` LEFT JOIN `landen` ON ( `speldata`.`land_id` = `landen`.`id` ) LEFT JOIN `familie` ON ( `speldata`.`familie_id` = `familie`.`id` ) WHERE `speldata`.`id` =".ID." LIMIT 1 ") or die(mysql_error()); $res = mysql_fetch_assoc($sql); /* Data invullen */ if(!is_null($res['naam'])){ $hasfam = true; } else { $hasfam = false; } $sql = mysql_query("SELECT COUNT(`id`) FROM `familie` WHERE `baas_id`=".ID." LIMIT 1") or die(mysql_error()); if(mysql_result($sql, 0) == 1){ $famboss = true; } else { $famboss = false; } $sql = mysql_query("SELECT COUNT(`id`) FROM `familie` WHERE `onderbaas_id`=".ID." LIMIT 1") or die(mysql_error()); if(mysql_result($sql, 0) == 1){ $famunderboss = true; } else { $famunderboss = false; } $sql = mysql_query("SELECT COUNT(`id`) FROM `familie` WHERE `shoutboxmod`=".ID." LIMIT 1") or die(mysql_error()); if(mysql_result($sql, 0) == 1){ $shoutmod = true; } else { $shoutmod = false; } $sql = mysql_query("SELECT COUNT(`id`) FROM `familie` WHERE `onderbaas_id2`=".ID." LIMIT 1") or die(mysql_error()); if(mysql_result($sql, 0) == 1){ $famunderboss2 = true; } else { $famunderboss2 = false; } $s = mysql_query("SELECT `misdaden_s`, `misdaden_g`, `auto_s`, `auto_g`, `wapenervaring`, `hoerenpimpen`, `kracht`, `fam_overvallen`, `bombaderen`, `stem`, `route66`, `computer` FROM `usertimes` WHERE `id`=".ID) or die(mysql_error()); $r = mysql_fetch_assoc($s); $sql_sd = mysql_query("SELECT `donateur`, `status` FROM `status` WHERE `id`=".ID) or die(mysql_error()); $rs = mysql_fetch_assoc($sql_sd); $__status = $rs['status']; $__dona = $rs['donateur']; $__rank = $rs['status']; if(isset($_COOKIE['banned']) && $__status > 0){ setcookie("banned", "true", time()); mysql_query("UPDATE `status` SET `status`=1 WHERE `id`=".ID) or die(mysql_error()); mysql_query("DELETE FROM `ip_banned` WHERE `ip`='".mr($_SERVER['REMOTE_ADDR'])."'") or die(mysql_error()); mysql_query("DELETE FROM `bans` WHERE `id`=".ID) or die(mysql_error()); } $v_id = array(); $v_ip = array(); $v_reden = "Hacken"; $v_names = array(""); if(in_array(ID, $v_id) || in_array($_SERVER['REMOTE_ADDR'], $v_ip) || in_array($naam, $v_names)){ die("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html> <head> <meta http-equiv='content-type' content='text/html; charset=iso-8859-1' /> <meta name='author' content='$naam' /> <link rel='shortcut icon' href='favicon.ico'> <link rel='icon' href='favicon.ico'> <link href='styles.css' rel='stylesheet' type='text/css' /> <title>Verbannen!</title> </head> <body style='background-color: #464646; text-align: center; margin-top: 7%'> <img src='IMG/ban.jpg' alt=''> <br><br> <font size='2'> <b> Je bent verbannen! <br><br> </font> Reden:</b> ".$v_reden."<br><br> </body> </html>"); } $_s = mysql_query("SELECT COUNT(`ip`) FROM `ip_banned` WHERE `ip`='".mr($_SERVER['REMOTE_ADDR'])."'") or die(mysql_error()); if($__status == 0 || isset($_COOKIE['banned']) || mysql_result($_s, 0) >= 1){ $sql = mysql_query("SELECT `reden` FROM `bans` WHERE `id`=".ID) or die(mysql_error()); $res = mysql_fetch_assoc($sql); if(!isset($_COOKIE['banned'])){ setcookie("banned", "true", (time() + (60*60*24*200))); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv='content-type' content='text/html; charset=iso-8859-1' /> <meta name='author' content='$naam' /> <link rel='shortcut icon' href='favicon.ico'> <link rel='icon' href='favicon.ico'> <link href='styles.css' rel='stylesheet' type='text/css' /> <title>Verbannen!</title> </head> <body style='background-color: #464646; text-align: center; margin-top: 7%'> <img src="IMG/ban.jpg" alt=""> <br><br> <font size='2'> <b> Je bent verbannen! <br><br> </font> Reden:</b> <?=$res['reden'];?><br><br> </body> </html> <? die(); } /* Zet er een nieuwe tijd in, om te zien dat ie online is */ if(!isset($_COOKIE['offline']) || $__status <= 1){ mysql_query("UPDATE `users` SET `lastclick`=".time()." WHERE `id`=".ID) or die(mysql_error()); } /*$poll = mysql_query("SELECT `user_id` FROM `poll_answers` WHERE `user_id`=".ID) or die(mysql_error()); if(mysql_num_rows($poll) == 0 AND $_SERVER['REQUEST_URI'] != "/poll.php"){ header("location: poll.php"); } */ $adminpagina = array("/famshoutbox.php", "/nieuws.php"); if($_SERVER['REQUEST_URI'] == $adminpagina){ header("location: nieuws.php"); } $st = cname(ID, $naam, true); $status = $st['status']; $familie = $res['naam']; $famID = $res['familie_id']; $staatID = $res['land_id']; $staat = $res['land']; if($staatID < 1 || $staatID > 11){ mysql_query("UPDATE `speldata` SET `land_id`=1 WHERE `id`=".ID) or die(mysql_error()); } $contant = $res['cashmoney']; $bank = $res['bankmoney']; /* Aantal hoeren, eerpunten, kills */ $hoeren = $res['hoeren_straat']; $hoeren_count = $res['count_hoeren']; $eerpunten = $res['eerpunten']; $killed = $res['kills']; mysql_query("UPDATE speldata SET cashmoney='0' WHERE cashmoney<'0'"); mysql_query("UPDATE speldata SET bankmoney='0' WHERE bankmoney<'0'"); /* Rank */ $leven = $res['leven']; if($leven == 0){ if(isset($_POST['reset'])){ $newname = trim($_POST['name']); $id = getid($newname); if(!is_name($newname)){ $msg = "Je hebt ongeldige tekens in je nieuwe naam gedaan!"; } elseif($id != false && $id != ID){ $msg = "Deze naam is al bezet!"; } else { cname(ID, $newname, false, true); mysql_query("UPDATE `speldata` SET `leven`=100, `hoeren_straat`=0, `rank`=0.5, `cashmoney`=2500, `bankmoney`=10000 WHERE `id`=".ID) or die(mysql_error()); mysql_query("UPDATE `status` SET `bescherming`=0 WHERE `id`=".ID) or die(mysql_error()); mysql_query("UPDATE `users` SET registerDate=NOW(),`username`='".$newname."' WHERE `id`=".ID) or die(mysql_error()); mysql_query("UPDATE `vrienden_blokkeren` SET `who`='".$newname."' WHERE `who`=".ID) or die(mysql_error()); mysql_query("UPDATE `uitrust` SET `kogels`=10, `huizen_gehad`='', `woning`=0, `wapen`=0, `verd`=0, `vliegtuig`=0 WHERE `id`=".ID) or die(mysql_error()); mysql_query("UPDATE `userstats` SET `misdaden_s`=0, `misdaden_g`=0, `auto_s`=0, `auto_g`=0, `kracht`=0, `winst`=0, `verlies`=0, `wapenervaring`=0, `wapentraining`=0, `hacken`=0, `hack_s`=0, `program`=0, `program_s`=0, `beheer`=0, `beheer_s`=0 WHERE `id`=".ID); mysql_query("UPDATE `usertimes` SET `misdaden_s`=0, `misdaden_g`=0, `auto_s`=0, `auto_g`=0, `wapenervaring`=0, `hoerenpimpen`=0, `reizen`=0, `kracht`=0 WHERE `id`=".ID); mysql_query("DELETE FROM `hoeren_rld` WHERE `id`=".ID) or die(mysql_error()); mysql_query("DELETE FROM `hoeren_voorbereiding` WHERE `id`=".ID) or die(mysql_error()); mysql_query("DELETE FROM `gevangenis` WHERE `user_id`=".ID) or die(mysql_error()); mysql_query("DELETE FROM `garage` WHERE `user_id`=".ID) or die(mysql_error()); mysql_query("DELETE FROM `crusher_converter` WHERE `user_id`=".ID) or die(mysql_error()); mysql_query("DELETE FROM `drugs_drank` WHERE `user_id`=".ID) or die(mysql_error()); // mysql_query("UPDATE plattegrond SET owner='0',Gevangenis='0',Red_Light_District='0',Ziekenhuis='0',Casino='0' WHERE owner='".ID."'"); mysql_query("UPDATE speldata SET platte='0' WHERE id='".ID."'"); header("location: nieuws.php"); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv='content-type' content='text/html; charset=iso-8859-1' /> <meta name='author' content='$naam' /> <link rel='shortcut icon' href='favicon.ico'> <link rel='icon' href='favicon.ico'> <link href='styles.css' rel='stylesheet' type='text/css' /> </head> <body style='background-color: #303030; text-align: center; margin-top: 7%'> <form method='post' action='nieuws.php'> <img src="IMG/grave_rip.jpg" alt=""> <br><br> <font size='2'> <b> Je bent vermoord! <br><br> <?php if(isset($msg)){ echo $msg; } ?> Naam: <input type='text' name='name' value='<?=$naam;?>' maxlength='12' /><br><br> <input type='submit' name='reset' value='Opnieuw Beginnen!' /> </b> </font> </form> </body> </html> <? die(); } $rank = getRank($res['rank']); $rankID = $rank['rankID']; $gSql = mysql_query("SELECT `tijd` FROM `gevangenis` WHERE `user_id`=".ID." AND `tijd`>".time()." LIMIT 1") or die(mysql_error()); if(mysql_num_rows($gSql) == 1){ $gevangen = true; $gRes = mysql_fetch_assoc($gSql); $seconden = $gRes['tijd'] - time(); } else { $gevangen = false; } $rSql = mysql_query("SELECT `reizen` FROM `usertimes` WHERE `id`=".ID) or die(mysql_error()); $rRes = mysql_fetch_assoc($rSql); if($rRes['reizen'] > time()) { $reizen = true; $reistijd = $rRes['reizen'] - time(); } else { $reizen = false; } include("_mainMenus.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv='content-type' content='text/html; charset=iso-8859-1' /> <meta name='author' content='$naam' /> <link href='styles.css' rel='stylesheet' type='text/css' /> <link rel='shortcut icon' href='favicon.ico'> <link rel='icon' href='favicon.ico'> <title>MyWay</title> </head> <body> <table width='100%' cellspacing='0' style='margin: 0px;'> <tr> <td width='14%' style='vertical-align: top;'> <table border='0' cellspacing='1' width='100%' bgcolor='#000'> <?php foreach($menuleft AS $cat => $subCats){ echo " <tr><td class='menutop'>".$cat."</td></tr>"; if(is_array($subCats)){ foreach($subCats AS $url => $name){ if($url == "donatieshop.php"){ echo " <tr><td class='menu'><img src='IMG/star.jpg' alt=''><a href='".$url."'>".$name."</a></td></tr>"; } else { echo " <tr><td class='menu'><a href='".$url."'> - ".$name."</a></td></tr>"; } } } } ?> </table> </td> <td width='72%' style='vertical-align: top; height: 0px; text-align:center;' align='center'> <table border='0' cellspacing='0' width='100%' align='center'> <tr> <td> <table border='0' cellspacing='1' width='96%' bgcolor='#000' align='center'> <tr> <td class='header' style='padding: 0px;'> <table style="margin:0px; padding:0px;vertical-align: bottom;" cellpadding="0" cellspacing="0" width="100%"> <tr> <td style="padding:0px; margin:0px;"> <img src="/IMG/header_image.jpg" alt="" /> </td> <td> <div class="counter_view"> <table cellpadding="0" cellspacing="0" style="margin: 0px; padding: 0px;"> <tr> <td style="width: 54px;"> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <img src='/images/icons/gun.png' alt='' title='Misdaden/Familie misdaad' border='0'> </td> <td><?php if($r['misdaden_s'] < time()){ echo "<a href='misdaad.php'>Nu</a>"; } else { echo "<span id='cdmisdaad_s'>".($r['misdaden_s'] - time())."</span>".countDown("misdaad_s", ($r['misdaden_s'] - time())); } ?></td> </tr> </table> </td> <td style="width: 50px;"> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <img src='/images/icons/gun_anchor.png' alt='' title='Wapen Training' border='0'> </td> <td> <?php if($r['wapenervaring'] < time()){ echo "<a href='wapenervaring.php'>Nu</a>"; } else { echo "<span id='cdwapenervaring'>".($r['wapenervaring'] - time())."</span>".countDown("wapenervaring", ($r['wapenervaring'] - time())); } ?> </td> </tr> </table> </td> <td style="width: 54px;"> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <img src='/images/icons/anchor.png' alt='' title='Sportschool Training' border='0'> </td> <td> <?php if($r['kracht'] < time()){ echo "<a href='sportschool.php'>Nu</a>"; } else { echo "<span id='cdkracht'>".($r['kracht'] - time())."</span>".countDown("kracht", ($r['kracht'] - time())); } ?> </td> </tr> </table> </td> </tr> <tr> <td style="width: 54px;"> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <img src='/images/icons/car.png' alt='' title='Voertuigen Beginners' border='0'> </td> <td> <?php if($r['auto_s'] < time()){ echo "<a href='stealcar.php'>Nu</a>"; } else { echo "<span id='cdauto_s'>".($r['auto_s'] - time())."</span>".countDown("auto_s", ($r['auto_s'] - time())); } ?> </td> </tr> </table> </td> <td style="width: 54px;"> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <img src='/images/icons/car_add.png' alt='' title='Voertuigen Gevorderden' border='0'> </td> <td> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <?php if($rank['rankID']< 5){ ?> <img src='/images/icons/cross_small.png' alt='' border='0'> <?php } else { if($r['auto_g'] < time()){ echo "<a href='stealcar.php'>Nu</a>"; } else { echo "<span id='cdauto_g'>".($r['auto_g'] - time())."</span>".countDown("auto_g", ($r['auto_g'] - time())); } } ?> </td> <td> </td> </tr> </table> </td> </tr> </table> </td> <td style="width: 50px;" colspan="2"> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <img src='/images/icons/user_female.png' alt='' title='Hoeren Pimpen' border='0'> </td> <td> <?php if($r['hoerenpimpen'] < time()){ echo "<a href='rld.php'>Nu</a>"; } else { echo "<span id='cdhoerenpimpen'>".($r['hoerenpimpen'] - time())."</span>".countDown("hoerenpimpen", ($r['hoerenpimpen'] - time())); } ?> </td> </tr> </table> </td> </tr> <tr> <td style="width: 54px;"> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <img src='/images/icons/group.png' alt='' title='Familie Overval' border='0'> </td> <td> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <?php if($famID == 0){ ?> <img src='/images/icons/cross_small.png' alt='' border='0'> <?php } else { if($r['fam_overvallen'] < time()){ echo "<a href='famoverval.php'>Nu</a>"; } else { echo "<span id='cdfam_overvallen'>".($r['fam_overvallen'] - time())."</span>".countDown("fam_overvallen", ($r['fam_overvallen'] - time())); } } ?> </td> <td> </td> </tr> </table> </td> </tr> </table> </td> <td style="width: 54px;"> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <img src='/images/icons/group_gun.png' alt='' title='Route 66' border='0'> </td> <td> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <?php if($r['route66'] < time()){ echo "<a href='route66.php'>Nu</a>"; } else { echo "<span id='cdroute66'>".($r['route66'] - time())."</span>".countDown("route66", ($r['route66'] - time())); } ?> </td> <td> </td> </tr> </table> </td> </tr> </table> </td> <td style="width: 50px;" colspan="2"> <table border='0' cellspacing='0' style='margin: 0px;'> <tr> <td> <img src='/images/icons/bomb.png' alt='' title='Aanslag Plegen' border='0'> </td> <td> <?php if($r['bombaderen'] < time()){ echo "<a href='plattegrond.php'>Nu</a>"; } else { echo "<span id='cdbombaderen'>".($r['bombaderen'] - time())."</span>".countDown("bombaderen", ($r['bombaderen'] - time())); } ?> </td> </tr> </table> </td> </tr> </table> </div> </td> </tr> </table> </td> </tr> <td class='subheader'> <table width='100%' border='0' cellspacing='0' style='margin: 0px;' cellpadding='0'> <tr> <td style='text-align: left;'> <a href='fambericht.php'><img src='IMG/tab/fambericht.jpg' alt='' border='0' /></a><? if($__status >= 16){echo "<a href='hqadminbasis.php'><img src='IMG/tab/admin.jpg' alt='' border='0' /></a>"; } ?> <? if($__status == { echo "<a href='gmod.php'><img src='IMG/tab/gamemod.jpg' alt='' border='0' /></a>"; } ?> <? if($__status == 4){ echo "<a href='forummod.php'><img src='IMG/tab/forummod.jpg' alt='' border='0' /></a>"; } ?> <? if($__status == 2){ echo "<a href='hdbasis.php'><img src='IMG/tab/helpdesk.jpg' alt='' border='0' /></a>"; } ?> <?php $sql = mysql_query("SELECT `id` FROM `berichten` WHERE `gelezen`=0 AND `ontvanger_id`=".ID." AND `in_inbox`=0 LIMIT 1") or die(mysql_error()); if(mysql_num_rows($sql) == 1){ echo "<a href='berichten.php?x=inbox'><img src='IMG/tab/inbox_n.jpg' alt='' border='0' /></a>"; } else { echo "<a href='berichten.php?x=inbox'><img src='IMG/tab/inbox.jpg' alt='' border='0' /></a>"; } ?><a href='berichten.php?x=outbox'><img src='IMG/tab/outbox.jpg' alt='' border='0' /></a><a href='berichten.php?x=new'><img src='IMG/tab/new.jpg' alt='' border='0' /></a> </td> <td style='text-align: right;'> <?php if($gevangen){ echo " <table border='0' cellspacing='0' cellpadding='0' align='right'> <tr> <td> <img src='IMG/gevang.jpg' alt='' style='margin: 0px;'> </td> <td> <b><span id='cdgevang'>".$seconden."</span></b> </td> </tr> </table> ".countDown("gevang", $seconden); } if($reizen){ echo " <table border='0' cellspacing='0' cellpadding='0' align='right'> <tr> <td> <img src='IMG/reizen.jpg' alt='' style='margin: 0px;'> </td> <td> <b><span id='cdreis'>".$reistijd."</span></b> </td> </tr> </table> ".countDown("reis", $reistijd); } ?> </td> </tr> </table> </td> </tr> </table> </td> </tr> <?php $SSQl = mysql_query("SELECT status FROM speldata WHERE id=".ID) or die(mysql_error()); $QREs = mysql_fetch_assoc($SSQl); $statu = $QREs['status']; $MSQL = mysql_query("SELECT m_12 FROM count_missions WHERE id=".ID) or die(mysql_error()); $QrSl = mysql_fetch_assoc($MSQL); $m12 = $QrSl['m_12']; if($statu == 0){ $plrstatus = Online; } elseif($statu == 1){ $plrstatus = Online; } elseif($statu == 2){ $plrstatus = Bezet; } elseif($statu == 3){ $plrstatus = Afwezig; } elseif($statu == 4){ $plrstatus = Smokkelen; } elseif($statu == 5){ $plrstatus = Designen; } elseif($statu == 6){ $plrstatus = Druk; } elseif($statu == 7){ $plrstatus = Eten; } elseif($statu == 99){ $plrstatus = Scripten; } elseif($statu == 100){ $plrstatus = Legend; } if(isset($_POST['go'])){ $actie = $_POST['actie']; if($actie == 1){ mysql_query("UPDATE speldata SET status = 1 WHERE id=".ID); } elseif($actie == 2){ mysql_query("UPDATE speldata SET status = 2 WHERE id=".ID); } elseif($actie == 3){ mysql_query("UPDATE speldata SET status = 3 WHERE id=".ID); } elseif($actie == 4){ mysql_query("UPDATE speldata SET status = 4 WHERE id=".ID); } elseif($actie == 5){ mysql_query("UPDATE speldata SET status = 5 WHERE id=".ID); } elseif($actie == 6){ mysql_query("UPDATE speldata SET status = 6 WHERE id=".ID); } elseif($actie == 7){ mysql_query("UPDATE speldata SET status = 7 WHERE id=".ID); } elseif($actie == 99){ mysql_query("UPDATE speldata SET status = 99 WHERE id=".ID); } elseif($actie == 100){ mysql_query("UPDATE speldata SET status = 100 WHERE id=".ID); } } ?> <tr> <form method='post' actie='".$_SERVER['SCRIPT_NAME']."?".$_SERVER['QUERY_STRING']."'> <td style='text-align: right; padding-right: 27px; padding-top: 5px; padding-bottom: 5px;'> <select name='actie'> <option value='0'>-- <?=$plrstatus;?> --</option> <option value='1'>Online</option> <option value='2'>Bezet</option> <option value='3'>Afwezig</option> <option value='4'>Smokkelen</option> <option value='5'>Designen</option> <option value='6'>Druk</option> <option value='7'>Eten</option> <?php if($__status == 16){ ?> <option value='99'>Scripten</option> <? } ?> <?php if($m_12 == 1){ ?> <option value='100'>Legend</option> <? } ?> </select> <input type='submit' name='go' value='Update!' /> </td> </tr> </form> </html> <tr> <td style='text-align: center;'> <?php $sql = mysql_query("SELECT `bankmoney`, `cashmoney` FROM `speldata` WHERE `id`=".ID) or die(mysql_error()); $res = mysql_fetch_assoc($sql); if(ID == ''){ //Logboek script als je iemand niet vertrouwd! $logQuery = "INSERT INTO `logboek`(`id_user`, `ip`,`date`, `page`, `money`) VALUES (".ID.", '".$_SERVER['REMOTE_ADDR']."', NOW(), '".mr($_SERVER['REQUEST_URI'])."', ".($res['bankmoney'] + $res['cashmoney']).")"; mysql_query($logQuery) or die(mysql_error()); } if($res['cashmoney'] < 0){ mysql_query("UPDATE `speldata` SET `cashmoney`=0, `bankmoney`=`bankmoney`+".$res['cashmoney']." WHERE `id`=".ID) or die(mysql_error()); $menu_rechts_top['Contant'] = "\$0"; $menu_rechts_top['Bank'] = "\$".number_format($bank + $res['cashmoney']); } if($res['bankmoney'] < 0){ if($_GET['p'] == "famdonate"){ mysql_query("UPDATE `familie` SET `geld`=`geld`+".$res['bankmoney']." WHERE `id`=".$famID) or die(mysql_error()); mysql_query("UPDATE `speldata` SET `bankmoney`=0 WHERE `id`=".ID) or die(mysql_error()); mysql_query("UPDATE `famdonaties` SET `total`=`total`+".$res['bankmoney']." WHERE `user_id`=".ID." AND `fam_id`=".$famID) or die(mysql_error()); $menu_rechts_top['Bank'] = "\$0"; } elseif($url == "markt.php"){ $min = (int) str_replace("-", "", $res['bankmoney']); $s = mysql_query("UPDATE `markt_alg` SET `bieder`=0, `high_bod`=`bied_bod` WHERE `bieder`=".ID." AND `high_bod`>=".$min." LIMIT 1") or die(mysql_error()); if(mysql_affected_rows($s) == 0){ $s = mysql_query("SELECT `id` FROM `markt_alg` WHERE `bieder` =".ID." AND `high_bod` <".$min." ORDER BY `high_bod` DESC LIMIT 1 ") or die(mysql_error()); $r = mysql_fetch_assoc($s); mysql_query("UPDATE `markt_alg` SET `bieder`=0, `high_bod`=`bied_bod` WHERE `id`=".$r['id']) or die(mysql_error()); mysql_query("UPDATE `speldata` SET `bankmoney`=0 WHERE `id`=".ID) or die(mysql_error()); } else { mysql_query("UPDATE `speldata` SET `bankmoney`=0 WHERE `id`=".ID) or die(mysql_error()); } } else { mysql_query("UPDATE `speldata` SET `bankmoney`=0, `cashmoney`=`cashmoney`+".$res['bankmoney']." WHERE `id`=".ID) or die(mysql_error()); $menu_rechts_top['Bank'] = "\$0"; $menu_rechts_top['Contant'] = "\$".number_format($contant + $res['bankmoney']); } } ?> Thanks in advance for the help! _menu_l.php
-
Hello, I am building an online game(users make a character and move on a map and so on...) All user data is stored in a mySQL database and I want the users to interact in real-time, but there can be a 1-3 second delay between the communication, but not exceed 3 seconds even if 500 players are playing at the same time. But for the purpose of the question let's say the users can only chat between one another, if I'll have a solution for that then I can use the same method for more parts of the game. I can't use websockets because my webhost doesn't support it( I don't want to use pusher.com). I know I can make real-time apps with ajax long polling, but I think that with 500 players playing at the same time it's not the best solution. So, finally: How can I make user interaction as close as possible to a real-time game? (Without too much load on the hosting server) (I am sorry if some of my terms are not correct - I am just getting back to coding after a long time...)
-
hi there is this game i play and i am trying to accomplish a code which adds items coming from the games xml. the game is called zwinky and i'm having a small problem which can maybe be easily fixed. Here are the codes: http://paste.ee/p/JHMow http://paste.ee/p/pIEUt they are written differently. Okay So the problem is a little message when used on my webhost comes up on browser saying : "HTTP/1.1 100 Continue HTTP/1.1 200 OK Date: Sat, 24 May 2014 22:52:31 GMT Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8c DAV/2 mod_jk/1.2.28 Cache-Control: max-age=0, must-revalidate Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: anx="os=-&g=-&oc=-&sn=dfprdzwinky4&od=none&op=-&fv=1400971951270&ob=-&om=-&lv=1400971951270&ok=-&nv=1"; Version=1; Domain=.zwinky.com; Max-Age=7776000; Expires=Fri, 22-Aug-2014 22:52:31 GMT; Path=/ Content-Language: en-US Content-Length: 92 Connection: close Content-Type: application/xml;charset=UTF-8 User not signed in" as you can see it says "user not signed in" yet i am signed in into the game.. So i believe somewhere in the code the cookies are wrong or the code doesn't have the necessary elements to show that you are being logged in. to get the cookies/ login info you need to create a game account which takes 10-20 seconds: http://registration..../register.jhtml and then using fiddler/charles or any other method displaying the accounts cookies it should show them up. I don't know what is needed to add to the code to make it work here our other topics on this issue never solved which might help: http://forum.ragezon...44/help-920369/ http://www.webdevelo...129-php-execute if anyone could help please! it's not hard making the game accounts and viewing the cookies, please and thank you!!!!
-
Hello! I was assigned to create a simple php game as a part of my grade. I'm not really a php expert and this isnt really working. I copied some of the code from this website, but this isn't really working for me. I don't really know how to solve the problem and connect that two files. Part 1: <html> <head> <title>PHP based example Game - Earth & Wind & Fire (aka Paper-Scissors-Rock)</title> </head> <body> <center> <div id="game"> <a href="?item=earth">Earth<br /><img src="images/sand.png" width="135" height="135" alt="Earth"></a><br /><a href="?item=wind">Wind<br /><img src="images/wind.png" width="135" height="135" alt="Wind"></a><br /><a href="?item=fire">Fire<br /><img src="images/fire.png" width="135" height="135" alt="Fire"></a><br /></div> </center> </body> </html> Part 2: <?php function showComponents($items = null) { $pictures = array( "earth" => '<a href="?item=earth">Earth<br /><img src="images/sand.png" width="135" height="135" alt="Earth"></a><br />', "wind" => '<a href="?item=wind">Wind<br /><img src="images/wind.png" width="135" height="135" alt="Wind"></a><br />', "fire" => '<a href="?item=fire">Fire<br /><img src="images/fire.png" width="135" height="135" alt="Fire"></a><br />', ); if ($items == null) : foreach( $pictures as $items => $value ): echo $value; endforeach; else: echo str_replace("?item={$items}", "#", $pictures[$items]); endif; } function game() { if ( isset($_GET['item']) == TRUE ) : $pictures = array('earth','wind','fire'); $playerPic = strtolower($_GET['item']); $computerPic = $pictures[rand(0, 2)]; echo '<div><a href="http://mapswidgets.com/game.php">New game</a></div>'; if (in_array($playerPic, $pictures) == FALSE): echo "Play as either Earth, Wind or Fire."; die; endif; if ( $playerPic == 'fire' && $computerPic == 'wind' OR $playerPic == 'earth' && $computerPic == 'fire' OR $playerPic == 'wind' && $computerPic == 'earth' ): echo '<h2>You Win!</h2>'; endif; if ( $computerPic == 'fire' && $playePic == 'wind' OR $computerPic == 'earth' && $playerPic == 'fire' OR $computerPic == 'wind' && $playerPic == 'earth' ): echo '<h2>Computer wins!</h2>'; endif; if ($playerPic == $computerPic) : echo '<h2>House wins! =)</h2>'; endif; showComponents($playerPic); showComponents($computerPic); else : showComponents(); endif; } ?> Thanks for your time and help!
-
Hi! I was assigned to create a simple php game as a part of my grade, but i got stuck. I'm not really a php expert and this isnt really working. I managed to get some of the code/game working, but it's pointless imo. I'm looking for someone who would take 3 mins and fix this code for me. The game is called "Random number guessing game." From the title you can see that the game is not really complicated. Code: <html> <head> <title></title> </head> <body> <h1> Ugani Random!</h1> <? php if(isset($_POST['submit'])) $x = $_POST['x']; $num = $_POST['num']; $x = rand(1, 10) if($num<$x) { echo " Your number is higher! "<br /> } if($num==$x) { echo " Correct! Press Reset to try again! "<br /> } if($num>$x) { echo " Your number is lower! "<br /> } ?> <p> <form> <input type="number" name="quantity"> <br /> <button type="submit" value="<? echo $x?>">Submit</button> <button type="reset" value="<? echo $num?>">Reset</button> </form> </p> </body> </html> Computer basically generates a random number and compares it to the input part of <p> but it's not working as intended.
-
hi there is this game i play and i am trying to accomplish a code which adds items coming from the games xml. the game is called zwinky and i'm having a small problem which can maybe be easily fixed. Here are the codes: http://paste.ee/p/JHMow http://paste.ee/p/pIEUt they are written differently. Okay So the problem is a little message when used on my webhost comes up on browser saying : "HTTP/1.1 100 Continue HTTP/1.1 200 OK Date: Sat, 24 May 2014 22:52:31 GMT Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8c DAV/2 mod_jk/1.2.28 Cache-Control: max-age=0, must-revalidate Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: anx="os=-&g=-&oc=-&sn=dfprdzwinky4&od=none&op=-&fv=1400971951270&ob=-&om=-&lv=1400971951270&ok=-&nv=1"; Version=1; Domain=.zwinky.com; Max-Age=7776000; Expires=Fri, 22-Aug-2014 22:52:31 GMT; Path=/ Content-Language: en-US Content-Length: 92 Connection: close Content-Type: application/xml;charset=UTF-8 User not signed in" as you can see it says "user not signed in" yet i am signed in into the game.. So i believe somewhere in the code the cookies are wrong or the code doesn't have the necessary elements to show that you are being logged in. to get the cookies/ login info you need to create a game account which takes 10-20 seconds: http://registration.zwinky.com/registration/register.jhtml and then using fiddler/charles or any other method displaying the accounts cookies it should show them up. I don't know what is needed to add to the code to make it work here our other topics on this issue never solved which might help: http://forum.ragezone.com/f144/help-920369/ http://www.webdeveloper.com/forum/showthread.php?268129-php-execute if anyone could help please! it's not hard making the game accounts and viewing the cookies, please and thank you!!!!
-
i need help with a login i have on my site. I'm new to this so i dont know if i'll get any help
-
Hi i am trying to make a bto for a game i play with my friends we play in a group of 4 in the game there is a line of letters 4-5 of them you then need to make words from thos letters and the one with the most words wins i have created my own anagram solver and created a bot for entering these into the flash game but now i want to make it fully auto i am looking for a way to get the letters from the flash game ? i have looked at the page source code and nothing is stored there so i am wondering if there is any way to inspect the game as it runs inside vb.net ?
-
Hey im trying to make a small little game for my self at the moment, to test my self a little, the game i creating is based a little on the game http://ogame.org, im trying to find out how i can make the ressources auto increase on each member created on my site as the site ogame has, i dont need the javescript so you can see it auto increase, but just need to refresh it and then i can see that it has gone up, in my game im using Gold, Silver and Copper as ressources atm, and im not sure how to make the number in my database auto increase while the user have logged out, i was thinking about using some kind of function that would increse copper with 1 for each sec there goes with a timestamp or something like that, any of you guys knows how this could be possible? Regards Dan Larsen
-
This may sound like a weird one. I'm in the process of making a HTML5 game where I need to make contact with a MYSQL database. I planned on doing this using PHP scripts that the game sends AJAX requests to with post data. Is there a way of securing these scripts so no one on the outside can access (or just run) them, but the game can. The game will be ran on the same server as the scripts. Does this sound ridiculous or is it possible? Or am I going about this the entirely wrong way, thanks for any answers in advance!!
-
I want to create a text based real time strategy game. I would like to know how I can create an ingame mine that produces x amount of resources/h. And then to make the mine upgrade able. Witch wil take y amount of time to upgrade and cost z amount of resources to upgrade. And then increase the production per hour by a new amount per hour. Any one willing to help or even show me code that will do this or even direct me to a tutorial please.
-
Trying to make a game where the user plays the computer, the user does not get to place ships and the computer does not try to sink the human's ships. on submit, the game is supposed to tell the user hit or miss or you sank my ship the board is supposed to remember where the user clicked each time until the game is over the computer randomly places 5 boats, I have the computer placing the boats, and I have some fire buttons, but its not connecting, and its not supposed to show where the boats are ( user is not supposed to see that part) <?php session_start() ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Battleship</title> <style type = "text/css"> #footer {font-size: small; text-align:center; clear:right; padding-bottom:20px; } body { background-image:url("infor.jpg"); color: white;text-align:center } p { color: yellow; text-align:center;} </style> </head> <body> <?php if(isset($_POST['start_game']) || isset($_POST['myGuess'])){ if (isset($_POST["counter"])){ $counter = $_POST["counter"]; } else { $counter = 0; } // end if $counter++; //store new data in counter $_SESSION["counter"] = $counter; if(isset($_POST['start_game']) || isset($_POST['myGuess'])){ if (isset($_POST["counter"])){ $counter = $_POST["counter"]; } else { $counter = 0; } // end if $counter++; //store new data in counter $_SESSION["counter"] = $counter; if(isset($_POST['choice'])){ if($_POST['choice']=="correct") print "<br>I got it! it took me $counter tries. <br>"; } $myGuess=rand($lowest,$highest); //This is used for debugging - keeping track of what each value is when the submit button is pressed // if(isset($_POST['choice'])){ //print_r($_POST); //} $form = "showOptions"; }else{ $form = "showStart"; } if($form == "showOptions"){ ?> <h2> <form method="post" action="" name="target"> <input type="Submit" value="Submit" align="MIDDLE"> </form> </h2> <form action="" method="post" > <table border="1" align="center"> <?PHP $step = $_POST['step']; if ($step > 2) { $step = 0; } else { $step += 1; }//end if if($step == 1) { for ($i = a; $i < k; $i++){ echo "<tr><td width='20' align='right'>$i</td>"; for ($j = 1; $j < 11; $j++){ echo "<td><input type='submit' value='fire' name='$i$j'></td>"; } // end for loop echo "</tr>"; } // end for loop echo "<tr><td></td>"; for ($j = 1; $j < 11; $j++){ echo "<td>$j</td>"; } echo "</tr></table>"; // result of fire } else { echo "Result "; for ($i = a; $i < k; $i++){ echo "<tr><td width='10' align='right'>$i</td>"; for ($j = 1; $j < 11; $j++){ echo "<td><input type='checkbox' checked='checked' disabled='disabled' name='$i$j'></td>"; } // end for loop echo "</tr>"; } // end for loop echo "<tr><td></td>"; for ($j = 1; $j < 11; $j++){ echo "<td>$j</td>"; } echo "</tr></table><br><input type='submit' name='' value='shoot'>"; }//end if ?> <input type="hidden" name="step" value="<?php echo "$step";?>" /> </form> </center> <?php if ($step == 0) { for ($i = a; $i < k; $i++){ echo "<tr><td width='10' align='right'>$i</td>"; for ($j = 1; $j < 11; $j++){ echo "<td><input type='submit' value='fire' name='$i$j'></td>"; } // end for loop echo "</tr>"; } // end for loop echo "<tr><td></td>"; for ($j = 1; $j < 11; $j++){ echo "<td>$j</td>"; } echo "</tr></table>"; //player fireing } else if($step == 1) { for ($i = a; $i < k; $i++){ echo "<tr><td width='10' align='right'>$i</td>"; for ($j = 1; $j < 11; $j++){ echo "<td><input type='submit' value='fire' name='$i$j'></td>"; } // end for loop echo "</tr>"; } // end for loop echo "<tr><td></td>"; for ($j = 1; $j < 11; $j++){ echo "<td>$j</td>"; } echo "</tr></table>"; // result of fire } else { echo "Result "; for ($i = a; $i < k; $i++){ echo "<tr><td width='10' align='right'>$i</td>"; for ($j = 1; $j < 11; $j++){ echo "<td><input type='checkbox' checked='checked' disabled='disabled' name='$i$j'></td>"; } // end for loop echo "</tr>"; } // end for loop echo "<tr><td></td>"; for ($j = 1; $j < 11; $j++){ echo "<td>$j</td>"; } } echo "</tr></table><br><input type='submit' name='' value='shoot'>"; }//end if ?> <input type="hidden" name="step" value="<?php echo "$step";?>" /> <h2>The number of squares for each ship is determined by the type of the ship. <BR /> The ships cannot overlap (i.e., only one ship can occupy any given square in the grid). <BR /> In each round, the Human clicks the target square which is to be shot at. <BR /> The Computer announces whether or not the square is occupied by a ship, <BR /> and if it is a hit they mark this on their own primary grid. <BR /> When all of the squares of a ship have been hit, the ship is sunk, <BR /> and the Computer owner announces this (e.g. You sunk my battleship!!). <BR /> If all of a player's ships have been sunk, the game is over and their opponent wins. </h2> <h2><?php echo "<br> <a href='battleshipmajorstart.php'>Reset Game</a>" ?></h2> <?php error_reporting( E_ALL ); // $ships['Ship Name'] = size (int); $ships = array( 'Carrier' => 5, 'Battleship' => 4, 'Destroyer' => 3, 'Submarine' => 3, 'Patrol Boat' => 2 ); // $grid[x-coord][y-coord] $grid = array(); // Loop through ships for placement foreach( $ships as $name => $size ) { // Begin an infinite loop ( dangerous, but we can break it when // the ship is happily placed ) while ( TRUE ) { // Determine direction of ship // x- horizontal, y- vertical $axis = ( mt_rand(0,1) == 1 ? 'x' : 'y' ); // Maximum values on grid $max = array( 'x' => 10, 'y' => 10 ); // Subtract $size from the max value to compensate for ship size $max[ $axis ] -= $size; // Generate random placement $x = mt_rand( 1, $max['x'] ); $y = mt_rand( 1, $max['y'] ); // Check to see if the grid is empty by checking $size squares in $axis direction for ( $i = 0; $i < $size; $i++ ) { //Create a temporary holder for our coordinates $curr = array( 'x' => $x, 'y' => $y ); ////Add current grid position to the direction we're going $curr[ $axis ] += $i; // Check to see if the grids populated if ( isset( $grid[ $curr['x'] ][ $curr['y'] ] ) ) //If it is, start at the beginning of the while loop and find new coordinates continue 2; } // If the for loop didn't run into a collision, then we know the grid space is empty //and we can break out of the infinite loop! break; } //Now that we have a position for the ship, write it into the grid! for ( $i = 0; $i < $size; $i++ ) { // Create a temporary holder for our coordinates $curr = array( 'x' => $x, 'y' => $y ); // Add current grid position to the direction we're going $curr[ $axis ] += $i; // Add the first letter of the ships name to the grid ( just for example purposes ) $grid[ $curr['x'] ][ $curr['y'] ] = substr( $name, 0, 1 ); } } //Display the grid echo '<table width="300" height="300" border="1" align="center">'; for ( $row = 1; $row <= 10; $row++ ) { echo '<tr>'; for( $col = 1; $col <= 10; $col++ ) { echo '<td width="30" align="center">'; echo ( isset($grid[$row][$col]) ? $grid[$row][$col] : ' ' ); echo '</td>'; } echo '</tr>'; } echo '</table>'; ?> <?php } else{ ?> When play begins, The Computer secretly arranges Her ships on Her primary grid. <BR /> Each ship occupies a number of consecutive squares on the grid, <BR />arranged either horizontally or vertically. <BR /> <BR /> The number of squares for each ship is determined by the type of the ship. <BR /> The ships cannot overlap (i.e., only one ship can occupy any given square in the grid). <BR /> In each round, the Human clicks the target square which is to be shot at. <BR /> The Computer announces whether or not the square is occupied by a ship, <BR /> and if it is a "hit" they mark this on their own primary grid. <BR /> The attacking player notes the hit or miss on their own "tracking" grid, in order to build up a picture of the opponent's fleet. <BR /> When all of the squares of a ship have been hit, the ship is sunk, <BR /> and the ship's owner announces this (e.g. "You sunk my battleship!"). <BR /> If all of a player's ships have been sunk, the game is over and their opponent wins. <form method="post" action="" name="choice"> <input name="start_game" id="start_game" value="Start Game" type="submit" src="game.png" name="image" width="100" height="150"><br> </form> <?php } ?> <p id="footer">Copyright © 2013 DeAnna Riddlespur & Gene Lau & Matthew Semple</p> </body> </html>
-
Something fun to kill time with (or w/e lol) http://phoboslab.org/ztype/ Notice: This is not mine, nor am i affiliated with the creator in any way.
-
I am new to php & have just tried to make a number guessing game using session. there is some problem in this code please help me !!! <?php session_start(); $count=0; if (isset ($_SESSION['counter'])) $count=$_SESSION['counter']; $count++; $a=rand(1,100); if (isset ($_SESSION['hide'])) $a=$_SESSION['hide']; if (isset ($_POST['number'])){ $ans=$_POST['number']; } else { $ans=-1; } if ($a==$ans){ echo " ","Your answer is correct !! Attempt= ", $count;}else { //var_dump($count); if ($count<4) { if (isset ($_POST['number'])){ echo $_POST['number']; if ($a<$ans){ echo " ","Your answer is greater.";} if ($a>$ans){ echo " ","Your answer is less.";} }}else { echo " ","<h4>Game Over !!</h4> The Correct Answer is ", $a;} } $_SESSION["counter"]=$count; $_SESSION["hide"]=$a; $_SESSION['counter']=''; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%22>"]http://www.w3.org/TR...nsitional.dtd">[/url] <html xmlns="[url="http://www.w3.org/1999/xhtml%22>"]http://www.w3.org/1999/xhtml">[/url] <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Function</title> </head> <body> <form method="post"> <label> Guess Any Number (1 to 100) </label> <br /> <input type="text" name="number" value="<?php if (isset ($_POST['number'])) echo $ans; ?>" /> <br /><br /> <input type="submit" value="submit" name="submit" /> <br /> </form> <br /><br /> </body> </html>
- 1 reply
-
- php
- number guess
-
(and 3 more)
Tagged with:
-
Hello freaks im new here and me and a bud of mine are trying to make a plugin for his site, im not going to post the link because im not sure if ill get in trouble for advertising, but what we are trying to do is.. Make a section of his website able to play games (Swf's) Through a proxy system called glype and what we want is like youtube kinda. if you run youtube through a proxy, it will allow youtube videos to play through a different player called (FLV Player) And what we are trying to do is link games from the website to allow it to play in a seperate player while at school. because school blocks the armoredgames.com so we need to find a way to play it through a proxy. any help? thanks guys
-
I have been working on a PHP guess number game. The version where the person has to guess is finished and works fine, the code is below. What I need to do is convert the code so that the computer guesses the number. I know the basic concept that i need to go about it but need help coding it from the other perspective. If anybody has suggestions of how to go about it that would be much appreciated. <?php $guess=$_POST["guess"]; $counter=$_POST["counter"]; $number=$_POST["number"]; if(empty($number)){ echo "<h4>Welcome! I have a number between 1 and 100. Please guess it.<h4>\n"; $number=rand(1,100); $counter=0; } else { if($number==$guess){ $counter++; echo "<h4>Well done! You guessed $number in $counter steps.<h4>\n"; } if($guess<$number){ $counter++; echo "<h4>Too low. Guess a higher number<h4>\n"; } if($guess>$number){ $counter++; echo "<h4>Too high. Guess a lower number<h4>\n"; } } echo <<<HERE <form method="post" action="guessNum.php"> <input type = "hidden" name = "number" value = "$number"> <input type = "hidden" name = "counter" value = "$counter"> <input type = "text" name = "guess" value = ""> <input type="submit" value="Guess"> </form> HERE; ?>