Re: Command line cannot fwrite, browser can [message #174578 is a reply to message #174576] |
Sat, 18 June 2011 16:08 |
Adrienne Boswell
Messages: 25 Registered: October 2010
Karma:
|
Junior Member |
|
|
Gazing into my crystal ball I observed Jerry Stuckle
<jstucklex(at)attglobal(dot)net> writing in news:iti559$vvt$1(at)dont-email(dot)me:
> On 6/18/2011 4:05 AM, Adrienne Boswell wrote:
>> Gazing into my crystal ball I observed Thomas 'PointedEars' Lahn
>> <PointedEars(at)web(dot)de> writing in
news:8844491(dot)SEqChMirdb(at)PointedEars(dot)de:
>>
>>>> $filename = "groupmail.html";
>>>> $groupmhtml1noname = "groupmail1_noname.txt";
>>>>
>>>> //this above file is the one it cannot find
>>>
>>> (You don't say)
>>
>> Turns out I needed to use a single quote instead of a double quote.
The
>> script is running just fine now.
>>
>>>
>>>>
>>>> $groupmail = fopen( $filename,'w' ) or die( 'cannot open
>>>> groupmail.html' );
>>>
>>> <http://www.phpfreaks.com/blog/or-die-must-die>
>>>
>>
>>
>> Thank you for all your help, and the link. I have read it and will
>> implement it.
>>
>
> I think you have another problem. Single vs. double quotes would not
> make any difference in the code you posted.
>
Originally, I was not using an absolute path, just the name of the file,
and the script was saying the last file was not found, and could not
write to the first file.
Then, I tried using the whole path, and I got a message about an invalid
stream, and I Googled and found a post about single quotes vs double
quotes, tried it, and it worked.
Yes, this is nagging me, too. I just checked it ran it right now (I also
moved the script so it is not accessible to the WWW), and it's doing just
fine. So far so good. I'm letting sleeping dogs lie, for now.
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
|
|
|