...

View Full Version : fopen problem



Ranger56
08-29-2006, 11:12 PM
url:http://spiderseatbabies.com/test/

code:
<?php

$test = fopen("/home/.andre/knightrider/spiderseatbabies.com/test/m.txt", "r");
echo $test;

?>

In the text file it just says "Test" but when I load the page it says "Resource id #1".

Lee Stevens
08-29-2006, 11:18 PM
Thats correct you have opened it but not read the content so you would do:



$file = "main.php";
$file_open = fopen($file, 'r');
$theData = fread($file_open, filesize($file));
echo $theData;


Hope that helps ;)

Ranger56
08-29-2006, 11:19 PM
Thanks!

Lee Stevens
08-29-2006, 11:20 PM
No problem let me no if it works, that off the top of my head.

Ranger56
08-29-2006, 11:23 PM
No problem let me no if it works, that off the top of my head.

It works

Lee Stevens
08-29-2006, 11:24 PM
Chears ;) Hope i can help again soon.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum