Jump to content

fopen problems......


willsavin

Recommended Posts

Hi all,

 

I have been repeatedly getting the same error messages on this

 

<?php

$inputbeforeparse = $_SERVER['PHP_SELF'];

$input = fopen($inputbeforeparse, "r");

$data = preg_match("/<title>[\/\(\)-:<>\w\s]+<\/title>/",$cnt,$input);

$data2 = str_replace("HotWaterSA |", "", $data);

echo $data2;

?>

 

It returns with "Warning: fopen(/testingtesting.php) [function.fopen]: failed to open stream: No such file or directory in /home/corocco/public_html/testingtesting.php on line 21

0"

 

I thought it may be a fopen problem so i tried this

<?php

$inputbeforeparse = $_SERVER['PHP_SELF'];

$input = file_get_contents($inputbeforeparse);

$data = preg_match("/<title>[\/\(\)-:<>\w\s]+<\/title>/",$cnt,$input);

$data2 = str_replace("HotWaterSA |", "", $data);

echo $data2;

?>

but it returned a similar error...

 

Any ideas?

 

Thanks all

Link to comment
https://forums.phpfreaks.com/topic/146228-fopen-problems/
Share on other sites

Thanks for your reply :)

 

I am using the PHP_SELF function so this problem dosen't happen.. The file path is correct, I have double-checked!

 

I am wondering whether this problem is to do with php safe_mode?

I don't know whether or not it is on. Could this be the problem?

 

Thankyou again!

Link to comment
https://forums.phpfreaks.com/topic/146228-fopen-problems/#findComment-767712
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.