I keep getting errors

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
kaizmoto1489
New php-forum User
New php-forum User
Posts: 1
Joined: Tue Jun 08, 2021 6:10 pm

Tue Jun 08, 2021 6:13 pm

I keep getting these errors:

Warning: fopen("mbrsite/",$pname,".html") [function.fopen]: failed to open stream: Invalid argument in C:Servercompile.php on line 7
Warning: fwrite(): supplied argument is not a valid stream resource in c:servercompile.php on line 11

Warning: fwrite(): supplied argument is not a valid stream resource in C:Servercompile.php on line 12

Does anyone have a source document for this error? Thanks in advance !!!
AdoptiveSolution
php-forum GURU
php-forum GURU
Posts: 200
Joined: Wed Jun 15, 2016 8:35 am

Wed Jun 09, 2021 12:28 am

Here’s the manual :

https://www.php.net/manual/en/function.fopen.php

The fopen() function in your code has commas.

Should be :

Code: Select all

fopen("mbrsite/" . $pname . ".html", "w");
The errors in lines 11 and 12 are the result of the error in line 7.
Post Reply