Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by ignace

  1. Hey Problem Number 1: I happen to use sometimes the name of functions that already exists like count(), isset(), but change them into Count(), and IsSet() now when I do this I get the problem that the parser tells me that I can not redeclare these functions, does somebody know how I can make functions case sensitive, My server is running on windows, so yes that is my first problem... :d Problem Number 2: If anybody of you is experienced in security, then please feel free to share your information with me! Or even just tell me things where I need to pay attention to! Because I know that private and public just don't do the trick... P.S.: English is not my native language, but you already knew that?
  2. DROPDOWN FORM [code] $form = '<select name="option" onChange="window.location.href=\'file.php?option=\'+this.options[this.selectedIndex].value;"> <option value="0">Speed</option> <option value="1">Power</option> <option value="2">Dexterity</option> </select>'; [/code] BACK TO YOUR PHP [code] $option = trim( strip_tags( $_REQUEST['option'] )); switch( $option ){   case 0:     ....     if( $fatique < 2 ){       print( 'you do not have enough fatique to do this.' );//leave the die(); command out or use die( 'you do not..' );     }     ....   break;   case 1:     ...     power it up     ...   break;   case 2:     ...     dextergy WRAAAAWWWW     ...   break;   default:     print( $form );   break; } $rand=rand(1,7); $rand=$rand/10; $update=$speed+$rand; $update2=$fatigue-2; $sql2="UPDATE players SET speed='$update', fatigue='$update2' WHERE user='$user'"; if(mysql_query($sql2)) [/code]
  3. html has something really sweet for that called img :) if u put in this: <img src="upload8647987448.jpg" name="size1" width="32" height="32"> <img src="upload8647987448.jpg" name="size2" width="64" height="64"> <img src="upload8647987448.jpg" name="size3" width="128" height="128"> then when you right click on this photo and click save target as... the picture will be 32,32 or 64,64 or 128,128 i do not recommend to enlarge a photo from it original size through <img> how would you feel if they stretched you? (blurred?) ofcourse the smaller a large photo is resized the better it will look :)
  4. 'headers already sent' -> one solution remove all output before calling session_start(); (also do not put session_start(); on top of every page, this is not recommended!) or use ob_start(); $buffer = ob_get_contents(); ob_end_flush(); and only call session_start(); whenever you need some session variables do not forget to use session_close(); after. You can also put all session variables in the global scope ($GLOBALS) however again do this only when you have a script like: $protects = array('_REQUEST', '_GET', '_POST', '_COOKIE', '_FILES', '_SERVER', '_ENV', 'GLOBALS', '_SESSION'); foreach ($protects as $protect) { if ( in_array($protect , array_keys($_REQUEST)) || in_array($protect , array_keys($_GET)) || in_array($protect , array_keys($_POST)) || in_array($protect , array_keys($_COOKIE)) || in_array($protect , array_keys($_FILES))) { die("Invalid Request."); } } to protect what is inside your global scope. Kinda will solve your first problem... problem2: 'gilman69_poker' is not recognized as a host -> check your configuration... (normally this would be localhost) I said normally... classes and templates... really gets rid of all the fuss :)
  5. function getRank( $start, $stop ){ global $dbResource; // <- output from mysql_connect( bla... ); $arr = array(); for( $curRank = $start; $start<$stop; $curRank++ ){ $query = "SELECT count( `rank` ) as `userRank` FROM `users` WHERE rank='.$curRank.'"; $resource = mysql_query( $query, $dbResource ); while( false !== ( $userRank = mysql_fetch_array( $resource ))){ $arr[$curRank] = $userRank; } } asort( $arr ); return $arr; } $rankings = getRank( 0, 8 ); if( is_array( $rankings )){ for( $i=0; $i < count( $rankings ); $i++ ){ print(' ...data.comes.here...'.$rankings[$i].'...and.so.on... '); } }
  • 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.