Click to See Complete Forum and Search --> : Is it possible....


mg8
09-28-2003, 06:04 PM
To use the eregi_replace function to actually change a web page?

Eg.


<?
$fname="http://www.url.com";
$original="something1";
$replace="something2";
$file=fopen($fname,"r");$test=(eregi_replace($original, $replace, $file));
if($test)
{
echo "Works";
}
else{
echo "Error";
end;
}
?>



Can I not use fopen? What else can I use?

pyro
09-28-2003, 06:39 PM
You can open remote files if allow_url_fopen (http://us4.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen) is turned on in the php.ini file.

mg8
09-29-2003, 09:25 AM
How do I turn that on?

pyro
09-29-2003, 09:53 AM
Look for allow_url_fopen in the Fopen wrappers section of the php.ini file and set it to "On". If you don't have access to this file, you'll have to ask you server administrator to enable it.

;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On