Solved

php warnings and notices

Posted on 2012-04-09
6
308 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

747 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

12 Experts available now in Live!

Get 1:1 Help Now