Home >Backend Development >PHP Problem >What to do if something goes wrong with php get
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.
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!