Log in

View Full Version : PHP Not Loading TXT File That Has A Single Digit Number



M2com
08-28-2011, 12:48 AM
For some reason when PHP tries to read a TXT file that has a single digit in it (like 1), it won't read it. The page will just sit there loading for like ten minutes and when it's "done" the whole page isn't fully loaded.

Is there a way to fix this? I've tried reading the TXT file and checking if it's a single digit and displaying the number from the TXT file with a zero in front but that doesn't work either.

Thanks in advanced!

- M2com

xtiano77
08-28-2011, 02:03 AM
Can you post the code?

M2com
08-28-2011, 02:17 AM
Here is the code:

<?php $file1=$_SESSION['username'] . '/file.txt';
if (file_exists($file1))
{
$file = fopen($file1, "r");
while (!feof($file))
{
$display = fgets($file, filesize($file1));
echo $display . "
";
}
fclose($file);
}
else
{
echo "File could not be opened. Please report this to the admin.";
}
?>

bluewalrus
08-28-2011, 02:24 AM
Are you using PHP 5 or a lower version?

M2com
08-28-2011, 02:27 AM
I am using a lower version. I'm not sure which though.

djr33
08-28-2011, 02:59 AM
<?php phpinfo(); ?>

Easy to find out.

M2com
08-28-2011, 05:04 AM
The version I'm using is v4.4.4. If I need the latest version, how do I install it? I have downloaded the current one but how to I finally install it?

Thanks!

JShor
08-28-2011, 02:16 PM
http://php.net/downloads.php

bluewalrus
08-28-2011, 03:21 PM
He has it downloaded so just need http://php.net/manual/en/install.php

M2com
08-28-2011, 07:03 PM
I'm still not getting how to install PHP 5. All the instructions I've looked at are either installing it on your own web server (like localhost or something) or something totally different....

Thanks for your help already!

james438
08-28-2011, 07:09 PM
backing up just a sec. Is php loaded onto your computer and you are running a website off of your desktop or is your website being hosted by another server somewhere like godaddy.com or whatnot?