$DOCUMENT _root = $_server[' document_root ');
@ $fp = fopen ("$DOCUMENT _root/. /orders/orders.txt ", ' ab ');
Flock ($FP, LOCK_EX);
if (! $fp) {
echo "
submit failed ";
Exit
}
Always appears on page: Commit failed
Does that mean the file doesn't open?
I use
Echo $fp
Also meters have show anything
Reply to discussion (solution)
Put @ $fp = fopen in front of you, you can see the error message. If not, it may be that the error message has been turned off, to open the errors.
Put @ $fp = fopen in front of you, you can see the error message. If not, it may be that the error message has been turned off, to open the errors.
The great God has removed the error suppressor
and open the PHP error
There's still no hint.
There's just a "commit failure."
"$DOCUMENT _root/. /orders/orders.txt "
File exists?, print out? look.
I found the problem because the PHP built-in variable $_server[' Document_root ' should be written as $_server[document_root]
The two single quotes inside the brackets should not be added
No, the correct wording should be $_server[' document_root '],$_server[document_root]php also recognized, but the performance is not good.
You're sure it's just a change?
There should be a problem with the path to your file.