Solved

php warnings and notices

Posted on 2012-04-09
6
309 Views
Last Modified: 2012-04-09
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
Comment
Question by:genius_geek
  • 5
6 Comments
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 500 total points
ID: 37822866
try,

//error_reporting(E_ALL);  
ini_set('display_errors', 0);
0
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 500 total points
ID: 37822867
another way is, if you have php.ini control,

Change your php.ini to not show errors ( display_errors = 0 )
0
 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 500 total points
ID: 37822869
add below line at top of your php page
<?php

// top of your php page

ini_set( "display_errors", 0);
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 500 total points
ID: 37822871
0
 

Author Closing Comment

by:genius_geek
ID: 37822918
thanks mate. it works.
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 37822923
glad to help, tks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now