Home >Backend Development >PHP Problem >What to do if something goes wrong with php get

What to do if something goes wrong with php get

藏色散人
藏色散人Original
2020-11-17 10:06:483780browse

Solution to php get error: 1. Use the "if(isset($_GET['id'])){}else{}" method; 2. Add "error_reporting(0)" to the first line of php ;" Just remove the error message.

What to do if something goes wrong with php get

Recommended: "PHP Video Tutorial"

php When using $_GET to obtain information is empty, Error reporting solutions

In PHP, when using $_GET, $_SESSION and other methods to obtain information, if the data is empty, an error will be reported. Find solutions online such as

if(isset($_GET['id'])){
}else{
}

But The error message is not removed.

My solution: If there are only such errors, add error_reporting(0); in the first line of php to remove the error message from the browser page.

The above is the detailed content of What to do if something goes wrong with php get. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn