473,473 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 21229
[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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.