Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-21-2008, 11:53 AM
fimmy fimmy is offline
Newbie
 
Join Date: Apr 2008
Posts: 3
Rep Power: 0
fimmy is on a distinguished road
Default PHP counter

Pls could some1 tell me what wrong with this code

Thanks
PHP Code:
    <?php
    
      
echo '<div id="date">' date("d/m/Y") . '</div>';
$filename"counterlog2.txt" ;
$fd fopen ($filename "r") or die ("Can't open $filename") ;
$fstring fread ($fd filesize ($filename)) ;
echo 
'<div id="counter">Visits: ' "$fstring" '</div>';
fclose($fd) ;

$fd fopen ($filename "w") or die ("Can't open $filename") ;
$fcounted $fstring ;
$foutfwrite ($fd $fcounted ) ;
fclose($fd) ;
  
?>

Last edited by John; 04-21-2008 at 12:32 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 04-21-2008, 12:32 PM
John's Avatar   
John John is online now
Co-Administrator
 
Join Date: Jul 2006
Age: 19
Posts: 2,737
Last Blog:
Passwords
Rep Power: 20
John has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud of
Send a message via AIM to John
Default Re: PHP counter

Simple counter
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-21-2008, 02:25 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 5,321
Last Blog:
Web slideshow in JavaS...
Rep Power: 45
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: PHP counter

Well that solved it quickly...
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-22-2008, 05:58 AM
fimmy fimmy is offline
Newbie
 
Join Date: Apr 2008
Posts: 3
Rep Power: 0
fimmy is on a distinguished road
Thumbs up Re: PHP counter

Thanks so much was very helpfull
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-26-2008, 09:36 AM
ggggqqqqihc ggggqqqqihc is offline
Newbie
 
Join Date: Apr 2008
Posts: 9
Rep Power: 0
ggggqqqqihc is on a distinguished road
Default Re: PHP counter

There is a problem when many users visit this page at the same time. The simple method is using database.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 04-27-2008, 05:15 AM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 5,321
Last Blog:
Web slideshow in JavaS...
Rep Power: 45
Xav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to beholdXav is a splendid one to behold
Send a message via MSN to Xav
Default Re: PHP counter

Yes, but that's not as simple.
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 5 and OOP Jordan PHP Tutorials 10 08-22-2008 05:37 AM
PHP 4 end of life announcement Jordan Programming News 4 08-30-2007 09:55 AM
Counter in PHP dirkfirst PHP Forum 3 08-10-2006 07:28 PM


All times are GMT -5. The time now is 07:50 PM.

Contest Stats

GoogleKeyw ........ 20.00000

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 67%

Ads