Jump to content

Please Help - PHP Variables and HTML


Jude

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.