How to show php errors on my custom page ?

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : How to show php errors on my custom page ?

Re: How to show php errors on my custom page ?

par Agent5acad27 » 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

How to show php errors on my custom page ?

par jaijai007 » 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
  }
?>
--------