Page 2 of 2

Posted: Sun Sep 10, 2006 7:27 am
by danharibo
sorry for Bumping, But i got the script working :) Here it is:

Code: Select all

if(isset($_GET['page']))
{
$page = $_GET['page'];
$page2 = str_replace('..', '', $page);
print($page2);
$fp = fopen($page2, 'r'); // Open Page .txt for reading from beginning
$read = fread($fp, '1000'); // Read from the file pointer
print($read); 
}
else{
$fp = fopen('index.txt', 'r'); // Open Page .txt for reading from beginning
$read = fread($fp, '1000'); // Read from the file pointer
print($read); 
}
Now i have to 'automaticaly' add .txt to the end of it :)

Posted: Sun Sep 10, 2006 7:44 am
by danharibo
Uh oh:
Warning: fopen(0): failed to open stream: No such file or directory in c:\program files\easyphp1-8\www\sufsite\index.php on line 22

Warning: fread(): supplied argument is not a valid stream resource in c:\program files\easyphp1-8\www\sufsite\index.php on line 23

Code: Select all

$temp= $page2 + '.txt';
$page2 = $temp;

Posted: Sun Sep 10, 2006 7:54 am
by danharibo
Nevermind, Fixed