Wednesday 21 August 2019

php - warning: division by zero




I am using the following static method for sending mail alerts, but its throwing an error: warning:division by zero ...



Postman::MailAlert($_POST['email'],'Hello '.$_POST['name'].', Thanks for signing up.Your customer id is '.$_POST['city']/'/'.$product_id.'.');


I have solved this issue by putting @, but why is this issue raised, and what am I doing wrong?


Answer



Just the problem part:




$_POST['city']/'/'.$product_id.'.');


Need to change like this.



$_POST['city'] . '/'.$product_id.'.');

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...