Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Loganathan NatarajanLAMP DeveloperCommented:
0
 
genius_geekAuthor Commented:
thanks mate. it works.
0
 
Loganathan NatarajanLAMP DeveloperCommented:
glad to help, tks
0

Featured Post

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.

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