472,958 Members | 2,297 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

error_reporting (E_ALL);

I've been experimenting with using:

error_reporting (E_ALL);

However, lines like this report problems when the variable is missing:

$open = $_GET['open'];

Is there some way to do that with error reporting left turned on -
that *doesn't* give a warning?
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #1
6 21190
[Fri, 21 Nov 2003 14:22:34 GMT] Tim Tyler <ti*@tt1lock.org> wrote:
error_reporting (E_ALL);

However, lines like this report problems when the variable is missing:
$open = $_GET['open'];

Is there some way to do that with error reporting left turned on -
that *doesn't* give a warning?


Do you have register_globals turned off?

What warning exactly was it? Or was it a notice?

Jul 17 '05 #2
Tim Tyler wrote:

I've been experimenting with using:

error_reporting (E_ALL);

However, lines like this report problems when the variable is missing:

$open = $_GET['open'];

Is there some way to do that with error reporting left turned on -
that *doesn't* give a warning?
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.


This will give you all error reports EXCEPT notices (which is what I get with an
undeclared variable).

error_reporting (E_ALL ^ E_NOTICE);

For more info, check out the following URL. You can just turn on specific
warning types by using the "|" to seperate them.

http://ca.php.net/manual/en/function...-reporting.php

Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #3

On 21-Nov-2003, Tim Tyler <ti*@tt1lock.org> wrote:
I've been experimenting with using:

error_reporting (E_ALL);

However, lines like this report problems when the variable is missing:

$open = $_GET['open'];

Is there some way to do that with error reporting left turned on -
that *doesn't* give a warning?
-


if (isset($_GET['open']))
$open = $_GET['open'];
else
$open = NULL;

or

$open = (isset($_GET['open'])) ? $_GET['open'] : NULL;

--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to ja*********@willglen.net (it's reserved for spammers)
Jul 17 '05 #4
Tim Tyler wrote:
I've been experimenting with using:

error_reporting (E_ALL);

However, lines like this report problems when the variable is missing:

$open = $_GET['open'];

Is there some way to do that with error reporting left turned on -
that *doesn't* give a warning?


<?php
if (isset($_GET['open'] && (int)$_GET['open']>0)
// don't let users put anything but integers in $open !
$open = (int)$_GET['open'];
else
$open = 0; // 0 means bad input
?>

--
..sig
Jul 17 '05 #5
On Fri, 21 Nov 2003 14:22:34 GMT, Tim Tyler <ti*@tt1lock.org> wrote:
I've been experimenting with using:

error_reporting (E_ALL);

However, lines like this report problems when the variable is missing:

$open = $_GET['open'];

Is there some way to do that with error reporting left turned on -
that *doesn't* give a warning?


As well as the checks with isset posted by others, there's:

$open = @$_GET['open'];

But only if NULL is an acceptable value for you to use.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #6
Andy Hassall <an**@andyh.co.uk> wrote or quoted:
On Fri, 21 Nov 2003 14:22:34 GMT, Tim Tyler <ti*@tt1lock.org> wrote:

I've been experimenting with using:

error_reporting (E_ALL);

However, lines like this report problems when the variable is missing:

$open = $_GET['open'];

Is there some way to do that with error reporting left turned on -
that *doesn't* give a warning?


As well as the checks with isset posted by others, there's:

$open = @$_GET['open'];

But only if NULL is an acceptable value for you to use.


I guess if the syntax sugar is there anyway, you might as well use it.

Thanks very much to those who responded - it's appreciated.
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: matty | last post by:
Just a couple of quick comments: In some of the CSS/DOM mailing lists I'm on, people generally refuse to help unless the HTML and CSS will validate. You can check these at...
1
by: Pedro Fonseca | last post by:
Greetings everyone! I'm porting my applications to PHP5 and I've stumbled on yet another problem. I'll try to simplify things a bit. I have a main script that is being executed (index.php, PHP5...
11
by: varois83 | last post by:
Hi I am in the process of creating a guestbook for my site, I am a newbie and used several tutorials and customized them to what I need using the little knowledge I got. I get the following...
9
by: comp.lang.php | last post by:
I am having problems tracing errors in my code using PHP 4.3.9 on Linux RHEL 4 with Apache 2.0.54 On occasions I see no errors, no parse, no fatal, no warnings, no notices.. and no code either!...
5
by: comp.lang.php | last post by:
I have a PHP script that has only one line: <?php error_reporting(E_ALL & ~E_NOTICE); ?> When run as CLI PHP I get an extremely large number of warnings, errors and notices, all related to the...
2
by: comp.lang.php | last post by:
I am trying to debug an error found somewhere within my suite of scripts. Nothing shows up when there's an error, it just simply dies. I tried using error_reporting(E_ALL); to no avail. I tried...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
2
by: mrbog | last post by:
Here's my code: <?php error_reporting(E_ALL); ini_set("display_startup_errors","1"); ini_set("display_errors","1"); wefw wefwef=wefwe
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.