How to show php errors on my custom page ?

Petit nouveau ! | 1 Messages

08 juil. 2016, 15:26

I am a newbie in PHP field and developing a mail script but it is not working and not showing and error too.
How to check or show the error on custom page if script do not work properly.
----------
<?php
  if (isset($_REQUEST['email']))  {
  
  $admin_email = "[email protected]";
  $email = $_REQUEST['email'];
  $subject = $_REQUEST['subject'];  
  mail($admin_email, "$subject", "From:" . $email);
 
  echo "Message sent";
  }
 
  else  {
?>
 <form method="post">
  Email: <input name="email" type="text" /><br />
  Subject: <input name="subject" type="text" /><br />
  Message:<br />
  <input type="submit" value="Submit" />
  </form>
  
<?php
  }
?>
--------
------------------------------------------------
Server Administrator at HostStud
http://hoststud.com

Eléphanteau du PHP | 43 Messages

09 juil. 2016, 22:55

Puts this at the top of your page in php tags
ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
Otherwise, your mistake , I think, is as follows ( The 've marked) :
<?php
if (isset($_REQUEST['email'])) {

$admin_email = "[email protected]";
$email = $_REQUEST['email'];
$subject = $_REQUEST['subject'];
mail($admin_email, "$subject", "From:" . $email);

echo "Message sent";
}

else { //Remove {
?>
Best regards,
Agent5acad27