/    Sign up×
Community /Pin to ProfileBookmark

fopen and fwrite question

Here’s my code:

[code=php]if ($site == “over.php”) {
$handle = fopen(“../inhoud/over.php”, “w+”);
fputs($handle, $message); }[/code]

Now, if $site = over.php, it will open the corresponding .php file, and put it back on the server.

My problem is, that the .php file contains HTML, which change like this after using the stated code;

<a href=”http://www.example.com”>Test</a>

Will become

<a href=”http://www.example.com”>Test</a>

Why does it do that?

I’m pretty sure it has something to do with the encoding.

Plz help me ?

Grtz,
SaRs!

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@TJ111Feb 28.2008 — Is magic_quote_gpc enabled?
Copy linkTweet thisAlerts:
@ZnupiFeb 28.2008 — Use stripslashes() on all your $_POST, $_GET and $_COOKIE.
Copy linkTweet thisAlerts:
@Sars_authorFeb 28.2008 — Thanks Znupi, problem solved ?

Grtz,

SaRs!
×

Success!

Help @Sars_ 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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