Jump to content

File Loop thing


Michael_Tanner

Recommended Posts

I'm currently trying to script something that requires me to script in PHP, of which I'm brand new to. I'm trying to make it read a specific file (that contains a number of course), and it loops through that number. I have files that should be labeled accordingly through each loop. So, if the number in the first file is '127', it loops 127 times and opens all .txt files between 1 and 127, though I can't get it to work.

 

Here's the code:

<html>
<head>
<title>Reloaded Gaming - IG Forum</title>
</head>

<body>
<?php
$handle = fopen("forumcount.txt", "r");
$filename = fread($handle, filesize("forumcount.txt"));
$i = 1;
while ( $i < $filename )
{
$fi = '$i.txt';
<a link type="text" href="$fi" />Post $fi</a>
$i++;
}
?>

</body>
</html>

 

Halpz plx.  ;D

Link to comment
https://forums.phpfreaks.com/topic/161138-file-loop-thing/
Share on other sites

Because I am dedicated and determined to be an outstanding pillar of this community, I have scoured the internet for a way for us to talk.

 

http://www.moushigo.com/index.php/the-loler-project/

 

Ahem:

 

I HAEV NO IEDA WUT U R SAYNG!1!111!1 OMG LOL SPAAK 3NGLISH LIEK A NURMAL HUMAN BNG THAN W3L TOK

Link to comment
https://forums.phpfreaks.com/topic/161138-file-loop-thing/#findComment-850333
Share on other sites

Because I am dedicated and determined to be an outstanding pillar of this community, I have scoured the internet for a way for us to talk.

 

http://www.moushigo.com/index.php/the-loler-project/

 

Ahem:

 

I HAEV NO IEDA WUT U R SAYNG!1!111!1 OMG LOL SPAAK 3NGLISH LIEK A NURMAL HUMAN BNG THAN W3L TOK

Thanks for the help.

 

Could anyone else give me a solid answer?

Link to comment
https://forums.phpfreaks.com/topic/161138-file-loop-thing/#findComment-850335
Share on other sites

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.