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, 12:53 PM
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 01: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, 01:32 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN 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, 03:25 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,583
Last Blog:
Web slideshow in JavaS...
Rep Power: 76
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: PHP counter

Well that solved it quickly...
__________________


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, 06: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, 10: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, 06:15 AM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,583
Last Blog:
Web slideshow in JavaS...
Rep Power: 76
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: PHP counter

Yes, but that's not as simple.
__________________


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
Forum Jump

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


All times are GMT -5. The time now is 06:40 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads