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
phpdevuk
Forum Contributor
Posts: 220 Joined: Mon Jul 04, 2005 5:31 am
Location: UK
Contact:
Post
by phpdevuk » Wed Jul 04, 2007 6:18 am
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>
s.dot
Tranquility In Moderation
Posts: 5001 Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana
Post
by s.dot » Wed Jul 04, 2007 6:23 am
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.
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Wed Jul 04, 2007 6:28 am
Funky
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
phpdevuk
Forum Contributor
Posts: 220 Joined: Mon Jul 04, 2005 5:31 am
Location: UK
Contact:
Post
by phpdevuk » Wed Jul 04, 2007 7:07 am
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.
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Wed Jul 04, 2007 7:34 am
phpdevuk wrote: originally started off to see how many nested tables I could get.
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
phpdevuk
Forum Contributor
Posts: 220 Joined: Mon Jul 04, 2005 5:31 am
Location: UK
Contact:
Post
by phpdevuk » Wed Jul 04, 2007 9:28 am
/me looks at corner