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!
I am having a problem with this code, I have just started using PHP yesterday, and I am getting this error when this code is executed (it is run from another page that has the three fields, title, price, and descrip. Everything works fine 'cept the part that writes to a file):
the count start at the top of the php file.
the error on line 13 actually refers to the previous line, which does not end with a semicolon. Each instruction line in PHP must end with a semi-colon, and you have about 3 lines missing those.
take a look at the error messages, they contain the information you need:
failed to open stream: Permission denied in ...
The directory you are trying to open does not have sufficient permissions.
Warning: fwrite(): supplied argument is not a valid stream resource
Since the fopen() call failed, the resulting variable is not a valid stream resource. You should probably add a condition to test if it is a valid resource before proceeding to use fwrite().
You can get more information via the manual - fopen(), fwrite()