/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] PHP problem

[code]
$messageformated = “This string is 25 lines long”
$dest = blogdest.html

if (is_writable($dest)) {
if (!$handle = fopen($dest, ‘a’)) {
exit;
}
if (fwrite($handle, $messageformated) === FALSE) {
exit;
/*[B][COLOR=”Red”](((This is line 86)))[/COLOR]*/ [/B]}
fclose($handle);
}
include(“{$dest}”);
[/code]

When I execute this script, I get these warnings:

Warning: main(blogdest.html): failed to open stream: No such file or directory [on my server] on line 86

Warning: main(): Failed opening ‘blogdest.html’ for inclusion [some path] in [the server] on line 86

I don’t know what these mean or how to solve them. What should I do?

It did used to work. I changed something, but I forgot what.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJun 01.2006 — My guess is that the is_writeable() is failing. But to help you debug, you might want to output some error data when you exit:
[code=php]
if (is_writable($dest)) {
if (!$handle = fopen($dest, 'a')) {
die("$dest is not writeable");
}
if (fwrite($handle, $messageformated) === FALSE) {
die("Failed to open file $messageformated for writing");
}
fclose($handle);
}
else
{
die("$dest is not writeable");
}
include $dest;
[/code]
Copy linkTweet thisAlerts:
@shane_carrauthorJun 01.2006 — Thanks NogDog, I found the problem. Don't you hate it when you forget one character in the beginning?
×

Success!

Help @shane_carr 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.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

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