Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

php warnings and notices

How to suppress warnings and notices from displaying while running a php page?

For e.g. mypage.php executes and displays with the following output
o/p line 1: Notice: Undefined index: S_txtpdEndDate1 in C:\Program Files (x86)\FileMaker\FileMaker Server\Web Publishing\web-server-support\test\fmi-test\phpsa\test\tabUI\GetDailyRatev2.php on line 260
o/p line 2: 20

the output should still be shown if the enddate is missing. How do i suppress the warnings from showing up while execution? i just want output line 2 to be shown if enddate is missing.
0
genius_geek
Asked:
genius_geek
  • 5
4 Solutions
 
Loganathan NatarajanLAMP DeveloperCommented:
try,

//error_reporting(E_ALL);  
ini_set('display_errors', 0);
0
 
Loganathan NatarajanLAMP DeveloperCommented:
another way is, if you have php.ini control,

Change your php.ini to not show errors ( display_errors = 0 )
0
 
Loganathan NatarajanLAMP DeveloperCommented:
add below line at top of your php page
<?php

// top of your php page

ini_set( "display_errors", 0);
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Loganathan NatarajanLAMP DeveloperCommented:
0
 
genius_geekAuthor Commented:
thanks mate. it works.
0
 
Loganathan NatarajanLAMP DeveloperCommented:
glad to help, tks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now