Hi,
okay i was bored and was tryign to make a matrix like thing, with green text and marquees and used PHP for() loops abd stuff and random number generators..
but whenever i run it on local system everything crashes  internet explorer's memory usage goes to unbelivavble amounts (INTO GB!!!!) eventually stops responding and everything just crashes.
the script:
PHP Code:
<?php /* ******************************** Random String Generator - used for forgot password script. ***********************************/ function assign_rand_value($num) { // accepts 1 - 36 switch($num) { case "1": $rand_value = "0"; break; case "2": $rand_value = "1"; break; case "3": $rand_value = "2"; break; case "4": $rand_value = "3"; break; case "5": $rand_value = "4"; break; case "6": $rand_value = "5"; break; case "7": $rand_value = "6"; break; case "8": $rand_value = "7"; break; case "9": $rand_value = "8"; break; case "10": $rand_value = "9"; break; case "11": $rand_value = "10"; break; case "12": $rand_value = "11"; break; case "13": $rand_value = "12"; break; case "14": $rand_value = "13"; break; case "15": $rand_value = "14"; break; case "16": $rand_value = "15"; break; case "17": $rand_value = "16"; break; case "18": $rand_value = "17"; break; case "19": $rand_value = "18"; break; case "20": $rand_value = "19"; break; } return $rand_value; } /** Make String **/ function get_rand_string($length) { if($length>0) { $rand_id=""; for($i=1; $i<=$length; $i++) { mt_srand((double)microtime() * 1000000); $num = mt_rand(1,20); $rand_id .= assign_rand_value($num); } } return $rand_id; } function is_even($num){ return ($num%2) ? TRUE : FALSE; } echo '<html> <head> <style type="text/css"> body { background: #000; margin: 0px; padding: 0px; } </style> </head> <body>'; for($i = 0; $i < 105; $i++) { $speed = get_rand_string(1); $height= get_rand_string(2); $no_chars = get_rand_string(1); for($y = 0; $y < $no_chars; $y++) { $char = get_rand_string(1); $brs = get_rand_string(1); if($brs > 4) { $brs = round($brs/4); for($x = 0; $x < $brs; $x++) { $br .= '<br />'; } $chars .= $char.$br; } if($height > 250) { $height = ($height/4)*2; } echo '<marquee direction="'; if(is_even($char+$speed+$height)) { echo 'up'; } else { echo 'down" style=" vertical-align: top;'; } echo '" style="color:#00CC00; background:#000000; margin:0px; padding:0px; float: left" width="10px" height="'.$height.'px" behavior="scroll" hspace="0" scrollamount="'.$speed.'">'.$chars.'</marquee>'."\n"; #echo '<span style="color:#fff">'.$height.'</span>'; } echo '<br />'; }
echo '</body> </html>'; ?>
__________________
Discounted Web Hosting With XDnet! >> Get 25% of hosting~ Promo: Webmaster-talk <<
|