bored

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
phpdevuk
Forum Contributor
Posts: 220
Joined: Mon Jul 04, 2005 5:31 am
Location: UK
Contact:

bored

Post by phpdevuk »

got bored so wrote this

Code: Select all

<html>
<head>
<script>
setTimeout(redirect,70);
function redirect(){
	top.location='tables.php';
}
</script>
</head>
<body>
<?php

function rand_string($len, $chars = 'ABCDEF0123456789')
{
    $string = '';
    for ($i = 0; $i < $len; $i++)
    {
        $pos = rand(0, strlen($chars)-1);
        $string .= $chars{$pos};
    }
    return $string;
}



for($i=0;$i<30;$i++){

	$bg_color = rand_string(6);
	
?><table width="100%" cellpadding="5" cellspacing="5" border="5" bordercolor="#<?php echo $bg_color;?>">
	<tr>
<?
$bg_color = rand_string(6);
?>	
		<td bgcolor="#<?php echo $bg_color;?>">
<?php
}

for($i=0;$i<30;$i++){

?></td>
</tr>
</table><?php

}

?>
</body>
</html>
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

that... would be trippy
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Funky 8O My web browser couldn't handle it though so in the end I just had 100% CPU usage and a constantly refreshing white screen ;) Doing it all in JavaScript, avoiding the redirect and just changing colours would work well :)
User avatar
phpdevuk
Forum Contributor
Posts: 220
Joined: Mon Jul 04, 2005 5:31 am
Location: UK
Contact:

Post by phpdevuk »

yeah I did think of doing it all in page with js, but was just a 10 second thing, originally started off to see how many nested tables I could get.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

phpdevuk wrote:originally started off to see how many nested tables I could get.
:lol: You must have been bored. That reminds me of the sort of thing I'd find one of my colleagues sat in a corner doing :lol:
User avatar
phpdevuk
Forum Contributor
Posts: 220
Joined: Mon Jul 04, 2005 5:31 am
Location: UK
Contact:

Post by phpdevuk »

/me looks at corner
Post Reply