Jump to content

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

I was all excited about helping you out until I got to

 

Halpz plx.  ;D

Orly, and why's that? Brb editing.

 

Because I only understand English.  So I have no idea what you're asking.

Je ne parle pas anglais.

What I was asking is: "Could someone help me out?"

Link to comment
https://forums.phpfreaks.com/topic/161138-file-loop-thing/#findComment-850329
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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.