fopen() error, need some advice

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
BareKnuckles
Forum Newbie
Posts: 1
Joined: Fri Mar 26, 2004 7:24 am

fopen() error, need some advice

Post by BareKnuckles »

I am new to php and I could use some advice.

I'm running php 4.3.4 and abyss server on a win98 machine.
php is installed correctly as I have tested it using phpinfo().
I get this error when executing a certain script that I wrote...


Warning: fopen(undeliverable email.txt): failed to open stream: No such file or directory in C:\Program Files\Abyss Web Server\htdocs\php\sendmixed.php on line 6

Warning: fread(): supplied argument is not a valid stream resource in C:\Program Files\Abyss Web Server\htdocs\php\sendmixed.php on line 7

These errors are associated with a script that allows users to upload a file to my server and then an email is sent to me. The file above (email.txt) is the file I am trying to upload using the form, so naturally it doesn't already exist in the location specified by the above "fopen" error.

What needs to be done to fix this?

just so you know:
register_globals=on
safemode=off

thanks!
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Please: don't use bold-font on an entire post. Makes me feel uncomfy in my chair, and when I am uncomfy in my chair, I am more likely to spill tea. And if I spill tea, I get upset. And if I get upset, Dr. Evil's cat gets upset. And we all know what happens, when Mr. Biggelsworth gets upset...;)

Apart from that: fopen is a file-function that opens a file and returns a resource-handle. If the file doesn't exist, you can't open it.

Would be helpful if you posted some code

In addition, have a look at http://uk.php.net/features.file-upload
Post Reply