Younger brother Novice:
$FP =fopen ("./readme.txt", "R") or Die ("Cannot open the file");
Want to ask, if open failure, then die of this message output to where AH? Seemingly open the failed interface does not directly pop up this message? Will the use of die this message is automatically sent from the server to the terminal, and then popped up in the interface?
Reply to discussion (solution)
Direct output to Browser
Direct output to Browser
But I opened the failure, the browser did not output this message ah, is it covered by the other?
So, what do you see?
So, what do you see?
Page Not responding
$fp = fopen ("./readme.txt", "R") or Die ("Cannot open the file");
If the page doesn't respond
Then there are two possible scenarios:
1. The Readme.txt file exists and can be opened. It's not going to show.
2, Readme.txt does not exist, PHP error display function is not open
This is sad, fopen failure error message: Warning:fopen (./readme.txt): Failed to open stream:no such file or directory in ...
There is nowhere to go, live to suppress PHP to death
Use
echo "..."; exit ();
Die messages are output directly to the browser.
This is the basic question of PHP, okay?
Run the code below to see if you can output 123, and if so, you are fopen that is normal.
Die equals echo xxx and then stops the page.
Direct output to Browser
$fp = fopen ("./readme.txt", "R") or Die ("Cannot open the file");
If the page doesn't respond
Then there are two possible scenarios:
1. The Readme.txt file exists and can be opened. It's not going to show.
2, Readme.txt does not exist, PHP error display function is not open
This is sad, fopen failure error message: Warning:fopen (./readme.txt): Failed to open stream:no such file or directory in ...
There is nowhere to go, live to suppress PHP to death
Is it possible that the die message returned by the server has been accepted by the front-end Ajax, and I have to process it in Ajax to display the message on the front??
Run the code below to see if you can output 123, and if so, you are fopen that is normal.
Die equals echo xxx and then stops the page.
Is it possible that the die message returned by the server has been accepted by the front-end Ajax, and I have to process it in Ajax to display the message on the front??
Ajax?
Let's see how your Ajax is written.
Do not use Ajax, directly with PHP to see if you can. If you can, then?? Can be positioned in the JS section.
$fp = fopen ("./readme.txt", "R") or Die ("Cannot open the file");
If the page doesn't respond
Then there are two possible scenarios:
1. The Readme.txt file exists and can be opened. It's not going to show.
2, Readme.txt does not exist, PHP error display function is not open
This is sad, fopen failure error message: Warning:fopen (./readme.txt): Failed to open stream:no such file or directory in ...
There is nowhere to go, live to suppress PHP to death
The error display function does not open does not affect this display, but turns on the error display, will first display the PHP error message, then is this die out cannot open the file the prompt.
It is generally like this to suppress the error message by adding @ before fopen to avoid the error message that you do not want to see in the environment where the error message is opened.
Do not use Ajax, directly with PHP to see if you can. If you can, then?? Can be positioned in the JS section.
Ajax?
Let's see how your Ajax is written.
With jquery Ajax, it really needs to be accepted by the error in Ajax, the problem has been solved