Jude Posted February 14, 2007 Share Posted February 14, 2007 Hello, First off, im a newbie at PHP so please excuse me if i sound like a complete idiot. I have set up a counter on downloadable files on a website. The user clicks on the link, the file opens, and one is added to a number inside a text file on the server. Simple. However now i need to extract the number of hits from the text file, which i can do using the following code: $file = fopen("nameoffile.txt","r"); while (!feof($file)) { $contents = fgets($file)."<br />"; } fclose($file); So i have the number of hits stored in the variable "$contents" but now my problem is that i need it to automatically upload the values into a table at the end of every week, and this table is in an HTML file, which i cannot change to a .php file. Is what i am doing even possible, and if it is how do i do it??? Your help is greatly appreciated. Many thanks Jude Link to comment https://forums.phpfreaks.com/topic/38458-please-help-php-variables-and-html/ Share on other sites More sharing options...
JJohnsenDK Posted February 14, 2007 Share Posted February 14, 2007 You cant put php code in a .html document... Why cant you chance your html file to php? Link to comment https://forums.phpfreaks.com/topic/38458-please-help-php-variables-and-html/#findComment-184512 Share on other sites More sharing options...
Jude Posted February 14, 2007 Author Share Posted February 14, 2007 I can't change it because it is set up on a content management system, and is made up of a template and drags different information from one source if that makes any sense, i cant really put it any other way. but what i could do is redirect the user to a php page containing html for the formatting i suppose. How would i be able to get the page to update every week though with the most recent amount of hits?? I really need it to do this automatically if possible??? Many thanks Jude Link to comment https://forums.phpfreaks.com/topic/38458-please-help-php-variables-and-html/#findComment-184523 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.