dprayer Posted June 9, 2006 Share Posted June 9, 2006 Hi allI cant get a grab part of my website to work.. Basically, when you go to this part of the site you can press the grab button and you take over the object which you have pressed grab on.This part of the script is the grab part for an airport :elseif ($grab == "Airport"){$check = mysql_query("SELECT * FROM airport WHERE owner= '0' AND location='$fetch->location'");$num_rows = mysql_num_rows($check);if ($num_rows != "0"){if ($fetch->location == $location){mysql_query("UPDATE airport SET owner='$username', profit='0-0-0-0-0-0' WHERE location='$fetch->location'");echo "You got the Airport!";}}}Here is the php script for that partof the site wich includes the grab:<?php if ($airport->owner == ""){ echo "No owner-<a href='?grab=airport&location=$locations[$i]'>Grab it </a>"; }else{ echo "<a href='profile.php?viewuser=$airport->owner'>$airport->owner</a>"; } ?>Thanks if you can help me out in any way Quote Link to comment https://forums.phpfreaks.com/topic/11566-help/ Share on other sites More sharing options...
joquius Posted June 9, 2006 Share Posted June 9, 2006 Hi, new, but not new to php just looking for something to do at work in free time when my strength for coding has run out.Are $grab and $location actually defined here as $HTTP_GET_VARS ?if (isset ($_GET['grab'])) $grab = $_GET['grab'];same for location.In any case you should clean up the code a bit maybe cut out some excess variables and add some spaces it's slightly unclear Quote Link to comment https://forums.phpfreaks.com/topic/11566-help/#findComment-43571 Share on other sites More sharing options...
dprayer Posted June 9, 2006 Author Share Posted June 9, 2006 [!--quoteo(post=381783:date=Jun 9 2006, 11:08 AM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 9 2006, 11:08 AM) [snapback]381783[/snapback][/div][div class=\'quotemain\'][!--quotec--]Hi, new, but not new to php just looking for something to do at work in free time when my strength for coding has run out.Are $grab and $location actually defined here as $HTTP_GET_VARS ?if (isset ($_GET['grab'])) $grab = $_GET['grab'];same for location.In any case you should clean up the code a bit maybe cut out some excess variables and add some spaces it's slightly unclear[/quote]he he.. i can imagine me trying to clean it up.. Im not great with php and scripts.. i know ill end updeleting bits and it wont work again..lolIf you have MSN add me please : rayer_gangland@hotmail.co.ukThanks Quote Link to comment https://forums.phpfreaks.com/topic/11566-help/#findComment-43574 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.