Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 02-13-2006, 12:06 PM   #1
Baseband Member
 
hatedguilt's Avatar
 
Join Date: Feb 2006
Posts: 43
Send a message via AIM to hatedguilt Send a message via Yahoo to hatedguilt
Default Fun EZ thing to do when your bored

Fun things to do when your bored, just start making really ez random php scripts then see how many hits you can get
PHP Code:
<?php
$a 
rand(0500);
$b rand(04000);
echo 
"You have $a bloobies and $b poopies";
echo 
"<br>You have surrious probs bro<br><br>This many people visited the page<br>";
include 
'counter.php';
?>
sounds fun doesnt it
my ez fun page
__________________

__________________
JustEatAtFatJoes
hatedguilt is offline   Reply With Quote
Old 02-13-2006, 07:54 PM   #2
Solid State Member
 
Crath's Avatar
 
Join Date: Feb 2006
Posts: 15
Default Re: Fun EZ thing to do when your bored

howbout you post counter.php also, something we can acutally use!
__________________

Crath is offline   Reply With Quote
Old 02-13-2006, 08:11 PM   #3
Baseband Member
 
hatedguilt's Avatar
 
Join Date: Feb 2006
Posts: 43
Send a message via AIM to hatedguilt Send a message via Yahoo to hatedguilt
Default Re: Fun EZ thing to do when your bored

PHP Code:
<?php 
    
// Change this if you rename your counter.txt file 
    
$counter_file "counter.txt"
     
    
// Get the contents of the current counter file 
    
if($f = @fopen($counter_file"r")) 
    { 
        @
$contents fread($f, @filesize($counter_file)); 

        @
fclose($f); 
    } 
     
     
     
    
// File is empty 
    
if($contents == ""
    { 
        
$contents 0
    } 
     
    
// File contents is not a number 
    
if(!is_numeric($contents)) 
    { 
        print 
"Counter contents is not a number."
        
define('ERROR'1); 
    } 
     
     
     
    
// Bump the count 
    
if(ERROR <> 1
    { 
        
$contents++; 
         
        
// Add contents back to file 
        
if($f = @fopen($counter_file"w")) 
        { 
            @
fwrite($f$contents); 
            @
fclose($f); 
        } 
     
        
// Print the contents 
        
print $contents
    } 

?>
__________________
JustEatAtFatJoes
hatedguilt is offline   Reply With Quote
Old 02-13-2006, 08:11 PM   #4
Baseband Member
 
hatedguilt's Avatar
 
Join Date: Feb 2006
Posts: 43
Send a message via AIM to hatedguilt Send a message via Yahoo to hatedguilt
Default Re: Fun EZ thing to do when your bored

you also have to create a counter.txt
__________________
JustEatAtFatJoes
hatedguilt is offline   Reply With Quote
Old 02-14-2006, 08:48 AM   #5
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: Fun EZ thing to do when your bored

the file will create a text fie counter.txt when it's first run, so there is no real need to manually create it.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 02-14-2006, 10:27 AM   #6
Baseband Member
 
hatedguilt's Avatar
 
Join Date: Feb 2006
Posts: 43
Send a message via AIM to hatedguilt Send a message via Yahoo to hatedguilt
Default Re: Fun EZ thing to do when your bored

ya welll... its ezier to just create it <--> do u wanna know why <-->
sumtimes it feels good to just do something manually
__________________

__________________
JustEatAtFatJoes
hatedguilt is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 06:55 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0