/    Sign up×
Community /Pin to ProfileBookmark

Is it possible….

To use the eregi_replace function to actually change a web page?

Eg.

[code=php]
<?
$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;
}
?>
[/code]

[b]Can I not use fopen? What else can I use?[/b]

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@pyroSep 28.2003 — You can open remote files if [URL=http://us4.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen]allow_url_fopen[/URL] is turned on in the php.ini file.
Copy linkTweet thisAlerts:
@mg8authorSep 29.2003 — How do I turn that on?
Copy linkTweet thisAlerts:
@pyroSep 29.2003 — 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
×

Success!

Help @mg8 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...