Where's all the news about the die tip?

Source: Internet
Author: User
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
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.