Jump to content

Wo0tHigh

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Wo0tHigh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Im sure there is a PHP function which returns which line it is on, but I cant find it, wonder if you guys knew what it was (if it exists) thanks in advance! Dan
  2. Ok so! in a file called "thing1.php" I have the following... <?php $thing1['name']="Dave"; ?> Then in another page I have this... $num='1'; while($num<'2'){ include_once'things/thing'.$num.'.php'; echo'$thing$num[name]<br />';//HERE $num++; } As you can see from the above, where it says HERE, this is where the problem is! I need to display $thing1[name], 1 being retrevied from a variable. Any ideas how? Thank you very much! Dan
  3. Hey, sorry the function is ment to be in_array not the one I posted ( I was trying something and forgot the edit ) and array_key_exists worked like a charm!!! Thank you very much guys
  4. Below is a multi level array, 0,1,2 is basically a unique id for each question, and below basically validates a correct input, but i cant get it to work!!!! $array=array("0" => array("0" => "Question 1", "1" => array("0" => "Win 1", "1" => "Win 2", "2" => "Win 3", "3" => "Win 4"), "2" => array("0" => "Loose 1", "1" => "Loose 2", "2" => "Loose 3", "3" => "Loose 4")), "1" => array("0" => "Question 2", "1" => array("0" => "Win 1", "1" => "Win 2", "2" => "Win 3", "3" => "Win 4"), "2" => array("0" => "Loose 1", "1" => "Loose 2", "2" => "Loose 3", "3" => "Loose 4")), "2" => array("0" => "Question 3", "1" => array("0" => "Win 1", "1" => "Win 2", "2" => "Win 3", "3" => "Win 4"), "2" => array("0" => "Loose 1", "1" => "Loose 2", "2" => "Loose 3", "3" => "Loose 4"))); if(!in_array_multi($_POST['RadioButton'],$crimeresults)){ echo"Invalid Qestion"; }else{ echo"Valid Question"; } $_POST['RadioButton'] is either 0,1 or 2. For some reason, it always displays "Invalid Question", I cant seem to get my head round it, maybe its because ive been staring at it for too long :| any help would be greatly appreciated!! Thanks, Dan
  5. Hey, Thanks very much for your help, the $GLOBALS method worked perfectly!
  6. This is what I tried, <?php $userinfoget=mysql_query("SELECT `sms_credits`,`sms_phone`,`sms_settings` FROM `users` WHERE `username` = '$username'") or die(mysql_error()); $userinfo=mysql_fetch_assoc($userinfoget); $settings=explode(",",$userinfo[sms_settings]); $check='value'; for($num=0; $num<=9; $num++){ $exsettings='$settings['.$num.']'; eval("\$exsettings = \"$exsettings\";"); if($exsettings=='1'){ ${$check.$num}='checked'; }elseif($exsettings=='0'){ ${$check.$num}=''; } } echo"0 = $check0<br>1 = $check1<br>1 = $check2<br>3 = $check3<br>4 = $check4<br>5 = $check5<br>6 = $check6<br>7 = $check7<br>8 = $check8<br>9 = $check9<br>"; ?> It returned this... 0 = 1 = 1 = 3 = 4 = 5 = 6 = 7 = 8 = 9 = Still doesnt work Im sure theres a way of doing this though!
  7. I am also having very similar problems, no idea what to do, any more thoughts anyone?
  8. <?php $playerweapons= mysql_query("SELECT * FROM weapons WHERE owner='$fetch->username'"); $number= mysql_num_rows($playerweapons); if ($number == "0"){ echo "You have no bought weapons!"; exit(); }elseif ($number > "0"){ echo"<select name=weapon style=\"background-color:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;\">"; while ($pw= mysql_fetch_object($playerweapons)){ echo"<option value=\"$pw->name\">$pw->name</option>"; } echo "</select>"; ?> <input type=submit style="background-color:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;" name=equip value="Equip"> <? } ?> You currently have a <? echo "$fetch->weapon"; ?> equipped! <?php if (strip_tags($_POST['weapon']) && strip_tags($_POST['equip'])){ $wep=$_POST['weapon']; $weapon= mysql_query("SELECT * FROM weapons WHERE `name`='$wep' AND `owner`='$username'"); $wepnum= mysql_num_rows($weapon); $wp= mysql_fetch_object($weapon); if ($wep == "0" | $wep == $fetch->weapon){ echo "Either you have this weapon equipped already or you chose an invalid weapon"; exit(); } echo "Changes have succesfully been made! You are now wielding a $wep! "; mysql_query("UPDATE users SET weapon='$wep' WHERE username='$username'"); } ?> Should work
  9. Hello there! I'm trying to make a script that will deal out random cards to X amount of different hands, but to make it so each card only is dealt once and then stored in the database. I'm having problems with making it random, yet unique. If anyone could help me id be grateful Thanks, Dan
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.