|
|
 |
RE: FN-FORUM: PHP Global in forms
date posted 29th February 2008 12:57
Notices are just that - a notice. If your interested in "good coding =
practices" and ticking all the boxes, then make sure your not getting =
any Notices by checking for the existence of variables with isset();
I like to keep a tidy house - so the notices annoy me enough to check =
variables but, as long as there are no errors you can turn off error =
reporting and all will run fine.
you can control what errors you see with the following:
// Turn off all error reporting
error_reporting(0);
// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);
// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);
Kind regards=20
Brendan Oliver
M:+44(0)7701 054 588
T: +44 (0)1949 21202
E: [EMAIL REMOVED]
E: [EMAIL REMOVED]
14 Main Street
East Bridgford
Nottingham
United Kingdom
Internet E-mail Confidentiality: This E-Mail may contain confidential =
and/or privileged information. It is only intended for the use of the =
addressee indicated in this message. If you are not an intended =
addressee of this email (or responsible for delivery of the message to =
such person), the disclosure, copying or delivering of the contents of =
this email to anyone else is strictly prohibited and may be unlawful. If =
you receive this e-mail by mistake destroy the message and please notify =
us immediately by e-mail. Please advise immediately if you or your =
employer do not consent to Internet E-Mail for messages of this type. =
Information or opinions in this message that do not relate to this =
business shall be treated as neither given or endorsed by it. Please =
note that whilst we try to ensure that messages and attachments are =
virus free, we cannot accept responsibility for situations where this is =
not the case.
=20
-----Original Message-----
From: [EMAIL REMOVED] [EMAIL REMOVED] Behalf Of
PuntersPower
Sent: 29 February 2008 14:07
To: Brendan Oliver
Subject: RE: FN-FORUM: PHP Global in forms
Thanks Brendan, if I read what you are saying it is don't bother?
Andrew
--=20
http://www.punterspower.co.uk
>
> are these "Notices" on your forms? in PHP5 the default error reporting =
=3D
> has changed to encourage better coding practices so now it is E_ALL =
by =3D
> default.
>
> You can stop these notices being shown by adding the following php at =
=3D
> the top of your files
>
> error_reporting(0);
>
> as well as checking for the existence of variables in your scripts =3D
> before assigning values with:
>
> if(isset($_POST['someVar']){
> // assignment here
> }
>
> there are also security risks associated with global variables so =
these =3D
> should be avoided where possible!
>
>
> Kind regards=3D20
>
>
> Brendan Oliver
>
>
> M:+44(0)7701 054 588
> T: +44 (0)1949 21202
> E: [EMAIL REMOVED]
>
>
> 14 Main Street
> East Bridgford
> Nottingham
> United Kingdom
>
> Internet E-mail Confidentiality: This E-Mail may contain confidential =
=3D
> and/or privileged information. It is only intended for the use of the =
=3D
> addressee indicated in this message. If you are not an intended =3D
> addressee of this email (or responsible for delivery of the message to =
=3D
> such person), the disclosure, copying or delivering of the contents of =
=3D
> this email to anyone else is strictly prohibited and may be unlawful. =
If =3D
> you receive this e-mail by mistake destroy the message and please =
notify =3D
> us immediately by e-mail. Please advise immediately if you or your =3D
> employer do not consent to Internet E-Mail for messages of this type. =
=3D
> Information or opinions in this message that do not relate to this =3D
> business shall be treated as neither given or endorsed by it. Please =
=3D
> note that whilst we try to ensure that messages and attachments are =
=3D
> virus free, we cannot accept responsibility for situations where this =
is =3D
> not the case.
>
> =3D20
>
> -----Original Message-----
> From: [EMAIL REMOVED] [EMAIL REMOVED] Behalf Of
> PuntersPower
> Sent: 29 February 2008 13:44
> To: Brendan Oliver
> Subject: FN-FORUM: PHP Global in forms
>
>
>
>
> I have a few small forms that are
>
> 1) using some form of globals-registed for posting data and
> 2) there are lots of undefined variables showing
>
> It's a very simple PHP form I have been using for around 4/5 years =
now,
> and simple mods do the trick for different sites. However, with the
> gloabls_registered issue coming to light I'm wondering whats the =3D
> quickest
> and easiest method to fix this?
>
> As for the undefined variables I have no idea whats going on there!?
>
> Andrew
>
>
>
> --=3D20
> Freelancers, contractors earn more with Prosperity4
> Call 0870 870 4414 or visit www.prosperity4.com
> and benefit from Inland Revenue approved expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
>
> --
> Freelancers, contractors earn more with Prosperity4
> Call 0870 870 4414 or visit www.prosperity4.com
> and benefit from Inland Revenue approved expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
>=20
--=20
Freelancers, contractors earn more with Prosperity4
Call 0870 870 4414 or visit www.prosperity4.com
and benefit from Inland Revenue approved expenses today.
To advertise here: http://www.freelancers.net/advertising.html
|
 |
|