I have a small issue with an application that i am developing and would like to see if anyone can help
I am looking to display a custom error message on the screen without anything else being shown.
for example in the below function ApplicationFunction if i remove the ; from the code and execute the code nothing is displayed on the page from Application_Output function as there is a php error. This is what im looking for but for all errors i tell it to.
if i re add the ; into ApplicationFunction and remove my connection details or incorrect the wrong password the page executes from the top to the bottom showing the below to the user
Some Text8014379616Some More Text PHP WARNING - theres no password.
how can i get it to not execute anything on the page at all but a custom error message.
class Application {
private $Database_Connection;
function ApplicationFunction() {
return 233424 * 34334;
}
function Application_SQLConnect() {
global $servername,$username,$password,$database;
$conn = new mysqli($servername, $username, $password,$database);
if ($conn->connect_error) {
die($conn->connect_error);
} else {
$this->Database_Connection = $conn;
}
return $this->Database_Connection;
}
function Application_Output() {
echo"Some Text";
echo $this->ApplicationFunction();
echo"Some More Text";
echo $this->Application_SQLConnect();
}
}
$Application = new Application();
$Application->Application_Output();