[PHP] Error checking ON

2013-07-17 Thread Tedd Sperling
Hi gang:

Considering:

On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Since you state that you haven't made any changes to the system (in general), 
 I'm going to guess that you modified an 'included' file and it has an error 
 in it, such as an unmatched curly brace.  As Dan said, turn on all error 
 checking and reporting and see what message you get.

This is what I do for error checking:

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', 'error_log');  

Is this:

1. Sufficient?

2. An overkill?

3. OK?

4. OR, better served with this (and provide an example).

Cheers,

tedd

_
t...@sperling.com
http://sperling.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error checking ON

2013-07-17 Thread Daniel Brown
On Wed, Jul 17, 2013 at 11:49 AM, Tedd Sperling t...@sperling.com wrote:
 Hi gang:

 Considering:

 On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Since you state that you haven't made any changes to the system (in 
 general), I'm going to guess that you modified an 'included' file and it has 
 an error in it, such as an unmatched curly brace.  As Dan said, turn on all 
 error checking and reporting and see what message you get.

 This is what I do for error checking:

 ini_set('error_reporting', E_ALL | E_STRICT);
 ini_set('display_errors', 'On');
 ini_set('log_errors', 'On');
 ini_set('error_log', 'error_log');

 Is this:

 1. Sufficient?

 2. An overkill?

 3. OK?

 4. OR, better served with this (and provide an example).

That's standard practice.  Sometimes, though, it isn't enough, and
we find ourselves using Derick's Xdebug, mod_top, or performing an
strace on either the execution or attached to a process.  For nearly
all cases, though, that's sufficient without being overkill (except
for production cases).

--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error checking ON

2013-07-17 Thread Tedd Sperling
On Jul 17, 2013, at 11:55 AM, Daniel Brown danbr...@php.net wrote:
 On Wed, Jul 17, 2013 at 11:49 AM, Tedd Sperling t...@sperling.com wrote:
 This is what I do for error checking:
 
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', 'error_log');
 
 Is this:
 
 1. Sufficient?
 
 2. An overkill?
 
 3. OK?
 
 4. OR, better served with this (and provide an example).
 
That's standard practice.  Sometimes, though, it isn't enough, and
 we find ourselves using Derick's Xdebug, mod_top, or performing an
 strace on either the execution or attached to a process.  For nearly
 all cases, though, that's sufficient without being overkill (except
 for production cases).
 

Daniel:

Thanks -- I always wondered about that.

Cheers,

tedd

PS: Of course, turned OFF for production. :-)

_
t...@sperling.com
http://sperling.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error checking ON

2013-07-17 Thread Jim Lucas

On 07/17/2013 09:28 AM, Tedd Sperling wrote:

On Jul 17, 2013, at 11:55 AM, Daniel Brown danbr...@php.net wrote:

On Wed, Jul 17, 2013 at 11:49 AM, Tedd Sperling t...@sperling.com wrote:

This is what I do for error checking:

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', 'error_log');

Is this:

1. Sufficient?

2. An overkill?

3. OK?

4. OR, better served with this (and provide an example).


That's standard practice.  Sometimes, though, it isn't enough, and
we find ourselves using Derick's Xdebug, mod_top, or performing an
strace on either the execution or attached to a process.  For nearly
all cases, though, that's sufficient without being overkill (except
for production cases).



Daniel:

Thanks -- I always wondered about that.

Cheers,

tedd

PS: Of course, turned OFF for production. :-)

_
t...@sperling.com
http://sperling.com



But...  It won't work in all cases.  I find it best to set these 
settings in the server itself.  Not in code.  Sometimes, if you have 
broken code that cannot be parsed, your commands listed above will never 
be executed.  Therefor they will never do any good.


--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Error connecting with DB

2012-08-27 Thread Rod Lindgren
I need some help. I was cleaning up files on my server yesterday and deleted
some files I should not have. One of my websites,
www.ancientempires-tours.com has a problem with one section. The subdomain
www.egypt.ancientempires-tours.com, is having a problem connecting with the
database. I need some help to fix this. 

Thank you,

Rod Lindgren 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Error connecting with DB

2012-08-27 Thread Rod Lindgren
I agree, but how do I fix it. Everywhere I look, it is pointing to
/home/rodtsd/public_html/Egypt

I decided to uninstall and do a fresh reinstall. This works, but now I have
to find a way to get the old webpage data back on the screen. I can
currently only display the default page and its links. 

Sensei Rod Lindgren 

@KarateClub_us

 

 Rod Lindgren


-Original Message-
From: Volmar Machado [mailto:qi.vol...@gmail.com] 
Sent: Monday, August 27, 2012 3:12 PM
To: r...@okinawa-te.info
Subject: Re: [PHP] Error connecting with DB

In the first image you have softaculous pointing to
[/home/rodtsd/public_html/Egypt/egypt]
So that could be the cause.

2012/8/27 Rod Lindgren r...@okinawa-te.info:ir
 Found logs:

 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist
 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist
 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist
 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist
 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist
 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist
 [Mon Aug 27 16:22:08 2012] [error] [client 109.222.227.210] File does not
 exist: /home/rodtsd/public_html/jordan/404.shtml
 [Mon Aug 27 16:22:08 2012] [error] [client 109.222.227.210] File does not
 exist: /home/rodtsd/public_html/jordan/favicon.ico
 [Mon Aug 27 16:22:08 2012] [error] [client 109.222.227.210] File does not
 exist: /home/rodtsd/public_html/jordan/404.shtml
 [Mon Aug 27 16:22:08 2012] [error] [client 109.222.227.210] File does not
 exist: /home/rodtsd/public_html/jordan/favicon.ico
 [Mon Aug 27 16:21:39 2012] [error] [client 109.222.227.210] File does not
 exist: /home/rodtsd/public_html/ancientempires-tours.com/404.shtml
 [Mon Aug 27 16:21:39 2012] [error] [client 109.222.227.210] File does not
 exist: /home/rodtsd/public_html/ancientempires-tours.com/favicon.ico
 [Mon Aug 27 16:21:38 2012] [error] [client 109.222.227.210] File does not
 exist: /home/rodtsd/public_html/ancientempires-tours.com/404.shtml
 [Mon Aug 27 16:21:38 2012] [error] [client 109.222.227.210] File does not
 exist: /home/rodtsd/public_html/ancientempires-tours.com/favicon.ico
 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist
 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist
 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist
 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist
 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist
 [Mon Aug 27 16:14:04 2012] [error] [client 65.52.110.151] File does not
 exist: /home/rodtsd/public_html/Okinawa-te.info/404.shtml
 [Mon Aug 27 16:14:04 2012] [error] [client 65.52.110.151] File does not
 exist: /home/rodtsd/public_html/Okinawa-te.info/Video.html
 Warning: DocumentRoot [/home/rodtsd/public_html/Egypt/egypt] does not
exist

 Not sure why it is trying to go to /home/rodtsd/public_html/Egypt/egypt.
The
 subdomain is set to /home/rodtsd/public_html/Egypt.

  Rod Lindgren


 -Original Message-
 From: Volmar Machado [mailto:qi.vol...@gmail.com]
 Sent: Monday, August 27, 2012 2:10 PM
 To: r...@okinawa-te.info
 Subject: Re: [PHP] Error connecting with DB

 server logs

 2012/8/27 Rod Lindgren r...@okinawa-te.info:
 I need some help. I was cleaning up files on my server yesterday and
 deleted
 some files I should not have. One of my websites,
 www.ancientempires-tours.com has a problem with one section. The
subdomain
 www.egypt.ancientempires-tours.com, is having a problem connecting with
 the
 database. I need some help to fix this.

 Thank you,

 Rod Lindgren



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

 -
 No virus found in this message.
 Checked by AVG - www.avg.com
 Version: 10.0.1424 / Virus Database: 2437/5227 - Release Date: 08/27/12
 -
 No virus found in this message.
 Checked by AVG - www.avg.com
 Version: 10.0.1424 / Virus Database: 2437/5227 - Release Date: 08/27/12
 -
 No virus found in this message.
 Checked by AVG - www.avg.com
 Version: 10.0.1424 / Virus Database: 2437/5227 - Release Date: 08/27/12
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1424 / Virus Database: 2437/5227 - Release Date: 08/27/12
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1424 / Virus Database: 2437/5227 - Release Date: 08/27/12
-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1424 / Virus Database: 2437/5227 - Release Date: 08/27/12


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: [PHP-WEBMASTER] php error

2012-08-13 Thread Daniel Brown
On Mon, Aug 13, 2012 at 2:32 PM, tomas lagro tomas.la...@hotmail.com wrote:

 Hello, my name is tomas, i'm having a problem and i've checked a lot of times 
 the script and it is not that, because in my local xampp server it works 
 correctly, the issue is that i have a form on my webpage and when you submitt 
 it, the post values are not being requested, so the query array has no values 
 and has no result because of this. Is this a php.ini mistake? what can it be 
 because its driving me crazy. Thanks for ypur time

This email belongs on the PHP General mailing list (CC'd), Tomas,
and you should subscribe to that list at
php-general-subscr...@lists.php.net to follow the discussion and get
help with your questions.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: [PHP-WEBMASTER] php error

2012-08-13 Thread As'ad Djamalilleil
can we see the code of the form ?

On Mon, Aug 13, 2012 at 11:09 AM, Daniel Brown danbr...@php.net wrote:

 On Mon, Aug 13, 2012 at 2:32 PM, tomas lagro tomas.la...@hotmail.com
 wrote:
 
  Hello, my name is tomas, i'm having a problem and i've checked a lot of
 times the script and it is not that, because in my local xampp server it
 works correctly, the issue is that i have a form on my webpage and when you
 submitt it, the post values are not being requested, so the query array has
 no values and has no result because of this. Is this a php.ini mistake?
 what can it be because its driving me crazy. Thanks for ypur time

 This email belongs on the PHP General mailing list (CC'd), Tomas,
 and you should subscribe to that list at
 php-general-subscr...@lists.php.net to follow the discussion and get
 help with your questions.

 --
 /Daniel P. Brown
 Network Infrastructure Manager
 http://www.php.net/

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How do I enable more useful PHP error logging?

2012-02-29 Thread Simon Schick
Hi, Daevid

What you could do to have it quick is to install the plugin xdebug.

Here you can (as described in the documentation linked here) enable to get
some extra information for a E_* message from php.
http://xdebug.org/docs/stack_trace

I would not do that on a live-system where you have 30k v/s without
changing the default configuration as there are several options that would
dramatically slow down the system.
But if you're configuring this properly I think you'll get the best
information without changing the php-code itself.

Bye
Simon

2012/2/29 Tommy Pham tommy...@gmail.com

 On Tue, Feb 28, 2012 at 3:14 PM, Daevid Vincent dae...@daevid.com wrote:
  My question is, is there a way to enable some PHP configuration that
 would
  output more verbose information, such as a backtrace or the URL
 attempted?
 

 Have you looked at log4php? [1] It's a log4j (Java based) logging
 facility port to PHP.  IIRC for log4j, you can do various logging from
 FINEST, FINER, FINE, INFO, WARNING, ERROR (?), SEVERE levels within
 the application.  You can adjust levels as needed at run time.  You
 may want to have a wrapper that will do back trace and record the
 requested URL.  The log4* facility does rolling file logging, DB,
 e-mail, syslog, etc.  (I've used the log4j and log4net before.)  Very
 handy and flexible, IMO.

 HTH,
 Tommy


 [1] http://logging.apache.org/

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How do I enable more useful PHP error logging?

2012-02-29 Thread Stuart Dallas
On 29 Feb 2012, at 01:13, Daevid Vincent wrote:

 -Original Message-
 From: Stuart Dallas [mailto:stu...@3ft9.com]
 
 Seriously? Errors like this should not be getting anywhere near your
 production servers. This is especially true if you're really getting 30k
 hits/s.
 
 Don't get me started. I joined here almost a year ago. They didn't even have
 a RCS or Wiki at the time. Nothing was OOP. There were no PHPDoc or even
 comments in the code. They used to make each site by copying an existing one
 and modifying it (ie. no shared libraries or resources). I could go on and
 on. Suffice it to say we've made HUGE leaps and bounds (thanks to me!), but
 there is only 3 of us developers here and no official test person let alone
 a test team.
 
 It is what it is. I'm doing the best I can with the limited resources
 available to me.

Good stuff, but the idea that you need an official test person or a test team 
to produce solid code that minimises runtime errors is, in my opinion, 
completely the wrong attitude. I've been in similar situations several times 
and have found that the key is not to try and solve the problem in one big 
push. The key to solving the problem of a large codebase with minimal testing 
is simply to start somewhere.

Put in the infrastructure for unit testing, then make writing tests a part of 
your standard development process. Over time you will find that you are unit 
testing the majority of the code. Yes, that will make things take longer, but 
you can also be confident that when you fix a bug it stays fixed, because you 
know there's a unit test that verifies that the bug has not returned.

In my experience and opinion, limited resources is a big reason to implement 
some level of unit testing as soon as humanly possible, not a reason why you 
can't. Once you have the unit testing infrastructure in place, make running the 
tests the first step in your deployment process. You mention you now use a 
version control system, consider adding a hook to require that the unit tests 
pass before allowing code to be committed. Alternatively implement a CI 
environment which publicly ridicules anyone who checks in code which breaks the 
unit tests - it's amazing how much of a motivator this can be, even in a small 
team of seasoned professionals.

 And let me tell you a little secret, when you get to that scale, you see all
 kinds of errors you don't see on your VM or even with a test team. DB
 connections go away. Funny things happen to memcache. Concurrency issues
 arise. Web bots and search engines rape, pillage and ravage your site in
 ways that make you feel dirty. So yeah, you do hit weird situations and
 cases you can't possibly test for, but show up in error logs.

Not a secret. Not even close to being a secret. I'm no stranger to sites with 
the sort of traffic you have, and then some, and I'm fully aware that it 
presents a unique set of challenges, but there are simple steps you can take to 
make life easier.

Most of the specific issues you mention (DB connections, memcache weirdness, 
concurrency problems, and crawler activity) are the result of poor architecture 
and/or flawed server configuration. Where the architecture is poor I'd 
recommend you design a new architecture and find a way that you can start 
moving towards it, piece by piece, without having too much impact on your 
day-to-day activities. This is not always easy but I've done it several times 
and know it can be done in most situations.

There will always be issues that crop up that you couldn't possibly have known 
would happen, but you can load test your app to see what happens at levels of 
traffic an order of magnitude above that which you expect. One of my current 
clients has a test tool that can generate traffic levels that hit the limit of 
EC2 network throughput specifically to see what would happen if they had a 
sudden and dramatic increase in usage. Knowing the application can cope at 10x 
the expected level of traffic is the only way you can be sure that it can cope 
with 1x the expected traffic without breaking a sweat.

There will always be situations that you don't foresee, and conditions that are 
difficult to test, but saying that you can't possibly test for them is simply 
wrong.

 For a commercial, zero-hassle solution I can't recommend
 http://newrelic.com/ highly enough. Simple installation followed by highly
 detailed reports with zero issues (so far). They do a free trial of all
 the
 pro features so you can see if it gets you what you need. And no, I don't
 work for them, I just think they've built a freakin' awesome product
 that's
 invaluable when diagnosing issues that only occur in production. I've
 never
 used it on a site with that level of traffic, and I'm sure it won't be a
 problem, but you may want to only deploy it to a fraction of your
 infrastructure.
 
 A quick look at that product seems interesting, but not what I really need.
 We have a ton of monitoring solutions in 

[PHP] How do I enable more useful PHP error logging?

2012-02-28 Thread Daevid Vincent
My question is, is there a way to enable some PHP configuration that would
output more verbose information, such as a backtrace or the URL attempted?

In our PHP error log, we have the usual semi-useful information. However
this is only a partial story as it's hard to re-create the URL that caused
the error. In the first Actor example, yeah actor_id 2206 doesn't exist and
so now I have put a try/catch on all pages that have new Actor($actor_id)
but it doesn't tell me WHY this is happening. How did someone get to this
point? I doubt they just randomly picked '2206' which happens to be one of
only a handful of actually missing actors out of 100k. Sure I guess it could
be a bot that sequentially tried them all, but this is not likely since we
have SEO style URLs and so we re-map an actor name back to the ID. So the
bot would have to try NAMEs not IDs. This means we must have some link
somewhere that points to this. Same with the common foreach() warnings
below. Yeah, the array being passed is empty/null. Sure I can check the
array before doing the foreach() or even @foreach() but that doesn't tell me
the root cause. What video are they trying to access that has no scenes or
invalid actors?

We do NOT have apache logging turned on as we get 30,000 hits per second and
it would be too expensive. I only care about PHP errors like this. And the
apache error log (which we do have enabled) doesn't have useful info related
to these kinds of issues as they're really not apache's problem. That log
only deals with missing files/images/pages/etc.

[28-Feb-2012 13:43:19 UTC] PHP Fatal error:  Uncaught exception 
'ObjectNotFound' with message 'There is no such object Actor [2206].' in 
/home/SHARED/classes/base.class.php:103
Stack trace:
#0 /home/SHARED/classes/actor.class.php(61): Base-load_from_sql()
#1 /home/m.videosz.com/browse_scenes.php(89): Actor-__construct(2206)
#2 {main}
   thrown in /home/SHARED/classes/base.class.php on line 103

[28-Feb-2012 10:54:01 UTC] PHP Warning:  Invalid argument supplied for 
foreach() in /home/m.dev.com/scene.php on line 138

[28-Feb-2012 07:22:50 UTC] PHP Warning:  Invalid argument supplied for 
foreach() in /home/SHARED/classes/scene.class.php on line 423



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How do I enable more useful PHP error logging?

2012-02-28 Thread Adam Richardson
On Tue, Feb 28, 2012 at 6:14 PM, Daevid Vincent dae...@daevid.com wrote:

 My question is, is there a way to enable some PHP configuration that would
 output more verbose information, such as a backtrace or the URL attempted?

 In our PHP error log, we have the usual semi-useful information. However
 this is only a partial story as it's hard to re-create the URL that caused
 the error. In the first Actor example, yeah actor_id 2206 doesn't exist and
 so now I have put a try/catch on all pages that have new Actor($actor_id)
 but it doesn't tell me WHY this is happening. How did someone get to this
 point? I doubt they just randomly picked '2206' which happens to be one of
 only a handful of actually missing actors out of 100k. Sure I guess it
 could
 be a bot that sequentially tried them all, but this is not likely since we
 have SEO style URLs and so we re-map an actor name back to the ID. So the
 bot would have to try NAMEs not IDs. This means we must have some link
 somewhere that points to this. Same with the common foreach() warnings
 below. Yeah, the array being passed is empty/null. Sure I can check the
 array before doing the foreach() or even @foreach() but that doesn't tell
 me
 the root cause. What video are they trying to access that has no scenes or
 invalid actors?

 We do NOT have apache logging turned on as we get 30,000 hits per second
 and
 it would be too expensive. I only care about PHP errors like this. And the
 apache error log (which we do have enabled) doesn't have useful info
 related
 to these kinds of issues as they're really not apache's problem. That log
 only deals with missing files/images/pages/etc.

 [28-Feb-2012 13:43:19 UTC] PHP Fatal error:  Uncaught exception
 'ObjectNotFound' with message 'There is no such object Actor [2206].' in
 /home/SHARED/classes/base.class.php:103
 Stack trace:
 #0 /home/SHARED/classes/actor.class.php(61): Base-load_from_sql()
 #1 /home/m.videosz.com/browse_scenes.php(89): Actor-__construct(2206)
 #2 {main}
   thrown in /home/SHARED/classes/base.class.php on line 103

 [28-Feb-2012 10:54:01 UTC] PHP Warning:  Invalid argument supplied for
 foreach() in /home/m.dev.com/scene.php on line 138

 [28-Feb-2012 07:22:50 UTC] PHP Warning:  Invalid argument supplied for
 foreach() in /home/SHARED/classes/scene.class.php on line 423



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


I tend to set up a custom error handler that throws exceptions
(set_error_handler()), then set up an exception handler
(set_exception_handler()) that logs the backtrace (or saves it to a db)
available using debug_backtrace().

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com


Re: [PHP] How do I enable more useful PHP error logging?

2012-02-28 Thread Stuart Dallas
On 28 Feb 2012, at 23:14, Daevid Vincent wrote:

 My question is, is there a way to enable some PHP configuration that would
 output more verbose information, such as a backtrace or the URL attempted?
 
 In our PHP error log, we have the usual semi-useful information. However
 this is only a partial story as it's hard to re-create the URL that caused
 the error. In the first Actor example, yeah actor_id 2206 doesn't exist and
 so now I have put a try/catch on all pages that have new Actor($actor_id)
 but it doesn't tell me WHY this is happening. How did someone get to this
 point? I doubt they just randomly picked '2206' which happens to be one of
 only a handful of actually missing actors out of 100k. Sure I guess it could
 be a bot that sequentially tried them all, but this is not likely since we
 have SEO style URLs and so we re-map an actor name back to the ID. So the
 bot would have to try NAMEs not IDs. This means we must have some link
 somewhere that points to this. Same with the common foreach() warnings
 below. Yeah, the array being passed is empty/null. Sure I can check the
 array before doing the foreach() or even @foreach() but that doesn't tell me
 the root cause. What video are they trying to access that has no scenes or
 invalid actors?
 
 We do NOT have apache logging turned on as we get 30,000 hits per second and
 it would be too expensive. I only care about PHP errors like this. And the
 apache error log (which we do have enabled) doesn't have useful info related
 to these kinds of issues as they're really not apache's problem. That log
 only deals with missing files/images/pages/etc.
 
 [28-Feb-2012 13:43:19 UTC] PHP Fatal error:  Uncaught exception 
 'ObjectNotFound' with message 'There is no such object Actor [2206].' in 
 /home/SHARED/classes/base.class.php:103
 Stack trace:
 #0 /home/SHARED/classes/actor.class.php(61): Base-load_from_sql()
 #1 /home/m.videosz.com/browse_scenes.php(89): Actor-__construct(2206)
 #2 {main}
   thrown in /home/SHARED/classes/base.class.php on line 103
 
 [28-Feb-2012 10:54:01 UTC] PHP Warning:  Invalid argument supplied for 
 foreach() in /home/m.dev.com/scene.php on line 138
 
 [28-Feb-2012 07:22:50 UTC] PHP Warning:  Invalid argument supplied for 
 foreach() in /home/SHARED/classes/scene.class.php on line 423

Seriously? Errors like this should not be getting anywhere near your production 
servers. This is especially true if you're really getting 30k hits/s.

For a commercial, zero-hassle solution I can't recommend http://newrelic.com/ 
highly enough. Simple installation followed by highly detailed reports with 
zero issues (so far). They do a free trial of all the pro features so you can 
see if it gets you what you need. And no, I don't work for them, I just think 
they've built a freakin' awesome product that's invaluable when diagnosing 
issues that only occur in production. I've never used it on a site with that 
level of traffic, and I'm sure it won't be a problem, but you may want to only 
deploy it to a fraction of your infrastructure.

If you want a homemade solution, the uncaught exceptions are easily dealt 
with... CATCH THEM, do something useful with them, and then die gracefully. 
Rocket science this ain't! See the set_exception_handler function for an easy 
way to set up a global function to catch uncaught exceptions if you don't have 
a limited number of entry points.

You can similarly catch the warnings using the set_error_handler function, tho 
be aware that this won't be triggered for fatal errors.

But seriously... a minimal level of structured testing would prevent issues 
like this being deployed to your production servers. Sure, instrument to help 
resolve these issues now, but if I were you I'd be putting a lot of effort into 
improving your development process. Contact me off-list if you'd like to talk 
about this in more detail.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How do I enable more useful PHP error logging?

2012-02-28 Thread Daevid Vincent
 -Original Message-
 From: Stuart Dallas [mailto:stu...@3ft9.com]
 
 Seriously? Errors like this should not be getting anywhere near your
 production servers. This is especially true if you're really getting 30k
 hits/s.

Don't get me started. I joined here almost a year ago. They didn't even have
a RCS or Wiki at the time. Nothing was OOP. There were no PHPDoc or even
comments in the code. They used to make each site by copying an existing one
and modifying it (ie. no shared libraries or resources). I could go on and
on. Suffice it to say we've made HUGE leaps and bounds (thanks to me!), but
there is only 3 of us developers here and no official test person let alone
a test team.

It is what it is. I'm doing the best I can with the limited resources
available to me.

And let me tell you a little secret, when you get to that scale, you see all
kinds of errors you don't see on your VM or even with a test team. DB
connections go away. Funny things happen to memcache. Concurrency issues
arise. Web bots and search engines rape, pillage and ravage your site in
ways that make you feel dirty. So yeah, you do hit weird situations and
cases you can't possibly test for, but show up in error logs.
 
 For a commercial, zero-hassle solution I can't recommend
 http://newrelic.com/ highly enough. Simple installation followed by highly
 detailed reports with zero issues (so far). They do a free trial of all
the
 pro features so you can see if it gets you what you need. And no, I don't
 work for them, I just think they've built a freakin' awesome product
that's
 invaluable when diagnosing issues that only occur in production. I've
never
 used it on a site with that level of traffic, and I'm sure it won't be a
 problem, but you may want to only deploy it to a fraction of your
 infrastructure.

A quick look at that product seems interesting, but not what I really need.
We have a ton of monitoring solutions in place to get metrics and
performance data. I just need a good 'hook' to get details when errors
occur.

 If you want a homemade solution, the uncaught exceptions are easily dealt
 with... CATCH THEM, do something useful with them, and then die
gracefully.
 Rocket science this ain't!

Thanks captain obvious. :)

I can do that (and did do that), but again, at these scales, all the
text-book code you think you know starts to go out the window. Frameworks
break down. RDBMS topple over. You have to write things creatively, leanly
(and sometimes error on the side of 'assume something is there' rather than
'assume the worst' or your code spends too much time checking the edge
cases). Hit it and quit it! Get in. Get out. I can't put try/catch around
everything everywhere, it's just not efficient or practical. Even the SQL
queries we write are 'wide' and we pull in as much logical stuff as we can
in one DB call, get it into a memcache slab and then pull it out of there
over and over, rather than surgical queries to get small chunks of data
which would murder mySQL.

Part of the reason I took this job is exactly because of these challenges
and I've learned an incredible amount here (I've also had to wash the guilt
off of me some nights, as some code I've written goes against everything I
was taught and thought I knew for the past decade -- but it works and works
well -- it just FEELS wrong). We do a lot of things that would make my
college professors cringe. THAT is the difference between the REAL world and
the LAB. ;-)

 See the set_exception_handler function for an
 easy way to set up a global function to catch uncaught exceptions if you
 don't have a limited number of entry points.
 
 You can similarly catch the warnings using the set_error_handler function,
 tho be aware that this won't be triggered for fatal errors.

And this is the meat of the solution. Thanks! I'll look into these handlers
and see if I can inject it into someplace useful. I have high hopes for this
now.

 But seriously... a minimal level of structured testing would prevent
issues
 like this being deployed to your production servers. Sure, instrument to
 help resolve these issues now, but if I were you I'd be putting a lot of
 effort into improving your development process. Contact me off-list if
you'd
 like to talk about this in more detail.

See above. I have begged for even a single dedicated tester. I have offered
to sacrifice the open req I had for a junior developer to get a tester. That
resulted in them taking away the req because clearly I didn't need the
developer then and we can just test it ourselves. You're preaching to the
choir my friend. I've been doing this for 15+ years at various companies.
;-)

d.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How do I enable more useful PHP error logging?

2012-02-28 Thread Tommy Pham
On Tue, Feb 28, 2012 at 3:14 PM, Daevid Vincent dae...@daevid.com wrote:
 My question is, is there a way to enable some PHP configuration that would
 output more verbose information, such as a backtrace or the URL attempted?


Have you looked at log4php? [1] It's a log4j (Java based) logging
facility port to PHP.  IIRC for log4j, you can do various logging from
FINEST, FINER, FINE, INFO, WARNING, ERROR (?), SEVERE levels within
the application.  You can adjust levels as needed at run time.  You
may want to have a wrapper that will do back trace and record the
requested URL.  The log4* facility does rolling file logging, DB,
e-mail, syslog, etc.  (I've used the log4j and log4net before.)  Very
handy and flexible, IMO.

HTH,
Tommy


[1] http://logging.apache.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error in portuguese translation of substr_compare

2011-12-31 Thread Daniel P. Brown
Forwarded to the proper address.

Docs PT/PT-BR folks, please see the below email.  Thanks, and
happy new year!


On Fri, Dec 30, 2011 at 14:35, QI.VOLMAR QI qi.vol...@gmail.com wrote:
 I was read substr_compare description in portuguese language, an I
 asked myself to test it, so after several test, I found that its
 wrong.
 The text is in Portuguese:
           Se length é igual ou maior que o comprimento de main_str e
 length é setado, substr_compare() imprime warning e retorna FALSE.

 That is translated:
          If length is equal or bigger than size of main_str and
 length is setted, substr_compare() prints a warning and return FALSE

 The original is:
          If offset is equal to or greater than the length of main_str
 or length is set and is less than 1, substr_compare() prints a warning
 and returns FALSE.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
/Daniel P. Brown
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Error in portuguese translation of substr_compare

2011-12-30 Thread QI.VOLMAR QI
I was read substr_compare description in portuguese language, an I
asked myself to test it, so after several test, I found that its
wrong.
The text is in Portuguese:
   Se length é igual ou maior que o comprimento de main_str e
length é setado, substr_compare() imprime warning e retorna FALSE.

That is translated:
  If length is equal or bigger than size of main_str and
length is setted, substr_compare() prints a warning and return FALSE

The original is:
  If offset is equal to or greater than the length of main_str
or length is set and is less than 1, substr_compare() prints a warning
and returns FALSE.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Error Reporting

2011-12-23 Thread Floyd Resler
I know this is a very basic question and I'm almost embarrassed to ask it, but 
it's something I really struggle with.  That is, getting the right combination 
of error reporting options together to report the errors I want.  Right now, I 
get the errors I want except for parse errors.  Basically, I want all errors 
but not warnings.  What would be a good combination of error report options for 
my php.ini file?

Thanks!
Floyd


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Reporting

2011-12-23 Thread Jim Lucas
On 12/23/2011 8:13 AM, Floyd Resler wrote:
 I know this is a very basic question and I'm almost embarrassed to ask it, 
 but it's something I really struggle with.  That is, getting the right 
 combination of error reporting options together to report the errors I want.  
 Right now, I get the errors I want except for parse errors.  Basically, I 
 want all errors but not warnings.  What would be a good combination of error 
 report options for my php.ini file?
 
 Thanks!
 Floyd
 
 

I run this on my server:

error_reporting = E_ALL
display_errors = On
log_errors = On

It shows me everything, including warnings.

If you want to hide the Warning, then you would use this

error_reporting = E_ALL  ~E_NOTICE
display_errors = On
log_errors = On

E_NOTICE includes warnings.

Reference here: http://us.php.net/manual/en/errorfunc.constants.php

-- 
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error recovery - fatal errors

2011-05-16 Thread David Harkness
You can register a shutdown function that gets called even in the case of a
fatal error. We use something like this:

public function init() {
register_shutdown_function(array('Bootstrap', 'fatalErrorCatcher'));
...
}

public function fatalErrorCatcher() {
$error = error_get_last();
if( $error  (
$error['type'] === E_ERROR ||
$error['type'] === E_COMPILE_ERROR ||
$error['type'] === E_CORE_ERROR ||
$error['type'] === E_PARSE
)) {
// kill the buffer content, it's broken anyway
while(ob_get_level()) {
ob_end_clean();
}
// log error to a file
...
// issue 500 and dump out a static site is broken oh noes!
page
header('HTTP/1.1 500 Internal Server Error');
echo file_get_contents('fail-whale.html');
}
}

In catchFatalError() we check the last error to see if it's truly fatal. Our
general error-handler has already handled all other error types, and this
since function gets called no matter how the PHP process shutsdown, you
don't want to issue a 500 for a successful request. :)

David


Re: Re: [PHP] Error recovery - fatal errors

2011-05-16 Thread Tim Streater
On 14 May 2011 at 15:05, Peter Lind peter.e.l...@gmail.com wrote: 

 On 14 May 2011 12:33, Tim Streater t...@clothears.org.uk wrote:
 I would like, in my app, to recover from as many run-time errors as possible,
 so that I can tidy up. And unsolicited output generated by the standard error
 system is really unhelpful as it becomes part of the ajax reply to the
 browser.

 So I've added my own error handler, but it seems that I can't catch fatal
 errors. The error in question comes from doing something like:

 Fatal errors are fatal - if you could recover from them, they wouldn't be
 fatal.

Except that this error is arbitrarily designated as fatal when it need not be. 
A few days ago I discovered register_shutdown_function as mentioned by someone 
today, and use that to pass E_ERRORs on to my error handler (as declared by 
set_error_handler). That way I can log the error properly and notify the user 
in a consistent manner. I've tested this by introducing some errors (e.g. 
unitialised variables or setting $dbh to null) and these are all nicely picked 
up.

 $res = $dbh-query ($sql);

 with $sql being an SQL statement, and $dbh being a database handle. I
 recently had a case where $dbh was NULL, which triggers a fatal error from
 SQLite. In principle such a bug should show up quickly, but this one had lain
 untriggered for about a year. It seems to me somewhat arbitrary for this to
 be designated a fatal error. Is there a way I can catch these? Most SQLite
 error situations I'm solving with try/catch but no luck with this one so far.

 You've got something wrong: either $dbh is not null or the error is
 not from sqlite. I'm guessing the former. To avoid situations like
 that, do proper error checking (i.e. actually check that your database
 connection was opened succesfully).

No, $dbh was unitialised. It was a coding error where I was using $dbhs instead 
of $dbh. Since what I was apparently trying to do last year was wrong anyway 
I've rejigged that section. And obviously I do check that the db is opened; 
just that in this instance I was using the wrong variable.

 Error handling in library packages seems somewhat arbitrary - e.g. opendir
 may give an E_WARNING, but closedir, readdir don't.

 You can avoid all problems with error output by turning off error
 displays in php.ini (set display_errors = off) - use error logging
 instead. That's the recommended setting for production servers.

This is not a browser/webserver situation in the classic manner. In this case, 
the browser, PHP code, and the instance of apache used are all running on the 
user's machine. The user just thinks they are running a local application.

Cheers  --  tim


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: [PHP] Error recovery - fatal errors

2011-05-16 Thread Peter Lind
On 16 May 2011 22:14, Tim Streater t...@clothears.org.uk wrote:
 On 14 May 2011 at 15:05, Peter Lind peter.e.l...@gmail.com wrote:

 On 14 May 2011 12:33, Tim Streater t...@clothears.org.uk wrote:
 I would like, in my app, to recover from as many run-time errors as 
 possible,
 so that I can tidy up. And unsolicited output generated by the standard 
 error
 system is really unhelpful as it becomes part of the ajax reply to the
 browser.

 So I've added my own error handler, but it seems that I can't catch fatal
 errors. The error in question comes from doing something like:

 Fatal errors are fatal - if you could recover from them, they wouldn't be
 fatal.

 Except that this error is arbitrarily designated as fatal when it need not 
 be. A few days ago I discovered register_shutdown_function as mentioned by 
 someone today, and use that to pass E_ERRORs on to my error handler (as 
 declared by set_error_handler). That way I can log the error properly and 
 notify the user in a consistent manner. I've tested this by introducing some 
 errors (e.g. unitialised variables or setting $dbh to null) and these are all 
 nicely picked up.

You were trying to call a method on a non-object - how do you expect
PHP to handle that if not with a fatal error?
Anyway, good to hear you solved the issue - I misunderstood what you
wanted to do (shut down in a proper fashion, not actually recover from
the error) so I didn't think to mention this.

* snip *

 You can avoid all problems with error output by turning off error
 displays in php.ini (set display_errors = off) - use error logging
 instead. That's the recommended setting for production servers.

 This is not a browser/webserver situation in the classic manner. In this 
 case, the browser, PHP code, and the instance of apache used are all running 
 on the user's machine. The user just thinks they are running a local 
 application.

You can call it production server or not, if you are having problems
with error messages from php then you should turn off error display -
which shouldn't get in the way of you showing your own error messages
but will solve the problem mentioned.

Regards
Peter

-- 
hype
WWW: plphp.dk / plind.dk
LinkedIn: plind
BeWelcome/Couchsurfing: Fake51
Twitter: kafe15
/hype

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error recovery - fatal errors

2011-05-16 Thread Tim Streater
On 16 May 2011 at 21:34, Peter Lind peter.e.l...@gmail.com wrote: 

 You were trying to call a method on a non-object - how do you expect
 PHP to handle that if not with a fatal error?
 Anyway, good to hear you solved the issue - I misunderstood what you
 wanted to do (shut down in a proper fashion, not actually recover from
 the error) so I didn't think to mention this.

Thanks, yes, that all appears to be function OK now. Meanwhile I'm chasing a 
strangeness to do perhaps with UTF-8 - I send some simplified Chinese back from 
the PHP side as part of an ajax response to the browser for it to display, and 
in one case it does it right, in another the browser converts it to something 
else. I'm trying to duplicate this in a testbed with no success so far. Still, 
it keeps me off the streets :-)

Cheers  --  tim 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Error recovery - fatal errors

2011-05-14 Thread Tim Streater
I would like, in my app, to recover from as many run-time errors as possible, 
so that I can tidy up. And unsolicited output generated by the standard error 
system is really unhelpful as it becomes part of the ajax reply to the browser.

So I've added my own error handler, but it seems that I can't catch fatal 
errors. The error in question comes from doing something like:

$res = $dbh-query ($sql);

with $sql being an SQL statement, and $dbh being a database handle. I recently 
had a case where $dbh was NULL, which triggers a fatal error from SQLite. In 
principle such a bug should show up quickly, but this one had lain untriggered 
for about a year. It seems to me somewhat arbitrary for this to be designated a 
fatal error. Is there a way I can catch these? Most SQLite error situations I'm 
solving with try/catch but no luck with this one so far.

Error handling in library packages seems somewhat arbitrary - e.g. opendir may 
give an E_WARNING, but closedir, readdir don't.

tim


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Error recovery - fatal errors

2011-05-14 Thread Peter Lind
On 14 May 2011 12:33, Tim Streater t...@clothears.org.uk wrote:
 I would like, in my app, to recover from as many run-time errors as possible, 
 so that I can tidy up. And unsolicited output generated by the standard error 
 system is really unhelpful as it becomes part of the ajax reply to the 
 browser.

 So I've added my own error handler, but it seems that I can't catch fatal 
 errors. The error in question comes from doing something like:

Fatal errors are fatal - if you could recover from them, they wouldn't be fatal.

 $res = $dbh-query ($sql);

 with $sql being an SQL statement, and $dbh being a database handle. I 
 recently had a case where $dbh was NULL, which triggers a fatal error from 
 SQLite. In principle such a bug should show up quickly, but this one had lain 
 untriggered for about a year. It seems to me somewhat arbitrary for this to 
 be designated a fatal error. Is there a way I can catch these? Most SQLite 
 error situations I'm solving with try/catch but no luck with this one so far.

You've got something wrong: either $dbh is not null or the error is
not from sqlite. I'm guessing the former. To avoid situations like
that, do proper error checking (i.e. actually check that your database
connection was opened succesfully).

 Error handling in library packages seems somewhat arbitrary - e.g. opendir 
 may give an E_WARNING, but closedir, readdir don't.


You can avoid all problems with error output by turning off error
displays in php.ini (set display_errors = off) - use error logging
instead. That's the recommended setting for production servers.

Regards
Peter

-- 
hype
WWW: plphp.dk / plind.dk
LinkedIn: plind
BeWelcome/Couchsurfing: Fake51
Twitter: kafe15
/hype

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Reporting/Display Errors Issues?

2011-05-10 Thread xianhua zhou
You may need to check the running php code,  those values can be
changed during runtime.

2011/5/10 Mike Mackintosh mike.mackint...@angrystatic.com:
 Anyone else notice PHP throwing Warning and Notices even when display errors 
 and error reporting disabled?

 I compiled PHP with the following:

 './configure'  '--prefix=/usr/local/php-5.3.3' '--enable-cli' 
 '--disable-debug' '--disable-rpath' '--disable-static' '--with-pic' 
 '--with-openssl=/usr' '--enab
 le-bcmath' '--with-bz2' '--enable-calendar' '--enable-ctype' '--with-curl' 
 '--with-zlib-dir=/usr' '--with-xsl' '--enable-exif' '--enable-ftp' 
 '--with-gd' '--enable-gd-native-ttf' '-
 -with-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' 
 '--with-freetype-dir=/usr' '--with-gettext' '--with-iconv' '--with-imap' 
 '--with-kerberos=/usr' '--with-imap-ssl=/usr' '--ena
 ble-mbstring' '--with-mcrypt' '--with-mhash' '--with-mime-magic' 
 '--with-mysql=/usr/local/mysql-5.1.49' '--with-pcre-regex=/usr' 
 '--with-pspell=/usr' '--enable-sockets' '--enable-wd
 dx' '--with-xmlrpc' '--with-zlib=/usr' '--with-pear' '--with-layout=GNU' 
 '--with-ldap' '--enable-pdo' '--enable-soap' 
 '--with-apxs2=/usr/local/apache-2.2.16/bin/apxs' '--enable-pcnt
 l' '--enable-mailparse' '--enable-zip' '--with-zip=/usr' '--with-bz2=/usr' 
 '--with-config-file-path=/etc' 
 '--with-config-file-scan-dir=/usr/local/php-5.3.3/etc' '--with-pdo-mysql=/u
 sr/local/mysql-5.1.49' '--with-openssl=/usr'

 I have also set the following:

 display_errors = Off = Off
 display_startup_errors = Off = Off
 error_append_string = no value = no value
 error_log = no value = no value
 error_prepend_string = no value = no value
 error_reporting = 0 = 0

 But i continue to receive Strict/Notice and Warnings in code that i wish to 
 be hidden.

 Any suggestions?

 Thanks,

 Mike
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Error Reporting/Display Errors Issues?

2011-05-10 Thread admin
Try this for me in a page you wish to not display errors.
?php

error_reporting(0);
ini_set('display_errors', 0);

?


What you are doing with this function is over riding the php.ini file and
turning off the errors on that page.
Place the code at the beginning of php before any includes.

If this works errors are turned on or your disabling function is malformed.



Richard L. Buskirk



-Original Message-
From: Mike Mackintosh [mailto:mike.mackint...@angrystatic.com] 
Sent: Monday, May 09, 2011 10:34 PM
To: php-general@lists.php.net
Subject: [PHP] Error Reporting/Display Errors Issues?

Anyone else notice PHP throwing Warning and Notices even when display errors
and error reporting disabled?

I compiled PHP with the following:

'./configure'  '--prefix=/usr/local/php-5.3.3' '--enable-cli'
'--disable-debug' '--disable-rpath' '--disable-static' '--with-pic'
'--with-openssl=/usr' '--enab
le-bcmath' '--with-bz2' '--enable-calendar' '--enable-ctype' '--with-curl'
'--with-zlib-dir=/usr' '--with-xsl' '--enable-exif' '--enable-ftp'
'--with-gd' '--enable-gd-native-ttf' '-
-with-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr'
'--with-freetype-dir=/usr' '--with-gettext' '--with-iconv' '--with-imap'
'--with-kerberos=/usr' '--with-imap-ssl=/usr' '--ena
ble-mbstring' '--with-mcrypt' '--with-mhash' '--with-mime-magic'
'--with-mysql=/usr/local/mysql-5.1.49' '--with-pcre-regex=/usr'
'--with-pspell=/usr' '--enable-sockets' '--enable-wd
dx' '--with-xmlrpc' '--with-zlib=/usr' '--with-pear' '--with-layout=GNU'
'--with-ldap' '--enable-pdo' '--enable-soap'
'--with-apxs2=/usr/local/apache-2.2.16/bin/apxs' '--enable-pcnt
l' '--enable-mailparse' '--enable-zip' '--with-zip=/usr' '--with-bz2=/usr'
'--with-config-file-path=/etc'
'--with-config-file-scan-dir=/usr/local/php-5.3.3/etc' '--with-pdo-mysql=/u
sr/local/mysql-5.1.49' '--with-openssl=/usr'

I have also set the following:

display_errors = Off = Off
display_startup_errors = Off = Off
error_append_string = no value = no value
error_log = no value = no value
error_prepend_string = no value = no value
error_reporting = 0 = 0

But i continue to receive Strict/Notice and Warnings in code that i wish to
be hidden.

Any suggestions?

Thanks,

Mike
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Reporting/Display Errors Issues?

2011-05-10 Thread Mike Mackintosh
Unfortunately setting that within the PHP file directly still results in errors 
and notices being displayed. I'm at a loss.

Sent from my iPhone

On May 10, 2011, at 5:40, ad...@buskirkgraphics.com wrote:

 Try this for me in a page you wish to not display errors.
 ?php
 
 error_reporting(0);
 ini_set('display_errors', 0);
 
 ?
 
 
 What you are doing with this function is over riding the php.ini file and
 turning off the errors on that page.
 Place the code at the beginning of php before any includes.
 
 If this works errors are turned on or your disabling function is malformed.
 
 
 
 Richard L. Buskirk
 
 
 
 -Original Message-
 From: Mike Mackintosh [mailto:mike.mackint...@angrystatic.com] 
 Sent: Monday, May 09, 2011 10:34 PM
 To: php-general@lists.php.net
 Subject: [PHP] Error Reporting/Display Errors Issues?
 
 Anyone else notice PHP throwing Warning and Notices even when display errors
 and error reporting disabled?
 
 I compiled PHP with the following:
 
 './configure'  '--prefix=/usr/local/php-5.3.3' '--enable-cli'
 '--disable-debug' '--disable-rpath' '--disable-static' '--with-pic'
 '--with-openssl=/usr' '--enab
 le-bcmath' '--with-bz2' '--enable-calendar' '--enable-ctype' '--with-curl'
 '--with-zlib-dir=/usr' '--with-xsl' '--enable-exif' '--enable-ftp'
 '--with-gd' '--enable-gd-native-ttf' '-
 -with-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr'
 '--with-freetype-dir=/usr' '--with-gettext' '--with-iconv' '--with-imap'
 '--with-kerberos=/usr' '--with-imap-ssl=/usr' '--ena
 ble-mbstring' '--with-mcrypt' '--with-mhash' '--with-mime-magic'
 '--with-mysql=/usr/local/mysql-5.1.49' '--with-pcre-regex=/usr'
 '--with-pspell=/usr' '--enable-sockets' '--enable-wd
 dx' '--with-xmlrpc' '--with-zlib=/usr' '--with-pear' '--with-layout=GNU'
 '--with-ldap' '--enable-pdo' '--enable-soap'
 '--with-apxs2=/usr/local/apache-2.2.16/bin/apxs' '--enable-pcnt
 l' '--enable-mailparse' '--enable-zip' '--with-zip=/usr' '--with-bz2=/usr'
 '--with-config-file-path=/etc'
 '--with-config-file-scan-dir=/usr/local/php-5.3.3/etc' '--with-pdo-mysql=/u
 sr/local/mysql-5.1.49' '--with-openssl=/usr'
 
 I have also set the following:
 
 display_errors = Off = Off
 display_startup_errors = Off = Off
 error_append_string = no value = no value
 error_log = no value = no value
 error_prepend_string = no value = no value
 error_reporting = 0 = 0
 
 But i continue to receive Strict/Notice and Warnings in code that i wish to
 be hidden.
 
 Any suggestions?
 
 Thanks,
 
 Mike
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Error Reporting/Display Errors Issues?

2011-05-09 Thread Mike Mackintosh
Anyone else notice PHP throwing Warning and Notices even when display errors 
and error reporting disabled?

I compiled PHP with the following:

'./configure'  '--prefix=/usr/local/php-5.3.3' '--enable-cli' '--disable-debug' 
'--disable-rpath' '--disable-static' '--with-pic' '--with-openssl=/usr' '--enab
le-bcmath' '--with-bz2' '--enable-calendar' '--enable-ctype' '--with-curl' 
'--with-zlib-dir=/usr' '--with-xsl' '--enable-exif' '--enable-ftp' '--with-gd' 
'--enable-gd-native-ttf' '-
-with-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' 
'--with-freetype-dir=/usr' '--with-gettext' '--with-iconv' '--with-imap' 
'--with-kerberos=/usr' '--with-imap-ssl=/usr' '--ena
ble-mbstring' '--with-mcrypt' '--with-mhash' '--with-mime-magic' 
'--with-mysql=/usr/local/mysql-5.1.49' '--with-pcre-regex=/usr' 
'--with-pspell=/usr' '--enable-sockets' '--enable-wd
dx' '--with-xmlrpc' '--with-zlib=/usr' '--with-pear' '--with-layout=GNU' 
'--with-ldap' '--enable-pdo' '--enable-soap' 
'--with-apxs2=/usr/local/apache-2.2.16/bin/apxs' '--enable-pcnt
l' '--enable-mailparse' '--enable-zip' '--with-zip=/usr' '--with-bz2=/usr' 
'--with-config-file-path=/etc' 
'--with-config-file-scan-dir=/usr/local/php-5.3.3/etc' '--with-pdo-mysql=/u
sr/local/mysql-5.1.49' '--with-openssl=/usr'

I have also set the following:

display_errors = Off = Off
display_startup_errors = Off = Off
error_append_string = no value = no value
error_log = no value = no value
error_prepend_string = no value = no value
error_reporting = 0 = 0

But i continue to receive Strict/Notice and Warnings in code that i wish to be 
hidden.

Any suggestions?

Thanks,

Mike
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error in variable assignment

2011-04-12 Thread Richard Quadling
On 11 April 2011 20:28, Ethan Rosenberg eth...@earthlink.net wrote:
 Dear list -

 I an writing a script that will simulate a chess board.  On a move from e2
 to e6 [see below] the variable in e2 is never assigned to e6.  Here are some
 code snippets:

 ?php
 session_start();
 session_name(Chess);
 error_reporting(1);
  if ($_SESSION['flag'] != 1)
 {
 $flag = 1;
 echo br /startingbr /;
  $results = array(array(Br, Bn, Bb, Bq, Bk, Bb, Bn,
 Br),array(Bp, Bp, Bp, Bp, Bp, Bp, Bp, Bp),
                        array(, , , , , , , ),array(, ,
 , , , , , ),array(, , , , , , , ),
                        array(, , , , , , , ),array(Wp,
 Wp, Wp, Wp, Wp, Wp, Wp, Wp),
                        array(Wr, Wn, Wb, Wq, Wk, Wb, Wn,
 Wr));

 $_SESSION['results'] = $results;
        for($i = 0; $i 8; $i++)
        {
                for ($j = 0; $j  8; $j++)
                        printf(%s , $results[$i][$j]);
                printf(br /);
        }

 $_SESSION[flag] = $flag;

 snip

 $board = array  //Correlation of input array [chessboard] with internal
 array [results]
 (
                a8 = $results[0][0],
                b8 = $results[0][1],
                c8 = $results[0][2],
                d8 = $results[0][3],
                e8 = $results[0][4],
                f8 = $results[0][5],
                g8 = $results[0][6],
                h8 = $results[0][7],
                a7 = $results[1][0],
                b7 = $results[1][1],
                c7 = $results[1][2],
                d7 = $results[1][3],
                e7 = $results[1][4],
                f7 = $results[1][5],
                g7 = $results[1][6],
                h7 = $results[1][7],
                a6 = $results[2][0],
                b6 = $results[2][1],
                c6 = $results[2][2],
                d6 = $results[2][3],
                e6 = $results[2][4],
                f6 = $results[2][5],
                g6 = $results[2][6],
                h6 = $results[2][7],
                a5 = $results[3][0],
                b5 = $results[3][1],
                c5 = $results[3][2],
                d5 = $results[3][3],
                e5 = $results[3][4],
                f5 = $results[3][5],
                g5 = $results[3][6],
                h5 = $results[3][7],
                a4 = $results[4][0],
                b4 = $results[4][1],
                c4 = $results[4][2],
                d4 = $results[4][3],
                e4 = $results[4][4],
                f4 = $results[4][5],
                g4 = $results[4][6],
                h4 = $results[4][7],
                a3 = $results[5][0],
                b3 = $results[5][1],
                c3 = $results[5][2],
                d3 = $results[5][3],
                e3 = $results[5][4],
                f3 = $results[5][5],
                g3 = $results[5][6],
                h3 = $results[5][7],
                a2 = $results[6][0],
                b2 = $results[6][1],
                c2 = $results[6][2],
                d2 = $results[6][3],
                e2 = $results[6][4],
                f2 = $results[6][5],
                g2 = $results[6][6],
                h2 = $results[6][7],
                a1 = $results[7][0],
                b1 = $results[7][1],
                c1 = $results[7][2],
                d1 = $results[7][3],
                e1 = $results[7][4],
                f1 = $results[7][5],
                g1 = $results[7][6],
                h1 = $results[7][7],
        );


 $board2 = array  //Correlation of input array [chessboard] with internal
 array [results]
 (
                a8 = [0][0],
                b8 = [0][1],
                c8 = [0][2],
                d8 = [0][3],
                e8 = [0][4],
                f8 = [0][5],
                g8 = [0][6],
                h8 = [0][7],
                a7 = [1][0],
                b7 = [1][1],
                c7 = [1][2],
                d7 = [1][3],
                e7 = [1][4],
                f7 = [1][5],
                g7 = [1][6],
                h7 = [1][7],
                a6 = [2][0],
                b6 = [2][1],
                c6 = [2][2],
                d6 = [2][3],
                e6 = [2][4],
                f6 = [2][5],
                g6 = [2][6],
                h6 = [2][7],
                a5 = [3][0],
                b5 = [3][1],
                c5 = [3][2],
                d5 = [3][3],
                e5 = [3][4],
                f5 = [3][5],
                g5 = [3][6],
                h5 = [3][7],
                a4 = [4][0],
                b4 = [4][1],
                c4 = [4][2],
                d4 = [4][3],
                e4 = [4][4],
                f4 = [4][5],
                g4 = [4][6],
                h4 = [4][7],
                a3 = [5][0],
                b3 = [5][1],
                c3 = [5][2],
                d3 = [5][3],
                e3 = [5][4],
                f3 = [5][5],
                g3 = [5][6],
                h3 = [5][7],
                a2 = [6][0],
                b2 = [6][1],
   

[PHP] Error in variable assignment

2011-04-11 Thread Ethan Rosenberg

Dear list -

I an writing a script that will simulate a chess board.  On a move 
from e2 to e6 [see below] the variable in e2 is never assigned to 
e6.  Here are some code snippets:


?php
session_start();
session_name(Chess);
error_reporting(1);
 if ($_SESSION['flag'] != 1)
{
$flag = 1;
echo br /startingbr /;
 $results = array(array(Br, Bn, Bb, Bq, Bk, Bb, Bn, 
Br),array(Bp, Bp, Bp, Bp, Bp, Bp, Bp, Bp),
array(, , , , , , , 
),array(, , , , , , , ),array(, , , , , 
, , ),
array(, , , , , , , 
),array(Wp, Wp, Wp, Wp, Wp, Wp, Wp, Wp),
array(Wr, Wn, Wb, Wq, Wk, Wb, 
Wn, Wr));


$_SESSION['results'] = $results;
for($i = 0; $i 8; $i++)
{
for ($j = 0; $j  8; $j++)
printf(%s , $results[$i][$j]);
printf(br /);
}

$_SESSION[flag] = $flag;

snip

$board = array  //Correlation of input array [chessboard] with 
internal array [results]

(
a8 = $results[0][0],
b8 = $results[0][1],
c8 = $results[0][2],
d8 = $results[0][3],
e8 = $results[0][4],
f8 = $results[0][5],
g8 = $results[0][6],
h8 = $results[0][7],
a7 = $results[1][0],
b7 = $results[1][1],
c7 = $results[1][2],
d7 = $results[1][3],
e7 = $results[1][4],
f7 = $results[1][5],
g7 = $results[1][6],
h7 = $results[1][7],
a6 = $results[2][0],
b6 = $results[2][1],
c6 = $results[2][2],
d6 = $results[2][3],
e6 = $results[2][4],
f6 = $results[2][5],
g6 = $results[2][6],
h6 = $results[2][7],
a5 = $results[3][0],
b5 = $results[3][1],
c5 = $results[3][2],
d5 = $results[3][3],
e5 = $results[3][4],
f5 = $results[3][5],
g5 = $results[3][6],
h5 = $results[3][7],
a4 = $results[4][0],
b4 = $results[4][1],
c4 = $results[4][2],
d4 = $results[4][3],
e4 = $results[4][4],
f4 = $results[4][5],
g4 = $results[4][6],
h4 = $results[4][7],
a3 = $results[5][0],
b3 = $results[5][1],
c3 = $results[5][2],
d3 = $results[5][3],
e3 = $results[5][4],
f3 = $results[5][5],
g3 = $results[5][6],
h3 = $results[5][7],
a2 = $results[6][0],
b2 = $results[6][1],
c2 = $results[6][2],
d2 = $results[6][3],
e2 = $results[6][4],
f2 = $results[6][5],
g2 = $results[6][6],
h2 = $results[6][7],
a1 = $results[7][0],
b1 = $results[7][1],
c1 = $results[7][2],
d1 = $results[7][3],
e1 = $results[7][4],
f1 = $results[7][5],
g1 = $results[7][6],
h1 = $results[7][7],
);


$board2 = array  //Correlation of input array [chessboard] with 
internal array [results]

(
a8 = [0][0],
b8 = [0][1],
c8 = [0][2],
d8 = [0][3],
e8 = [0][4],
f8 = [0][5],
g8 = [0][6],
h8 = [0][7],
a7 = [1][0],
b7 = [1][1],
c7 = [1][2],
d7 = [1][3],
e7 = [1][4],
f7 = [1][5],
g7 = [1][6],
h7 = [1][7],
a6 = [2][0],
b6 = [2][1],
c6 = [2][2],
d6 = [2][3],
e6 = [2][4],
f6 = [2][5],
g6 = [2][6],
h6 = [2][7],
a5 = [3][0],
b5 = [3][1],
c5 = [3][2],
d5 = [3][3],
e5 = [3][4],
f5 = [3][5],
g5 = [3][6],
h5 = [3][7],
a4 = [4][0],
b4 = [4][1],
c4 = [4][2],
d4 = [4][3],
e4 = [4][4],
f4 = [4][5],
g4 = [4][6],
h4 = [4][7],
a3 = [5][0],
b3 = [5][1],
c3 = [5][2],
d3 = [5][3],
e3 = [5][4],
f3 = [5][5],
g3 = [5][6],
h3 = [5][7],
a2 = [6][0],
b2 = [6][1],
c2 = [6][2],
d2 = [6][3],
e2 = 

[PHP] Error handling a max license issue

2011-02-17 Thread Richard Sharp
Hello everyone,

 

I am having the difficult time trying to figure out how to detract an
max user license when my script tries to connect to our Pervasive
database through an ODBC connector.  I am looking for a way to ignore
the error if one arise and continue on with the code.

 

Here is what I have so far

 

if($conn = odbc_connect($aei_db, $user, $pass))

  {

$sql_open_jobs = select distinct jh.part, jh.date_due,
jd.job, jd.seq, jd.employee, jd.description, jd.Date_Sequence 

from v_job_header jh, v_job_detail jd 

where jd.job = jh.job and
jh.date_closed='1900-01-01' and jd.job not like '%IND%' and jd.suffix =
jh.suffix;

$rs_open_jobs = odbc_exec($conn, $sql_open_jobs);

  

echo $refresh_message;

  } 

  else

  {

if(!($conn = odbc_connect($aei_db, $user, $pass)))

{

  $refresh_message = This page has not been refreshed
since:  . date(h:i);

  echo $refresh_message;  

  $have_license = false;

}

  }

 

Thanks in advance

 

 

Richard Sharp

Database Administrator

PH: 316-942-8604 ext 108

 

Tenderness is what love looks like in private, Justice is what love
looks like in public - Cornel West

I am what I am because of who we all are - Ubuntu

 

 



[PHP] Re: PHP Error logging

2011-01-18 Thread Carlos Medina

Am 18.01.2011 01:33, schrieb Jimmy Stewpot:

Hello,

I currently have a strange issue where we are seeing 'random errors' being 
displayed to end users. What I find most interesting is that in the php.ini 
file we have the following error settings.

error_reporting  =  E_ALL  ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
track_errors = Off

I thought that if we had dislay_errors = Off then end users should never see 
errors displayed on the web page. However at apparently random times we do 
still see errors being reported, its not consistent at all. To give a better 
idea of the problem we have 8 web servers, they all run an identical copy of 
the site which is stored on a common netapp nfs filer. At apparently random 
times we see that 1 out of 8 servers will reported strange errors like 'use of 
undefined constant' or 'Undefined variable'. What's most strange about these 
errors is that if the code was faulty wouldn't we expect to see the errors on 
all web servers? and secondly wouldn't we expect to see the errors constantly 
rather than at apparently random intervals?

The php.ini files have a modify time of mid 2010 and yet this problem has only 
started in the last few weeks. Has anyone else experienced similar problems in 
the past and if so what was the root cause?

Regards,

Jimmy

Hi,
i think some developer has setting the display_errors with 
ini_set('display_errors', true);

this is why your become the problems now. Maybe this is a idea?

regards

Carlos

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP Error logging

2011-01-17 Thread Jimmy Stewpot
Hello,

I currently have a strange issue where we are seeing 'random errors' being 
displayed to end users. What I find most interesting is that in the php.ini 
file we have the following error settings.

error_reporting  =  E_ALL  ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
track_errors = Off

I thought that if we had dislay_errors = Off then end users should never see 
errors displayed on the web page. However at apparently random times we do 
still see errors being reported, its not consistent at all. To give a better 
idea of the problem we have 8 web servers, they all run an identical copy of 
the site which is stored on a common netapp nfs filer. At apparently random 
times we see that 1 out of 8 servers will reported strange errors like 'use of 
undefined constant' or 'Undefined variable'. What's most strange about these 
errors is that if the code was faulty wouldn't we expect to see the errors on 
all web servers? and secondly wouldn't we expect to see the errors constantly 
rather than at apparently random intervals?

The php.ini files have a modify time of mid 2010 and yet this problem has only 
started in the last few weeks. Has anyone else experienced similar problems in 
the past and if so what was the root cause? 

Regards,

Jimmy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Error logging

2011-01-17 Thread Daniel Brown
On Mon, Jan 17, 2011 at 19:33, Jimmy Stewpot mail...@oranged.to wrote:
 Hello,

 I currently have a strange issue where we are seeing 'random errors' being 
 displayed to end users. What I find most interesting is that in the php.ini 
 file we have the following error settings.

 error_reporting  =  E_ALL  ~E_NOTICE
 display_errors = Off
 display_startup_errors = Off
 log_errors = On
 log_errors_max_len = 1024
 ignore_repeated_errors = Off
 track_errors = Off

 I thought that if we had dislay_errors = Off then end users should never see 
 errors displayed on the web page. However at apparently random times we do 
 still see errors being reported, its not consistent at all. To give a better 
 idea of the problem we have 8 web servers, they all run an identical copy of 
 the site which is stored on a common netapp nfs filer. At apparently random 
 times we see that 1 out of 8 servers will reported strange errors like 'use 
 of undefined constant' or 'Undefined variable'. What's most strange about 
 these errors is that if the code was faulty wouldn't we expect to see the 
 errors on all web servers? and secondly wouldn't we expect to see the errors 
 constantly rather than at apparently random intervals?

 The php.ini files have a modify time of mid 2010 and yet this problem has 
 only started in the last few weeks. Has anyone else experienced similar 
 problems in the past and if so what was the root cause?

Sounds like someone added either ini_set('display_errors','On') in
the script being called or an include, added a local php.ini file to
the directory (or a parent directory), or added a php_flag to
.htaccess in the directory (or a parent).  Try checking into those
possibilities.



-- 
/Daniel P. Brown
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Querying Database

2010-12-20 Thread Ravi Gehlot
Trying to connect to the database can involve setting up your database. Make
sure that you have a valid login/password that is recognized by MySQL.
Please keep in mind that MySQL works on permission by hosts. So your host IP
must be matched with the username/password on the database for a successful
authentication. One way to know that you can connect successfully to your
remote database is to actually test it. Download MySQL Workbench from
Mysql.com and then try to connect to remote from the same host that your php
application is sitting at. If it works, thumbs up. If it does not then you
have a permission issue there. Add your username/host appropriately.

If you can connect without a hitch then you are doing something wrong on
your code. Use mysql_connect(), mysql_select_db() and then send an statement
and use the resource to see if it returns TRUE or FALSE. At this point, on
FALSE it means that you have a bad written statement.

There is so much that can go wrong. Debug step by step.

Ravi.


On Thu, Dec 16, 2010 at 9:26 PM, Phred White phpl...@planetphred.comwrote:

 It seems like there are several questions emerging, but ...

 Try echoing your query to the page by putting echo $query in your code
 before you call mysql, then copy it and run it in phpmyadmin. If it runs
 then you know your problem is somewhere else like the connection. This can
 really help you find typos that can cause mysterious results.

 If you want to use the same page to process the form (my preference) then
 put a hidden field in your form like:

input type=hidden name=phpaction id=phpaction value=process /

 and wrap the form processing code like so:

 if (isset($_POST['phpaction'])) {
//process submitted form data
 } else {
//processing for initial form entry
 }

 When the form is initially loaded it will ignore the first part
 There are a 1000 ways to do this, but this is pretty straightforward.

 On Dec 15, 2010, at 1:34 PM, Gary wrote:

 
  Steve Staples sstap...@mnsi.net wrote in message
  news:1292440837.5460.8.ca...@webdev01...
  On Wed, 2010-12-15 at 13:42 -0500, Gary wrote:
  I cant seem to get this to connect.  This is to my local testing
 server,
  which is on, so we need not worry that I have posted the UN/PW.
 
  This is a duplicate of a script I have used countless times and it
  worked.
  The error message is 'Error querying database.'
 
  Some one point out the error of my ways?
 
  Gary
 
 
  form action=?php echo $_SERVER[PHP_SELF]; ? method=post
  tr
  td
  labelName of Beer/label/tdtdinput name=beername type=text
 /
  /td
  /tr
  tr
  td
  labelMaker of Beer/label/tdtdinput name=manu type=text /
  /td
  /tr
  tr
  td
  labelType of Beer/label/td
  tdselect name=type size=1 id=type
   optionImported/option
   optionDomestic/option
   optionCraft/option
   optionLight/option
  /select
  !--select name=avail size=1 id=avail
   optionAvailable/option
   optionSold/option
  /select--
  /td
  /tr
  tr
  tdlabelSold in/label
  /tdtdinput type=checkbox name=singles value=Yes /
 Singlesbr
  /
  input type=checkbox name=six value=Yes / Six Packs br /
  input type=checkbox name=can value=Yes / Cansbr /
  input type=checkbox name=bottles value=Yes / Bottles br /
  input type=checkbox name=tap value=Yes / Draft br /
  tr
  td
  labelSize/label/tdtdinput name=size type=text /
  /td/tr
  trtd
  labelDescription/label/tdtdtextarea name=desc cols=40
  rows=5/textarea
  /td/tr
  trtd
  input name=submit type=submit value=Submit //td/tr
  /form
  /table
  /div
  div id=list
  ?php
  $beername = $_POST['beername'];
  $manu = $_POST['manu'];
  $type = $_POST['type'];
  $singles = $_POST['singles'];
  $six = $_POST['six'];
  $can = $_POST['can'];
  $bottles = $_POST['bottles'];
  $tap = $_POST['tap'];
  $size = $_POST['size'];
  $desc = $_POST['desc'];
  $ip= $_SERVER['REMOTE_ADDR'];
 
  $dbc = mysqli_connect('localhost','root','','rr')or die('Error
 connecting
  with MySQL Database');
 
  $query = INSERT INTO beer (beername, manu, type, singles, six, can,
  bottles, tap, size, desc, ip ). VALUES ('$beername', '$manu',
 '$type',
  '$singles', '$six', '$can', '$bottles', '$tap', '$size', '$desc',
  '$ip' );
 
  $result = mysqli_query($dbc, $query)
  or die('Error querying database.');
 
 
  mysqli_close($dbc);
 
 
 
  --
  Gary
 
 
  Read Ash's reply...   but basically, you're running the query with POST
  variables, and inserting them on page display as well as on form submit.
 
  can you ensure that you can connect from the command line?
 
 
  if you may take some criticism, you should rethink your database design,
  as well as the page flow/design... you should either post the form to a
  new page, or if it is back to itself, you should check to see that you
  have in fact posted it before just blindly inserting into the database
  (as currently, every time you view the page, you will insert into the
  database, even if completely empty values).
 
 
  Steve
 
  Thank you for your reply.
 
  I did not see a 

Re: [PHP] Error Querying Database

2010-12-16 Thread Phred White
It seems like there are several questions emerging, but ...

Try echoing your query to the page by putting echo $query in your code before 
you call mysql, then copy it and run it in phpmyadmin. If it runs then you know 
your problem is somewhere else like the connection. This can really help you 
find typos that can cause mysterious results.

If you want to use the same page to process the form (my preference) then put a 
hidden field in your form like:

input type=hidden name=phpaction id=phpaction value=process /

and wrap the form processing code like so:

if (isset($_POST['phpaction'])) {
//process submitted form data
} else {
//processing for initial form entry
}

When the form is initially loaded it will ignore the first part
There are a 1000 ways to do this, but this is pretty straightforward.

On Dec 15, 2010, at 1:34 PM, Gary wrote:

 
 Steve Staples sstap...@mnsi.net wrote in message 
 news:1292440837.5460.8.ca...@webdev01...
 On Wed, 2010-12-15 at 13:42 -0500, Gary wrote:
 I cant seem to get this to connect.  This is to my local testing server,
 which is on, so we need not worry that I have posted the UN/PW.
 
 This is a duplicate of a script I have used countless times and it 
 worked.
 The error message is 'Error querying database.'
 
 Some one point out the error of my ways?
 
 Gary
 
 
 form action=?php echo $_SERVER[PHP_SELF]; ? method=post
 tr
 td
 labelName of Beer/label/tdtdinput name=beername type=text /
 /td
 /tr
 tr
 td
 labelMaker of Beer/label/tdtdinput name=manu type=text /
 /td
 /tr
 tr
 td
 labelType of Beer/label/td
 tdselect name=type size=1 id=type
  optionImported/option
  optionDomestic/option
  optionCraft/option
  optionLight/option
 /select
 !--select name=avail size=1 id=avail
  optionAvailable/option
  optionSold/option
 /select--
 /td
 /tr
 tr
 tdlabelSold in/label
 /tdtdinput type=checkbox name=singles value=Yes / Singlesbr 
 /
 input type=checkbox name=six value=Yes / Six Packs br /
 input type=checkbox name=can value=Yes / Cansbr /
 input type=checkbox name=bottles value=Yes / Bottles br /
 input type=checkbox name=tap value=Yes / Draft br /
 tr
 td
 labelSize/label/tdtdinput name=size type=text /
 /td/tr
 trtd
 labelDescription/label/tdtdtextarea name=desc cols=40
 rows=5/textarea
 /td/tr
 trtd
 input name=submit type=submit value=Submit //td/tr
 /form
 /table
 /div
 div id=list
 ?php
 $beername = $_POST['beername'];
 $manu = $_POST['manu'];
 $type = $_POST['type'];
 $singles = $_POST['singles'];
 $six = $_POST['six'];
 $can = $_POST['can'];
 $bottles = $_POST['bottles'];
 $tap = $_POST['tap'];
 $size = $_POST['size'];
 $desc = $_POST['desc'];
 $ip= $_SERVER['REMOTE_ADDR'];
 
 $dbc = mysqli_connect('localhost','root','','rr')or die('Error connecting
 with MySQL Database');
 
 $query = INSERT INTO beer (beername, manu, type, singles, six, can,
 bottles, tap, size, desc, ip ). VALUES ('$beername', '$manu', '$type',
 '$singles', '$six', '$can', '$bottles', '$tap', '$size', '$desc', 
 '$ip' );
 
 $result = mysqli_query($dbc, $query)
 or die('Error querying database.');
 
 
 mysqli_close($dbc);
 
 
 
 -- 
 Gary
 
 
 Read Ash's reply...   but basically, you're running the query with POST
 variables, and inserting them on page display as well as on form submit.
 
 can you ensure that you can connect from the command line?
 
 
 if you may take some criticism, you should rethink your database design,
 as well as the page flow/design... you should either post the form to a
 new page, or if it is back to itself, you should check to see that you
 have in fact posted it before just blindly inserting into the database
 (as currently, every time you view the page, you will insert into the
 database, even if completely empty values).
 
 
 Steve
 
 Thank you for your reply.
 
 I did not see a reply from Ashley, but I would love to read it.
 
 I always welcome criticism, however this form is for the owner of a bar 
 where he will inputing his list of beer that he sells.  The rest of the code 
 that is not there is I will have the list then echo to screen below the 
 form.  This is an internal list only, no customers will be seeing itif 
 that makes any difference to your suggestion.
 
 On your one point
 
 (as currently, every time you view the page, you will insert into the
 database, even if completely empty values).
 
 Is this always the case when you process a form onto itself?  Or is there a 
 fix?
 
 I did just create a new page, inserted the script onto it, and got the same 
 error message.
 
 Again, thank you for your help.
 
 Gary 
 
 
 
 __ Information from ESET Smart Security, version of virus signature 
 database 5706 (20101215) __
 
 The message was checked by ESET Smart Security.
 
 http://www.eset.com
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



[PHP] Error Querying Database

2010-12-15 Thread Gary
I cant seem to get this to connect.  This is to my local testing server, 
which is on, so we need not worry that I have posted the UN/PW.

This is a duplicate of a script I have used countless times and it worked. 
The error message is 'Error querying database.'

Some one point out the error of my ways?

Gary


form action=?php echo $_SERVER[PHP_SELF]; ? method=post
tr
td
labelName of Beer/label/tdtdinput name=beername type=text /
/td
/tr
tr
td
labelMaker of Beer/label/tdtdinput name=manu type=text /
/td
/tr
tr
td
labelType of Beer/label/td
tdselect name=type size=1 id=type
  optionImported/option
  optionDomestic/option
  optionCraft/option
  optionLight/option
/select
!--select name=avail size=1 id=avail
  optionAvailable/option
  optionSold/option
/select--
/td
/tr
tr
tdlabelSold in/label
/tdtdinput type=checkbox name=singles value=Yes / Singlesbr /
input type=checkbox name=six value=Yes / Six Packs br /
input type=checkbox name=can value=Yes / Cansbr /
input type=checkbox name=bottles value=Yes / Bottles br /
input type=checkbox name=tap value=Yes / Draft br /
tr
td
labelSize/label/tdtdinput name=size type=text /
/td/tr
trtd
labelDescription/label/tdtdtextarea name=desc cols=40 
rows=5/textarea
/td/tr
trtd
input name=submit type=submit value=Submit //td/tr
/form
/table
/div
div id=list
?php
$beername = $_POST['beername'];
$manu = $_POST['manu'];
$type = $_POST['type'];
$singles = $_POST['singles'];
$six = $_POST['six'];
$can = $_POST['can'];
$bottles = $_POST['bottles'];
$tap = $_POST['tap'];
$size = $_POST['size'];
$desc = $_POST['desc'];
$ip= $_SERVER['REMOTE_ADDR'];

$dbc = mysqli_connect('localhost','root','','rr')or die('Error connecting 
with MySQL Database');

$query = INSERT INTO beer (beername, manu, type, singles, six, can, 
bottles, tap, size, desc, ip ). VALUES ('$beername', '$manu', '$type', 
'$singles', '$six', '$can', '$bottles', '$tap', '$size', '$desc', '$ip' );

$result = mysqli_query($dbc, $query)
or die('Error querying database.');


mysqli_close($dbc);



-- 
Gary 



__ Information from ESET Smart Security, version of virus signature 
database 5706 (20101215) __

The message was checked by ESET Smart Security.

http://www.eset.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Querying Database

2010-12-15 Thread Daniel P. Brown
On Wed, Dec 15, 2010 at 13:42, Gary gp...@paulgdesigns.com wrote:
 I cant seem to get this to connect.  This is to my local testing server,
 which is on, so we need not worry that I have posted the UN/PW.

 This is a duplicate of a script I have used countless times and it worked.
 The error message is 'Error querying database.'

 Some one point out the error of my ways?

Replace:

or die('Error querying database.');

With:

or die('Error querying database.  MySQL said: '.mysql_error());

-- 
/Daniel P. Brown
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Querying Database

2010-12-15 Thread Gary
Daniel P. Brown daniel.br...@parasane.net wrote in message 
news:aanlkti=gemvzmpjg1uvb4_tdacqlbzyfjcgvd+har...@mail.gmail.com...
On Wed, Dec 15, 2010 at 13:42, Gary gp...@paulgdesigns.com wrote:
 I cant seem to get this to connect. This is to my local testing server,
 which is on, so we need not worry that I have posted the UN/PW.

 This is a duplicate of a script I have used countless times and it worked.
 The error message is 'Error querying database.'

 Some one point out the error of my ways?

Replace:

or die('Error querying database.');

With:

or die('Error querying database.  MySQL said: '.mysql_error());

-- 
/Daniel P. Brown
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

Daniel

Thank you for your reply, the new error message is

Error querying database. MySQL said:

Gary





__ Information from ESET Smart Security, version of virus signature 
database 5706 (20101215) __

The message was checked by ESET Smart Security.

http://www.eset.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Querying Database

2010-12-15 Thread Steve Staples
On Wed, 2010-12-15 at 13:42 -0500, Gary wrote:
 I cant seem to get this to connect.  This is to my local testing server, 
 which is on, so we need not worry that I have posted the UN/PW.
 
 This is a duplicate of a script I have used countless times and it worked. 
 The error message is 'Error querying database.'
 
 Some one point out the error of my ways?
 
 Gary
 
 
 form action=?php echo $_SERVER[PHP_SELF]; ? method=post
 tr
 td
 labelName of Beer/label/tdtdinput name=beername type=text /
 /td
 /tr
 tr
 td
 labelMaker of Beer/label/tdtdinput name=manu type=text /
 /td
 /tr
 tr
 td
 labelType of Beer/label/td
 tdselect name=type size=1 id=type
   optionImported/option
   optionDomestic/option
   optionCraft/option
   optionLight/option
 /select
 !--select name=avail size=1 id=avail
   optionAvailable/option
   optionSold/option
 /select--
 /td
 /tr
 tr
 tdlabelSold in/label
 /tdtdinput type=checkbox name=singles value=Yes / Singlesbr /
 input type=checkbox name=six value=Yes / Six Packs br /
 input type=checkbox name=can value=Yes / Cansbr /
 input type=checkbox name=bottles value=Yes / Bottles br /
 input type=checkbox name=tap value=Yes / Draft br /
 tr
 td
 labelSize/label/tdtdinput name=size type=text /
 /td/tr
 trtd
 labelDescription/label/tdtdtextarea name=desc cols=40 
 rows=5/textarea
 /td/tr
 trtd
 input name=submit type=submit value=Submit //td/tr
 /form
 /table
 /div
 div id=list
 ?php
 $beername = $_POST['beername'];
 $manu = $_POST['manu'];
 $type = $_POST['type'];
 $singles = $_POST['singles'];
 $six = $_POST['six'];
 $can = $_POST['can'];
 $bottles = $_POST['bottles'];
 $tap = $_POST['tap'];
 $size = $_POST['size'];
 $desc = $_POST['desc'];
 $ip= $_SERVER['REMOTE_ADDR'];
 
 $dbc = mysqli_connect('localhost','root','','rr')or die('Error connecting 
 with MySQL Database');
 
 $query = INSERT INTO beer (beername, manu, type, singles, six, can, 
 bottles, tap, size, desc, ip ). VALUES ('$beername', '$manu', '$type', 
 '$singles', '$six', '$can', '$bottles', '$tap', '$size', '$desc', '$ip' );
 
 $result = mysqli_query($dbc, $query)
 or die('Error querying database.');
 
 
 mysqli_close($dbc);
 
 
 
 -- 
 Gary 


Read Ash's reply...   but basically, you're running the query with POST
variables, and inserting them on page display as well as on form submit.

can you ensure that you can connect from the command line?


if you may take some criticism, you should rethink your database design,
as well as the page flow/design... you should either post the form to a
new page, or if it is back to itself, you should check to see that you
have in fact posted it before just blindly inserting into the database
(as currently, every time you view the page, you will insert into the
database, even if completely empty values).



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Querying Database

2010-12-15 Thread Gary

Steve Staples sstap...@mnsi.net wrote in message 
news:1292440837.5460.8.ca...@webdev01...
 On Wed, 2010-12-15 at 13:42 -0500, Gary wrote:
 I cant seem to get this to connect.  This is to my local testing server,
 which is on, so we need not worry that I have posted the UN/PW.

 This is a duplicate of a script I have used countless times and it 
 worked.
 The error message is 'Error querying database.'

 Some one point out the error of my ways?

 Gary


 form action=?php echo $_SERVER[PHP_SELF]; ? method=post
 tr
 td
 labelName of Beer/label/tdtdinput name=beername type=text /
 /td
 /tr
 tr
 td
 labelMaker of Beer/label/tdtdinput name=manu type=text /
 /td
 /tr
 tr
 td
 labelType of Beer/label/td
 tdselect name=type size=1 id=type
   optionImported/option
   optionDomestic/option
   optionCraft/option
   optionLight/option
 /select
 !--select name=avail size=1 id=avail
   optionAvailable/option
   optionSold/option
 /select--
 /td
 /tr
 tr
 tdlabelSold in/label
 /tdtdinput type=checkbox name=singles value=Yes / Singlesbr 
 /
 input type=checkbox name=six value=Yes / Six Packs br /
 input type=checkbox name=can value=Yes / Cansbr /
 input type=checkbox name=bottles value=Yes / Bottles br /
 input type=checkbox name=tap value=Yes / Draft br /
 tr
 td
 labelSize/label/tdtdinput name=size type=text /
 /td/tr
 trtd
 labelDescription/label/tdtdtextarea name=desc cols=40
 rows=5/textarea
 /td/tr
 trtd
 input name=submit type=submit value=Submit //td/tr
 /form
 /table
 /div
 div id=list
 ?php
 $beername = $_POST['beername'];
 $manu = $_POST['manu'];
 $type = $_POST['type'];
 $singles = $_POST['singles'];
 $six = $_POST['six'];
 $can = $_POST['can'];
 $bottles = $_POST['bottles'];
 $tap = $_POST['tap'];
 $size = $_POST['size'];
 $desc = $_POST['desc'];
 $ip= $_SERVER['REMOTE_ADDR'];

 $dbc = mysqli_connect('localhost','root','','rr')or die('Error connecting
 with MySQL Database');

 $query = INSERT INTO beer (beername, manu, type, singles, six, can,
 bottles, tap, size, desc, ip ). VALUES ('$beername', '$manu', '$type',
 '$singles', '$six', '$can', '$bottles', '$tap', '$size', '$desc', 
 '$ip' );

 $result = mysqli_query($dbc, $query)
 or die('Error querying database.');


 mysqli_close($dbc);



 -- 
 Gary


 Read Ash's reply...   but basically, you're running the query with POST
 variables, and inserting them on page display as well as on form submit.

 can you ensure that you can connect from the command line?


 if you may take some criticism, you should rethink your database design,
 as well as the page flow/design... you should either post the form to a
 new page, or if it is back to itself, you should check to see that you
 have in fact posted it before just blindly inserting into the database
 (as currently, every time you view the page, you will insert into the
 database, even if completely empty values).


Steve

Thank you for your reply.

I did not see a reply from Ashley, but I would love to read it.

I always welcome criticism, however this form is for the owner of a bar 
where he will inputing his list of beer that he sells.  The rest of the code 
that is not there is I will have the list then echo to screen below the 
form.  This is an internal list only, no customers will be seeing itif 
that makes any difference to your suggestion.

On your one point

(as currently, every time you view the page, you will insert into the
database, even if completely empty values).

Is this always the case when you process a form onto itself?  Or is there a 
fix?

I did just create a new page, inserted the script onto it, and got the same 
error message.

Again, thank you for your help.

Gary 



__ Information from ESET Smart Security, version of virus signature 
database 5706 (20101215) __

The message was checked by ESET Smart Security.

http://www.eset.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Querying Database

2010-12-15 Thread Steve Staples
On Wed, 2010-12-15 at 14:34 -0500, Gary wrote:
 Steve Staples sstap...@mnsi.net wrote in message 
 news:1292440837.5460.8.ca...@webdev01...
  On Wed, 2010-12-15 at 13:42 -0500, Gary wrote:
  I cant seem to get this to connect.  This is to my local testing server,
  which is on, so we need not worry that I have posted the UN/PW.
 
  This is a duplicate of a script I have used countless times and it 
  worked.
  The error message is 'Error querying database.'
 
  Some one point out the error of my ways?
 
  Gary
 
 
  form action=?php echo $_SERVER[PHP_SELF]; ? method=post
  tr
  td
  labelName of Beer/label/tdtdinput name=beername type=text /
  /td
  /tr
  tr
  td
  labelMaker of Beer/label/tdtdinput name=manu type=text /
  /td
  /tr
  tr
  td
  labelType of Beer/label/td
  tdselect name=type size=1 id=type
optionImported/option
optionDomestic/option
optionCraft/option
optionLight/option
  /select
  !--select name=avail size=1 id=avail
optionAvailable/option
optionSold/option
  /select--
  /td
  /tr
  tr
  tdlabelSold in/label
  /tdtdinput type=checkbox name=singles value=Yes / Singlesbr 
  /
  input type=checkbox name=six value=Yes / Six Packs br /
  input type=checkbox name=can value=Yes / Cansbr /
  input type=checkbox name=bottles value=Yes / Bottles br /
  input type=checkbox name=tap value=Yes / Draft br /
  tr
  td
  labelSize/label/tdtdinput name=size type=text /
  /td/tr
  trtd
  labelDescription/label/tdtdtextarea name=desc cols=40
  rows=5/textarea
  /td/tr
  trtd
  input name=submit type=submit value=Submit //td/tr
  /form
  /table
  /div
  div id=list
  ?php
  $beername = $_POST['beername'];
  $manu = $_POST['manu'];
  $type = $_POST['type'];
  $singles = $_POST['singles'];
  $six = $_POST['six'];
  $can = $_POST['can'];
  $bottles = $_POST['bottles'];
  $tap = $_POST['tap'];
  $size = $_POST['size'];
  $desc = $_POST['desc'];
  $ip= $_SERVER['REMOTE_ADDR'];
 
  $dbc = mysqli_connect('localhost','root','','rr')or die('Error connecting
  with MySQL Database');
 
  $query = INSERT INTO beer (beername, manu, type, singles, six, can,
  bottles, tap, size, desc, ip ). VALUES ('$beername', '$manu', '$type',
  '$singles', '$six', '$can', '$bottles', '$tap', '$size', '$desc', 
  '$ip' );
 
  $result = mysqli_query($dbc, $query)
  or die('Error querying database.');
 
 
  mysqli_close($dbc);
 
 
 
  -- 
  Gary
 
 
  Read Ash's reply...   but basically, you're running the query with POST
  variables, and inserting them on page display as well as on form submit.
 
  can you ensure that you can connect from the command line?
 
 
  if you may take some criticism, you should rethink your database design,
  as well as the page flow/design... you should either post the form to a
  new page, or if it is back to itself, you should check to see that you
  have in fact posted it before just blindly inserting into the database
  (as currently, every time you view the page, you will insert into the
  database, even if completely empty values).
 
 
 Steve
 
 Thank you for your reply.
 
 I did not see a reply from Ashley, but I would love to read it.
 
 I always welcome criticism, however this form is for the owner of a bar 
 where he will inputing his list of beer that he sells.  The rest of the code 
 that is not there is I will have the list then echo to screen below the 
 form.  This is an internal list only, no customers will be seeing itif 
 that makes any difference to your suggestion.
 
 On your one point
 
 (as currently, every time you view the page, you will insert into the
 database, even if completely empty values).
 
 Is this always the case when you process a form onto itself?  Or is there a 
 fix?
 
 I did just create a new page, inserted the script onto it, and got the same 
 error message.
 
 Again, thank you for your help.
 
 Gary 


Gary

the line:
input name=submit type=submit value=Submit /

is the submit part... if you encapsulate the DB part of the code,
within:
if($_POST['submit'] == 'Submit')
{
# do db stuff in here and value sanitizing
}

basically, what that does is the submit button is name $_POST['submit']
and has the value Submit (the 'value' of the button) which will not be
set, until you submit the form.   Personally, I do it another way, but
but is how most people check to see if a form is submitted (i think?)

but it seems as if your issue stems from the lack of being able to
connect to the database itself, so either your login credentials are
wrong, or you dont have the mysqli connector enabled with your php in
your development box.

check your phpinfo() to ensure it is enabled.

Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Querying Database

2010-12-15 Thread Ashley Sheridan
On Wed, 2010-12-15 at 14:44 -0500, Steve Staples wrote:

 On Wed, 2010-12-15 at 14:34 -0500, Gary wrote:
  Steve Staples sstap...@mnsi.net wrote in message 
  news:1292440837.5460.8.ca...@webdev01...
   On Wed, 2010-12-15 at 13:42 -0500, Gary wrote:
   I cant seem to get this to connect.  This is to my local testing server,
   which is on, so we need not worry that I have posted the UN/PW.
  
   This is a duplicate of a script I have used countless times and it 
   worked.
   The error message is 'Error querying database.'
  
   Some one point out the error of my ways?
  
   Gary
  
  
   form action=?php echo $_SERVER[PHP_SELF]; ? method=post
   tr
   td
   labelName of Beer/label/tdtdinput name=beername type=text /
   /td
   /tr
   tr
   td
   labelMaker of Beer/label/tdtdinput name=manu type=text /
   /td
   /tr
   tr
   td
   labelType of Beer/label/td
   tdselect name=type size=1 id=type
 optionImported/option
 optionDomestic/option
 optionCraft/option
 optionLight/option
   /select
   !--select name=avail size=1 id=avail
 optionAvailable/option
 optionSold/option
   /select--
   /td
   /tr
   tr
   tdlabelSold in/label
   /tdtdinput type=checkbox name=singles value=Yes / Singlesbr 
   /
   input type=checkbox name=six value=Yes / Six Packs br /
   input type=checkbox name=can value=Yes / Cansbr /
   input type=checkbox name=bottles value=Yes / Bottles br /
   input type=checkbox name=tap value=Yes / Draft br /
   tr
   td
   labelSize/label/tdtdinput name=size type=text /
   /td/tr
   trtd
   labelDescription/label/tdtdtextarea name=desc cols=40
   rows=5/textarea
   /td/tr
   trtd
   input name=submit type=submit value=Submit //td/tr
   /form
   /table
   /div
   div id=list
   ?php
   $beername = $_POST['beername'];
   $manu = $_POST['manu'];
   $type = $_POST['type'];
   $singles = $_POST['singles'];
   $six = $_POST['six'];
   $can = $_POST['can'];
   $bottles = $_POST['bottles'];
   $tap = $_POST['tap'];
   $size = $_POST['size'];
   $desc = $_POST['desc'];
   $ip= $_SERVER['REMOTE_ADDR'];
  
   $dbc = mysqli_connect('localhost','root','','rr')or die('Error connecting
   with MySQL Database');
  
   $query = INSERT INTO beer (beername, manu, type, singles, six, can,
   bottles, tap, size, desc, ip ). VALUES ('$beername', '$manu', '$type',
   '$singles', '$six', '$can', '$bottles', '$tap', '$size', '$desc', 
   '$ip' );
  
   $result = mysqli_query($dbc, $query)
   or die('Error querying database.');
  
  
   mysqli_close($dbc);
  
  
  
   -- 
   Gary
  
  
   Read Ash's reply...   but basically, you're running the query with POST
   variables, and inserting them on page display as well as on form submit.
  
   can you ensure that you can connect from the command line?
  
  
   if you may take some criticism, you should rethink your database design,
   as well as the page flow/design... you should either post the form to a
   new page, or if it is back to itself, you should check to see that you
   have in fact posted it before just blindly inserting into the database
   (as currently, every time you view the page, you will insert into the
   database, even if completely empty values).
  
  
  Steve
  
  Thank you for your reply.
  
  I did not see a reply from Ashley, but I would love to read it.
  
  I always welcome criticism, however this form is for the owner of a bar 
  where he will inputing his list of beer that he sells.  The rest of the 
  code 
  that is not there is I will have the list then echo to screen below the 
  form.  This is an internal list only, no customers will be seeing itif 
  that makes any difference to your suggestion.
  
  On your one point
  
  (as currently, every time you view the page, you will insert into the
  database, even if completely empty values).
  
  Is this always the case when you process a form onto itself?  Or is there a 
  fix?
  
  I did just create a new page, inserted the script onto it, and got the same 
  error message.
  
  Again, thank you for your help.
  
  Gary 
 
 
 Gary
 
 the line:
 input name=submit type=submit value=Submit /
 
 is the submit part... if you encapsulate the DB part of the code,
 within:
 if($_POST['submit'] == 'Submit')
 {
 # do db stuff in here and value sanitizing
 }
 
 basically, what that does is the submit button is name $_POST['submit']
 and has the value Submit (the 'value' of the button) which will not be
 set, until you submit the form.   Personally, I do it another way, but
 but is how most people check to see if a form is submitted (i think?)
 
 but it seems as if your issue stems from the lack of being able to
 connect to the database itself, so either your login credentials are
 wrong, or you dont have the mysqli connector enabled with your php in
 your development box.
 
 check your phpinfo() to ensure it is enabled.
 
 Steve
 
 


Echo out the $query string to see if it was you expect, but like a few
of us have said so far, you need to check that the form is submitted

Re: [PHP] Error Querying Database

2010-12-15 Thread Gary

Sent: Wednesday, December 15, 2010 2:44 PM
Subject: Re: [PHP] Error Querying Database

  On Wed, 2010-12-15 at 13:42 -0500, Gary wrote:
  I cant seem to get this to connect.  This is to my local testing
  server,
  which is on, so we need not worry that I have posted the UN/PW.
 
  This is a duplicate of a script I have used countless times and it
  worked.
  The error message is 'Error querying database.'
 
  Some one point out the error of my ways?
 
  Gary
 
 
  form action=?php echo $_SERVER[PHP_SELF]; ? method=post
  tr
  td
  labelName of Beer/label/tdtdinput name=beername type=text
  /
  /td
  /tr
  tr
  td
  labelMaker of Beer/label/tdtdinput name=manu type=text /
  /td
  /tr
  tr
  td
  labelType of Beer/label/td
  tdselect name=type size=1 id=type
optionImported/option
optionDomestic/option
optionCraft/option
optionLight/option
  /select
  !--select name=avail size=1 id=avail
optionAvailable/option
optionSold/option
  /select--
  /td
  /tr
  tr
  tdlabelSold in/label
  /tdtdinput type=checkbox name=singles value=Yes /
  Singlesbr
  /
  input type=checkbox name=six value=Yes / Six Packs br /
  input type=checkbox name=can value=Yes / Cansbr /
  input type=checkbox name=bottles value=Yes / Bottles br /
  input type=checkbox name=tap value=Yes / Draft br /
  tr
  td
  labelSize/label/tdtdinput name=size type=text /
  /td/tr
  trtd
  labelDescription/label/tdtdtextarea name=desc cols=40
  rows=5/textarea
  /td/tr
  trtd
  input name=submit type=submit value=Submit //td/tr
  /form
  /table
  /div
  div id=list
  ?php
  $beername = $_POST['beername'];
  $manu = $_POST['manu'];
  $type = $_POST['type'];
  $singles = $_POST['singles'];
  $six = $_POST['six'];
  $can = $_POST['can'];
  $bottles = $_POST['bottles'];
  $tap = $_POST['tap'];
  $size = $_POST['size'];
  $desc = $_POST['desc'];
  $ip= $_SERVER['REMOTE_ADDR'];
 
  $dbc = mysqli_connect('localhost','root','','rr')or die('Error
  connecting
  with MySQL Database');
 
  $query = INSERT INTO beer (beername, manu, type, singles, six, can,
  bottles, tap, size, desc, ip ). VALUES ('$beername', '$manu',
  '$type',
  '$singles', '$six', '$can', '$bottles', '$tap', '$size', '$desc',
  '$ip' );
 
  $result = mysqli_query($dbc, $query)
  or die('Error querying database.');
 
 
  mysqli_close($dbc);
 
 
 
  -- 
  Gary
 
 
  Read Ash's reply...   but basically, you're running the query with POST
  variables, and inserting them on page display as well as on form
  submit.
 
  can you ensure that you can connect from the command line?
 
 
  if you may take some criticism, you should rethink your database
  design,
  as well as the page flow/design... you should either post the form to a
  new page, or if it is back to itself, you should check to see that you
  have in fact posted it before just blindly inserting into the database
  (as currently, every time you view the page, you will insert into the
  database, even if completely empty values).
 

 Steve

 Thank you for your reply.

 I did not see a reply from Ashley, but I would love to read it.

 I always welcome criticism, however this form is for the owner of a bar
 where he will inputing his list of beer that he sells.  The rest of the
 code
 that is not there is I will have the list then echo to screen below the
 form.  This is an internal list only, no customers will be seeing
 itif
 that makes any difference to your suggestion.

 On your one point

 (as currently, every time you view the page, you will insert into the
 database, even if completely empty values).

 Is this always the case when you process a form onto itself?  Or is there
 a
 fix?

 I did just create a new page, inserted the script onto it, and got the
 same
 error message.

 Again, thank you for your help.

 Gary


 Gary

 the line:
 input name=submit type=submit value=Submit /

 is the submit part... if you encapsulate the DB part of the code,
 within:
 if($_POST['submit'] == 'Submit')
 {
# do db stuff in here and value sanitizing
 }

 basically, what that does is the submit button is name $_POST['submit']
 and has the value Submit (the 'value' of the button) which will not be
 set, until you submit the form.   Personally, I do it another way, but
 but is how most people check to see if a form is submitted (i think?)

 but it seems as if your issue stems from the lack of being able to
 connect to the database itself, so either your login credentials are
 wrong, or you dont have the mysqli connector enabled with your php in
 your development box.

 check your phpinfo() to ensure it is enabled.

 Steve

Steve

Again thank you, here is my phpini information, so it would seem mysqli is
enabled


  MysqlI Support enabled
  Client API library version  5.1.41
  Active Persistent Links  0
  Inactive Persistent Links  0
  Active Links  13
  Client API header version  5.1.41
  MYSQLI_SOCKET  MySQL

  Directive Local Value Master Value
  mysqli.allow_local_infile

Re: [PHP] Error Querying Database

2010-12-15 Thread Bastien Koert
On Wed, Dec 15, 2010 at 3:11 PM, Gary gp...@paulgdesigns.com wrote:

 Sent: Wednesday, December 15, 2010 2:44 PM
 Subject: Re: [PHP] Error Querying Database

  On Wed, 2010-12-15 at 13:42 -0500, Gary wrote:
  I cant seem to get this to connect.  This is to my local testing
  server,
  which is on, so we need not worry that I have posted the UN/PW.
 
  This is a duplicate of a script I have used countless times and it
  worked.
  The error message is 'Error querying database.'
 
  Some one point out the error of my ways?
 
  Gary
 
 
  form action=?php echo $_SERVER[PHP_SELF]; ? method=post
  tr
  td
  labelName of Beer/label/tdtdinput name=beername type=text
  /
  /td
  /tr
  tr
  td
  labelMaker of Beer/label/tdtdinput name=manu type=text /
  /td
  /tr
  tr
  td
  labelType of Beer/label/td
  tdselect name=type size=1 id=type
    optionImported/option
    optionDomestic/option
    optionCraft/option
    optionLight/option
  /select
  !--select name=avail size=1 id=avail
    optionAvailable/option
    optionSold/option
  /select--
  /td
  /tr
  tr
  tdlabelSold in/label
  /tdtdinput type=checkbox name=singles value=Yes /
  Singlesbr
  /
  input type=checkbox name=six value=Yes / Six Packs br /
  input type=checkbox name=can value=Yes / Cansbr /
  input type=checkbox name=bottles value=Yes / Bottles br /
  input type=checkbox name=tap value=Yes / Draft br /
  tr
  td
  labelSize/label/tdtdinput name=size type=text /
  /td/tr
  trtd
  labelDescription/label/tdtdtextarea name=desc cols=40
  rows=5/textarea
  /td/tr
  trtd
  input name=submit type=submit value=Submit //td/tr
  /form
  /table
  /div
  div id=list
  ?php
  $beername = $_POST['beername'];
  $manu = $_POST['manu'];
  $type = $_POST['type'];
  $singles = $_POST['singles'];
  $six = $_POST['six'];
  $can = $_POST['can'];
  $bottles = $_POST['bottles'];
  $tap = $_POST['tap'];
  $size = $_POST['size'];
  $desc = $_POST['desc'];
  $ip= $_SERVER['REMOTE_ADDR'];
 
  $dbc = mysqli_connect('localhost','root','','rr')or die('Error
  connecting
  with MySQL Database');
 
  $query = INSERT INTO beer (beername, manu, type, singles, six, can,
  bottles, tap, size, desc, ip ). VALUES ('$beername', '$manu',
  '$type',
  '$singles', '$six', '$can', '$bottles', '$tap', '$size', '$desc',
  '$ip' );
 
  $result = mysqli_query($dbc, $query)
  or die('Error querying database.');
 
 
  mysqli_close($dbc);
 
 
 
  --
  Gary
 
 
  Read Ash's reply...   but basically, you're running the query with POST
  variables, and inserting them on page display as well as on form
  submit.
 
  can you ensure that you can connect from the command line?
 
 
  if you may take some criticism, you should rethink your database
  design,
  as well as the page flow/design... you should either post the form to a
  new page, or if it is back to itself, you should check to see that you
  have in fact posted it before just blindly inserting into the database
  (as currently, every time you view the page, you will insert into the
  database, even if completely empty values).
 

 Steve

 Thank you for your reply.

 I did not see a reply from Ashley, but I would love to read it.

 I always welcome criticism, however this form is for the owner of a bar
 where he will inputing his list of beer that he sells.  The rest of the
 code
 that is not there is I will have the list then echo to screen below the
 form.  This is an internal list only, no customers will be seeing
 itif
 that makes any difference to your suggestion.

 On your one point

 (as currently, every time you view the page, you will insert into the
 database, even if completely empty values).

 Is this always the case when you process a form onto itself?  Or is there
 a
 fix?

 I did just create a new page, inserted the script onto it, and got the
 same
 error message.

 Again, thank you for your help.

 Gary


 Gary

 the line:
 input name=submit type=submit value=Submit /

 is the submit part... if you encapsulate the DB part of the code,
 within:
 if($_POST['submit'] == 'Submit')
 {
    # do db stuff in here and value sanitizing
 }

 basically, what that does is the submit button is name $_POST['submit']
 and has the value Submit (the 'value' of the button) which will not be
 set, until you submit the form.   Personally, I do it another way, but
 but is how most people check to see if a form is submitted (i think?)

 but it seems as if your issue stems from the lack of being able to
 connect to the database itself, so either your login credentials are
 wrong, or you dont have the mysqli connector enabled with your php in
 your development box.

 check your phpinfo() to ensure it is enabled.

 Steve

 Steve

 Again thank you, here is my phpini information, so it would seem mysqli is
 enabled


      MysqlI Support enabled
      Client API library version  5.1.41
      Active Persistent Links  0
      Inactive Persistent Links  0
      Active Links  13
      Client API header version  5.1.41
      MYSQLI_SOCKET  MySQL

[PHP] Is there a way to write to the php error log from a php script?

2010-10-22 Thread Tamara Temple
I'm trying to log some data for debugging and don't have use of the  
standard output to do so. I'd like to write the info to the php error  
log. Can this be done from within PHP? I've searched the web site for  
logging functions, but cannot find any.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is there a way to write to the php error log from a php script?

2010-10-22 Thread Daniel P. Brown
On Fri, Oct 22, 2010 at 20:24, Tamara Temple tamouse.li...@gmail.com wrote:
 I'm trying to log some data for debugging and don't have use of the standard
 output to do so. I'd like to write the info to the php error log. Can this
 be done from within PHP? I've searched the web site for logging functions,
 but cannot find any.

Sure.  You can use trigger_error() and error_log() for that.

-- 
/Daniel P. Brown
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is there a way to write to the php error log from a php script?

2010-10-22 Thread Tamara Temple


On Oct 22, 2010, at 7:31 PM, Daniel P. Brown wrote:

On Fri, Oct 22, 2010 at 20:24, Tamara Temple  
tamouse.li...@gmail.com wrote:
I'm trying to log some data for debugging and don't have use of the  
standard
output to do so. I'd like to write the info to the php error log.  
Can this
be done from within PHP? I've searched the web site for logging  
functions,

but cannot find any.


   Sure.  You can use trigger_error() and error_log() for that.


Ah, yes, error_log() is precisely what I'm looking for. Seaching for  
log gave me the log function, searching for logging gave me a  
bunch of references I couldn't follow (for some reason the feeds want  
to open in my Mail.app client and create RSS feeds -- less than useful).




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Error handler script

2010-10-20 Thread Teto
Hi,

I've been wondering if there was any php project focusing on providing
a neat php error handler ?
Up to now, I've been coding mine but I've seen videos on the web where
a guy was using a really impressive php error_handler. Of course I
could code it but if there was something generic I could use in
different projets,that could be useful.

Thx for any tip

matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error message not understood

2010-10-18 Thread sueandant
I'm running PHP as module with Apache.   The version I downloaded was your 
[1], tho it wa version 5.2.14.   When I downloaded and unzipped the files I 
had already installed MySql Ver 14.14 Distrib 5.1.51 for Win32(ia32).


Thanks for the help.

tholland
- Original Message - 
From: Tommy Pham tommy...@gmail.com

To: 'sueandant' hollandsath...@tiscali.co.uk
Cc: 'PHP' php-general@lists.php.net
Sent: Saturday, October 16, 2010 10:49 PM
Subject: RE: [PHP] Error message not understood



-Original Message-
From: sueandant [mailto:hollandsath...@tiscali.co.uk]
Sent: Saturday, October 16, 2010 2:23 PM
To: Tommy Pham
Cc: PHP
Subject: Re: [PHP] Error message not understood

Apologies!   Vista Home Premium 32bit with SP2.   I uninstalled it using
Windows' uninstaller.   I didn't compile any of the packages.   MySQL was
installed using the .msi download and PHP I simply unzipped to my C:\PHP
folder.   And, yes, they both came from the official sites.



Forgot to mention something, please don't top post.  It makes hard for
others to follow the thread.

Are you running PHP with IIS or Apache?  If with Apache how are you 
running

PHP as, CGI or module?  Since you're using official distributions, you'll
have to use PHP VC6 TS build (if not using as CGI/FastCGI) for Apache [1].
If you're running PHP with IIS, you'll have to run NTS build for FastCGI
[2].

[1] http://windows.php.net/downloads/releases/php-5.3.3-Win32-VC6-x86.zip
[2]
http://windows.php.net/downloads/releases/php-5.3.3-nts-Win32-VC9-x86.zip


- Original Message -
From: Tommy Pham tommy...@gmail.com
To: 'sueandant' hollandsath...@tiscali.co.uk; 'Luigi Pressello'
rad...@gmail.com
Cc: 'PHP' php-general@lists.php.net
Sent: Saturday, October 16, 2010 9:38 PM
Subject: RE: [PHP] Error message not understood


 -Original Message-
 From: sueandant [mailto:hollandsath...@tiscali.co.uk]
 Sent: Saturday, October 16, 2010 1:16 PM
 To: Luigi Pressello
 Cc: PHP
 Subject: Re: [PHP] Error message not understood

 I've run both programs. [1] outputs Client library version 5.1.51, but
 [2]
 gives no output.   However I have checked MySql status via the command
 prompt which tells me mysql Ver 14.14 Distrib 5.1.51 for Win32(ia32).

 You still haven't answer the question of what platform? FreeBSD? Linux?
 Mac?
 Windows?  And what is the platform version?


 I originally installed PHP 5.3 but I couldn't get it to communicate

with

 mysqli
 (and I tried everything!) so I unstalled it and replaced it with

 How did you uninstall?  Using the OS's software/package manager such
 package
 on FreeBSD, yast on some Linux, add/remove programs on Windows, etc.?
Did
 you compile any of it - MySQL or PHP - yourself?

 version 5.2.14.   PHP info tells me this that the Client API library
 version
 is 5.1.51 and the header version is 5.0.51a.

 This just means that there's a mismatch within the PHP.  If you 
 compiled

 from source for any of it, PHP's MySQL  MySQLi extensions depends on
the
 MySQL headers and client library.  Thus, MySQL client has to be 
 compiled

 first before you can compile the PHP's MySQL/MySQLi extensions.  This
 applies to all platforms if you're doing your compilation from source.

If

 you didn't compile any of it - both MySQL and PHP - then the problem

lies

 within your OS's software/package manager.  Without knowing what
you're
 using, we can't really tell what happens.  Some Linux distributions do
 things differently.  I'm not well versed in Linux but many others here

on

 this list can help you with it.  I suggest you 'uninstall' both PHP 
 MySQL.
 Then reinstall MySQL 1st and PHP 2nd.  Also, just a bit curious... 
 where

 did
 you get the MySQL  PHP?  I hope directly from the official source... 
 ;)



 Does this help identify a solution?

 Thanks and best wishes

 tholland

 snip

 Regards,
 Tommy


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Error message not understood

2010-10-18 Thread Tommy Pham
 -Original Message-
 From: sueandant [mailto:hollandsath...@tiscali.co.uk]
 Sent: Monday, October 18, 2010 1:52 PM
 To: Tommy Pham
 Cc: 'PHP'
 Subject: Re: [PHP] Error message not understood
 
 I'm running PHP as module with Apache.   The version I downloaded was
 your
 [1], tho it wa version 5.2.14.   When I downloaded and unzipped the files
I
 had already installed MySql Ver 14.14 Distrib 5.1.51 for Win32(ia32).
 
 Thanks for the help.
 
 tholland

Huh?  If you downloaded the current version 5.3.3 of PHP.  It should read
this for MySQL  MySQLi extenstions in phpinfo(); :
Client API version  mysqlnd 5.0.7-dev - 091210 - $Revision: 300533 $

And you shouldn't have problems accessing MySQL 5.1.

Regards,
Tommy

 - Original Message -
 From: Tommy Pham tommy...@gmail.com
 To: 'sueandant' hollandsath...@tiscali.co.uk
 Cc: 'PHP' php-general@lists.php.net
 Sent: Saturday, October 16, 2010 10:49 PM
 Subject: RE: [PHP] Error message not understood
 
 
  -Original Message-
  From: sueandant [mailto:hollandsath...@tiscali.co.uk]
  Sent: Saturday, October 16, 2010 2:23 PM
  To: Tommy Pham
  Cc: PHP
  Subject: Re: [PHP] Error message not understood
 
  Apologies!   Vista Home Premium 32bit with SP2.   I uninstalled it
using
  Windows' uninstaller.   I didn't compile any of the packages.   MySQL
was
  installed using the .msi download and PHP I simply unzipped to my
 C:\PHP
  folder.   And, yes, they both came from the official sites.
 
 
  Forgot to mention something, please don't top post.  It makes hard for
  others to follow the thread.
 
  Are you running PHP with IIS or Apache?  If with Apache how are you
  running
  PHP as, CGI or module?  Since you're using official distributions,
you'll
  have to use PHP VC6 TS build (if not using as CGI/FastCGI) for Apache
[1].
  If you're running PHP with IIS, you'll have to run NTS build for FastCGI
  [2].
 
  [1] http://windows.php.net/downloads/releases/php-5.3.3-Win32-VC6-
 x86.zip
  [2]
  http://windows.php.net/downloads/releases/php-5.3.3-nts-Win32-VC9-
 x86.zip
 
  - Original Message -
  From: Tommy Pham tommy...@gmail.com
  To: 'sueandant' hollandsath...@tiscali.co.uk; 'Luigi Pressello'
  rad...@gmail.com
  Cc: 'PHP' php-general@lists.php.net
  Sent: Saturday, October 16, 2010 9:38 PM
  Subject: RE: [PHP] Error message not understood
 
 
   -Original Message-
   From: sueandant [mailto:hollandsath...@tiscali.co.uk]
   Sent: Saturday, October 16, 2010 1:16 PM
   To: Luigi Pressello
   Cc: PHP
   Subject: Re: [PHP] Error message not understood
  
   I've run both programs. [1] outputs Client library version 5.1.51,
but
   [2]
   gives no output.   However I have checked MySql status via the
 command
   prompt which tells me mysql Ver 14.14 Distrib 5.1.51 for
Win32(ia32).
  
   You still haven't answer the question of what platform? FreeBSD?
 Linux?
   Mac?
   Windows?  And what is the platform version?
  
  
   I originally installed PHP 5.3 but I couldn't get it to communicate
  with
   mysqli
   (and I tried everything!) so I unstalled it and replaced it with
  
   How did you uninstall?  Using the OS's software/package manager such
   package
   on FreeBSD, yast on some Linux, add/remove programs on Windows,
 etc.?
  Did
   you compile any of it - MySQL or PHP - yourself?
  
   version 5.2.14.   PHP info tells me this that the Client API library
   version
   is 5.1.51 and the header version is 5.0.51a.
  
   This just means that there's a mismatch within the PHP.  If you
   compiled
   from source for any of it, PHP's MySQL  MySQLi extensions depends on
  the
   MySQL headers and client library.  Thus, MySQL client has to be
   compiled
   first before you can compile the PHP's MySQL/MySQLi extensions.  This
   applies to all platforms if you're doing your compilation from
source.
  If
   you didn't compile any of it - both MySQL and PHP - then the problem
  lies
   within your OS's software/package manager.  Without knowing what
  you're
   using, we can't really tell what happens.  Some Linux distributions
do
   things differently.  I'm not well versed in Linux but many others
here
  on
   this list can help you with it.  I suggest you 'uninstall' both PHP 
   MySQL.
   Then reinstall MySQL 1st and PHP 2nd.  Also, just a bit curious...
   where
   did
   you get the MySQL  PHP?  I hope directly from the official source...
   ;)
  
  
   Does this help identify a solution?
  
   Thanks and best wishes
  
   tholland
  
   snip
  
   Regards,
   Tommy
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error message not understood

2010-10-16 Thread sueandant
I've run both programs. [1] outputs Client library version 5.1.51, but [2] 
gives no output.   However I have checked MySql status via the command 
prompt which tells me mysql Ver 14.14 Distrib 5.1.51 for Win32(ia32).


I originally installed PHP 5.3 but I couldn't get it to communicate with 
mysqli (and I tried everything!) so I unstalled it and replaced it with 
version 5.2.14.   PHP info tells me this that the Client API library version 
is 5.1.51 and the header version is 5.0.51a.


Does this help identify a solution?

Thanks and best wishes

tholland
- Original Message - 
From: Luigi Pressello rad...@gmail.com

To: Tommy Pham tommy...@gmail.com
Cc: 'sueandant' hollandsath...@tiscali.co.uk; 'PHP' 
php-general@lists.php.net

Sent: Friday, October 15, 2010 10:46 PM
Subject: Re: [PHP] Error message not understood


Probably a PHP compilation problem.
The message seems refer to the headers (libmysql.h) used in the ./configure 
phase of the building process.


It seems like your PHP version was compiled using a MySQL 5.0.11 version 
header, while your connecting to a server running MySQL 5.1.51, Have you 
upgraded your MySQL recently? are you using the MySQL server on the same 
machine that runs Apache/IIS/etc.. and PHP?


Sorry for the Italianese english :)

Luigi.

Il giorno 15/ott/2010, alle ore 23.19, Tommy Pham ha scritto:


-Original Message-
From: Tommy Pham [mailto:tommy...@gmail.com]
Sent: Friday, October 15, 2010 2:16 PM
To: 'sueandant'; 'PHP'
Subject: RE: [PHP] Error message not understood


-Original Message-
From: sueandant [mailto:hollandsath...@tiscali.co.uk]
Sent: Friday, October 15, 2010 2:02 PM
To: PHP
Subject: [PHP] Error message not understood

Can anyone help me with this error message and explain how to correct
the mismatch?

PHP Warning:  mysqli_connect() [a href='function.mysqli-
connect'function.mysqli-connect/a]: Headers and client library
minor version mismatch. Headers:50051 Library:50151

tholland


It would help if you provide the platform and platform version:
Windows, Linux, Mac, FreeBSD, or other variants.

And also the PHP version you're using.  Did you compile PHP yourself or

use

a distribution?

Regards,
Tommy


Forgot to mention this earlier... too hasty on the send button ... lol.

Since it's only a warning and you are able to connect, run [1]  [2] to 
see

what do you get.

[1] http://us2.php.net/manual/en/mysqli.get-client-info.php
[2] http://us2.php.net/manual/en/mysqli.info.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Error message not understood

2010-10-16 Thread Tommy Pham
 -Original Message-
 From: sueandant [mailto:hollandsath...@tiscali.co.uk]
 Sent: Saturday, October 16, 2010 1:16 PM
 To: Luigi Pressello
 Cc: PHP
 Subject: Re: [PHP] Error message not understood
 
 I've run both programs. [1] outputs Client library version 5.1.51, but [2]
 gives no output.   However I have checked MySql status via the command
 prompt which tells me mysql Ver 14.14 Distrib 5.1.51 for Win32(ia32).

You still haven't answer the question of what platform? FreeBSD? Linux? Mac?
Windows?  And what is the platform version?

 
 I originally installed PHP 5.3 but I couldn't get it to communicate with
mysqli
 (and I tried everything!) so I unstalled it and replaced it with

How did you uninstall?  Using the OS's software/package manager such package
on FreeBSD, yast on some Linux, add/remove programs on Windows, etc.?  Did
you compile any of it - MySQL or PHP - yourself?

 version 5.2.14.   PHP info tells me this that the Client API library
version
 is 5.1.51 and the header version is 5.0.51a.

This just means that there's a mismatch within the PHP.  If you compiled
from source for any of it, PHP's MySQL  MySQLi extensions depends on the
MySQL headers and client library.  Thus, MySQL client has to be compiled
first before you can compile the PHP's MySQL/MySQLi extensions.  This
applies to all platforms if you're doing your compilation from source.  If
you didn't compile any of it - both MySQL and PHP - then the problem lies
within your OS's software/package manager.  Without knowing what you're
using, we can't really tell what happens.  Some Linux distributions do
things differently.  I'm not well versed in Linux but many others here on
this list can help you with it.  I suggest you 'uninstall' both PHP  MySQL.
Then reinstall MySQL 1st and PHP 2nd.  Also, just a bit curious... where did
you get the MySQL  PHP?  I hope directly from the official source... ;)

 
 Does this help identify a solution?
 
 Thanks and best wishes
 
 tholland

snip

Regards,
Tommy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error message not understood

2010-10-16 Thread sueandant
Apologies!   Vista Home Premium 32bit with SP2.   I uninstalled it using 
Windows' uninstaller.   I didn't compile any of the packages.   MySQL was 
installed using the .msi download and PHP I simply unzipped to my C:\PHP 
folder.   And, yes, they both came from the official sites.


- Original Message - 
From: Tommy Pham tommy...@gmail.com
To: 'sueandant' hollandsath...@tiscali.co.uk; 'Luigi Pressello' 
rad...@gmail.com

Cc: 'PHP' php-general@lists.php.net
Sent: Saturday, October 16, 2010 9:38 PM
Subject: RE: [PHP] Error message not understood



-Original Message-
From: sueandant [mailto:hollandsath...@tiscali.co.uk]
Sent: Saturday, October 16, 2010 1:16 PM
To: Luigi Pressello
Cc: PHP
Subject: Re: [PHP] Error message not understood

I've run both programs. [1] outputs Client library version 5.1.51, but 
[2]

gives no output.   However I have checked MySql status via the command
prompt which tells me mysql Ver 14.14 Distrib 5.1.51 for Win32(ia32).


You still haven't answer the question of what platform? FreeBSD? Linux? 
Mac?

Windows?  And what is the platform version?



I originally installed PHP 5.3 but I couldn't get it to communicate with

mysqli

(and I tried everything!) so I unstalled it and replaced it with


How did you uninstall?  Using the OS's software/package manager such 
package

on FreeBSD, yast on some Linux, add/remove programs on Windows, etc.?  Did
you compile any of it - MySQL or PHP - yourself?


version 5.2.14.   PHP info tells me this that the Client API library

version

is 5.1.51 and the header version is 5.0.51a.


This just means that there's a mismatch within the PHP.  If you compiled
from source for any of it, PHP's MySQL  MySQLi extensions depends on the
MySQL headers and client library.  Thus, MySQL client has to be compiled
first before you can compile the PHP's MySQL/MySQLi extensions.  This
applies to all platforms if you're doing your compilation from source.  If
you didn't compile any of it - both MySQL and PHP - then the problem lies
within your OS's software/package manager.  Without knowing what you're
using, we can't really tell what happens.  Some Linux distributions do
things differently.  I'm not well versed in Linux but many others here on
this list can help you with it.  I suggest you 'uninstall' both PHP  
MySQL.
Then reinstall MySQL 1st and PHP 2nd.  Also, just a bit curious... where 
did

you get the MySQL  PHP?  I hope directly from the official source... ;)



Does this help identify a solution?

Thanks and best wishes

tholland


snip

Regards,
Tommy


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Error message not understood

2010-10-16 Thread Tommy Pham
 -Original Message-
 From: sueandant [mailto:hollandsath...@tiscali.co.uk]
 Sent: Saturday, October 16, 2010 2:23 PM
 To: Tommy Pham
 Cc: PHP
 Subject: Re: [PHP] Error message not understood
 
 Apologies!   Vista Home Premium 32bit with SP2.   I uninstalled it using
 Windows' uninstaller.   I didn't compile any of the packages.   MySQL was
 installed using the .msi download and PHP I simply unzipped to my C:\PHP
 folder.   And, yes, they both came from the official sites.
 

Forgot to mention something, please don't top post.  It makes hard for
others to follow the thread.

Are you running PHP with IIS or Apache?  If with Apache how are you running
PHP as, CGI or module?  Since you're using official distributions, you'll
have to use PHP VC6 TS build (if not using as CGI/FastCGI) for Apache [1].
If you're running PHP with IIS, you'll have to run NTS build for FastCGI
[2].

[1] http://windows.php.net/downloads/releases/php-5.3.3-Win32-VC6-x86.zip
[2]
http://windows.php.net/downloads/releases/php-5.3.3-nts-Win32-VC9-x86.zip

 - Original Message -
 From: Tommy Pham tommy...@gmail.com
 To: 'sueandant' hollandsath...@tiscali.co.uk; 'Luigi Pressello'
 rad...@gmail.com
 Cc: 'PHP' php-general@lists.php.net
 Sent: Saturday, October 16, 2010 9:38 PM
 Subject: RE: [PHP] Error message not understood
 
 
  -Original Message-
  From: sueandant [mailto:hollandsath...@tiscali.co.uk]
  Sent: Saturday, October 16, 2010 1:16 PM
  To: Luigi Pressello
  Cc: PHP
  Subject: Re: [PHP] Error message not understood
 
  I've run both programs. [1] outputs Client library version 5.1.51, but
  [2]
  gives no output.   However I have checked MySql status via the command
  prompt which tells me mysql Ver 14.14 Distrib 5.1.51 for Win32(ia32).
 
  You still haven't answer the question of what platform? FreeBSD? Linux?
  Mac?
  Windows?  And what is the platform version?
 
 
  I originally installed PHP 5.3 but I couldn't get it to communicate
with
  mysqli
  (and I tried everything!) so I unstalled it and replaced it with
 
  How did you uninstall?  Using the OS's software/package manager such
  package
  on FreeBSD, yast on some Linux, add/remove programs on Windows, etc.?
 Did
  you compile any of it - MySQL or PHP - yourself?
 
  version 5.2.14.   PHP info tells me this that the Client API library
  version
  is 5.1.51 and the header version is 5.0.51a.
 
  This just means that there's a mismatch within the PHP.  If you compiled
  from source for any of it, PHP's MySQL  MySQLi extensions depends on
 the
  MySQL headers and client library.  Thus, MySQL client has to be compiled
  first before you can compile the PHP's MySQL/MySQLi extensions.  This
  applies to all platforms if you're doing your compilation from source.
If
  you didn't compile any of it - both MySQL and PHP - then the problem
lies
  within your OS's software/package manager.  Without knowing what
 you're
  using, we can't really tell what happens.  Some Linux distributions do
  things differently.  I'm not well versed in Linux but many others here
on
  this list can help you with it.  I suggest you 'uninstall' both PHP 
  MySQL.
  Then reinstall MySQL 1st and PHP 2nd.  Also, just a bit curious... where
  did
  you get the MySQL  PHP?  I hope directly from the official source... ;)
 
 
  Does this help identify a solution?
 
  Thanks and best wishes
 
  tholland
 
  snip
 
  Regards,
  Tommy
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Error message not understood

2010-10-15 Thread sueandant
Can anyone help me with this error message and explain how to correct the 
mismatch?

PHP Warning:  mysqli_connect() [a 
href='function.mysqli-connect'function.mysqli-connect/a]: Headers and client 
library minor version mismatch. Headers:50051 Library:50151 

tholland

RE: [PHP] Error message not understood

2010-10-15 Thread Tommy Pham
 -Original Message-
 From: sueandant [mailto:hollandsath...@tiscali.co.uk]
 Sent: Friday, October 15, 2010 2:02 PM
 To: PHP
 Subject: [PHP] Error message not understood
 
 Can anyone help me with this error message and explain how to correct the
 mismatch?
 
 PHP Warning:  mysqli_connect() [a href='function.mysqli-
 connect'function.mysqli-connect/a]: Headers and client library minor
 version mismatch. Headers:50051 Library:50151
 
 tholland

It would help if you provide the platform and platform version: 
Windows, Linux, Mac, FreeBSD, or other variants.

And also the PHP version you're using.  Did you compile PHP yourself or use
a distribution?

Regards,
Tommy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Error message not understood

2010-10-15 Thread Tommy Pham
 -Original Message-
 From: Tommy Pham [mailto:tommy...@gmail.com]
 Sent: Friday, October 15, 2010 2:16 PM
 To: 'sueandant'; 'PHP'
 Subject: RE: [PHP] Error message not understood
 
  -Original Message-
  From: sueandant [mailto:hollandsath...@tiscali.co.uk]
  Sent: Friday, October 15, 2010 2:02 PM
  To: PHP
  Subject: [PHP] Error message not understood
 
  Can anyone help me with this error message and explain how to correct
  the mismatch?
 
  PHP Warning:  mysqli_connect() [a href='function.mysqli-
  connect'function.mysqli-connect/a]: Headers and client library
  minor version mismatch. Headers:50051 Library:50151
 
  tholland
 
 It would help if you provide the platform and platform version:
 Windows, Linux, Mac, FreeBSD, or other variants.
 
 And also the PHP version you're using.  Did you compile PHP yourself or
use
 a distribution?
 
 Regards,
 Tommy

Forgot to mention this earlier... too hasty on the send button ... lol.

Since it's only a warning and you are able to connect, run [1]  [2] to see
what do you get.

[1] http://us2.php.net/manual/en/mysqli.get-client-info.php
[2] http://us2.php.net/manual/en/mysqli.info.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error message not understood

2010-10-15 Thread Luigi Pressello
Probably a PHP compilation problem.
The message seems refer to the headers (libmysql.h) used in the ../configure 
phase of the building process.

It seems like your PHP version was compiled using a MySQL 5.0.11 version 
header, while your connecting to a server running MySQL 5.1.51, Have you 
upgraded your MySQL recently? are you using the MySQL server on the same 
machine that runs Apache/IIS/etc.. and PHP?

Sorry for the Italianese english :)

Luigi.

Il giorno 15/ott/2010, alle ore 23.19, Tommy Pham ha scritto:

 -Original Message-
 From: Tommy Pham [mailto:tommy...@gmail.com]
 Sent: Friday, October 15, 2010 2:16 PM
 To: 'sueandant'; 'PHP'
 Subject: RE: [PHP] Error message not understood
 
 -Original Message-
 From: sueandant [mailto:hollandsath...@tiscali.co.uk]
 Sent: Friday, October 15, 2010 2:02 PM
 To: PHP
 Subject: [PHP] Error message not understood
 
 Can anyone help me with this error message and explain how to correct
 the mismatch?
 
 PHP Warning:  mysqli_connect() [a href='function.mysqli-
 connect'function.mysqli-connect/a]: Headers and client library
 minor version mismatch. Headers:50051 Library:50151
 
 tholland
 
 It would help if you provide the platform and platform version:
 Windows, Linux, Mac, FreeBSD, or other variants.
 
 And also the PHP version you're using.  Did you compile PHP yourself or
 use
 a distribution?
 
 Regards,
 Tommy
 
 Forgot to mention this earlier... too hasty on the send button ... lol.
 
 Since it's only a warning and you are able to connect, run [1]  [2] to see
 what do you get.
 
 [1] http://us2.php.net/manual/en/mysqli.get-client-info.php
 [2] http://us2.php.net/manual/en/mysqli.info.php
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Error in initialising XML parser

2010-09-06 Thread Sridhar Pandurangiah

Hi

I am writing a PHP snippet to display invoices that is generated by 
another computer application. The use case is as follows


1. The other computer application generates the invoices for the month 
in XML and puts it in a common dirctory. So at anytime there could be 
multiple files. Each file contains several invoices. These invoices are 
for different vendors.
2. My PHP snippet will list all the files in the directory. I have got 
this part right after a lot of research, phew! It displays only xml 
files and keeps out the others like files begining with . (dot) etc. 
This is listed as a series of checkboxes so that the user can view the 
list of invoices available. Once the user clicks on the checkboxes I 
POST the file name to the server with the following code


$BillLocation = /home/cmi/Integration/xml_files;
$StyleSheet = Bill.xsl;
$DirHandle = opendir($BillLocation);

if ($_POST['_submit_check'])
{
$MyBill = new Displaybill($_POST[BillChosen]);
$MyBill-parse($_POST[BillChosen]);
$MyBill-Show_Bill($MemberId, $StyleSheet);
}
{
$result = List_Directory($DirHandle);

}

I get a following error Fatal error: Class 'Displaybill' not found in 
/home/sridhar/Sastra/2010-ClubMan-Integration/ListAvailableBills.php on 
line 15


I have the Displaybill class in the same location as the other file 
still PHP is not able to locate it. What could be wrong? Any help would 
be appreciated.


Running the whole thing on localhost with the vhosts configured to teh 
above directory.


Best regards

Sridhar

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error in initialising XML parser

2010-09-06 Thread a...@ashleysheridan.co.uk
PHO won't automatically include a class file by default. You either need to 
manually include it with a require, include it or require_once line, or use an 
automagical include script. As it stands, you're getting the error because php 
doesn't know where your class is.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: Sridhar Pandurangiah sridharpa...@gmail.com
Date: Mon, Sep 6, 2010 09:12
Subject: [PHP] Error in initialising XML parser
To: php-general@lists.php.net

Hi

I am writing a PHP snippet to display invoices that is generated by 
another computer application. The use case is as follows

1. The other computer application generates the invoices for the month 
in XML and puts it in a common dirctory. So at anytime there could be 
multiple files. Each file contains several invoices. These invoices are 
for different vendors.
2. My PHP snippet will list all the files in the directory. I have got 
this part right after a lot of research, phew! It displays only xml 
files and keeps out the others like files begining with . (dot) etc. 
This is listed as a series of checkboxes so that the user can view the 
list of invoices available. Once the user clicks on the checkboxes I 
POST the file name to the server with the following code

$BillLocation = /home/cmi/Integration/xml_files;
$StyleSheet = Bill.xsl;
$DirHandle = opendir($BillLocation);

if ($_POST['_submit_check'])
{
$MyBill = new Displaybill($_POST[BillChosen]);
$MyBill-parse($_POST[BillChosen]);
$MyBill-Show_Bill($MemberId, $StyleSheet);
}
{
$result = List_Directory($DirHandle);

}

I get a following error Fatal error: Class 'Displaybill' not found in 
/home/sridhar/Sastra/2010-ClubMan-Integration/ListAvailableBills.php on 
line 15

I have the Displaybill class in the same location as the other file 
still PHP is not able to locate it. What could be wrong? Any help would 
be appreciated.

Running the whole thing on localhost with the vhosts configured to teh 
above directory.

Best regards

Sridhar

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error in initialising XML parser

2010-09-06 Thread Sridhar Pandurangiah

Thanks, PHP is now able to include the class file

Best regards

 Original Message 
Subject: Re: [PHP] Error in initialising XML parser
From: a...@ashleysheridan.co.uk (a...@ashleysheridan.co.uk)
To:
Date: Mon Sep 06 2010 13:56:39 GMT+0530 (IST)


PHO won't automatically include a class file by default. You either need to 
manually include it with a require, include it or require_once line, or use an 
automagical include script. As it stands, you're getting the error because php 
doesn't know where your class is.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: Sridhar Pandurangiah sridharpa...@gmail.com
Date: Mon, Sep 6, 2010 09:12
Subject: [PHP] Error in initialising XML parser
To: php-general@lists.php.net

Hi

I am writing a PHP snippet to display invoices that is generated by 
another computer application. The use case is as follows


1. The other computer application generates the invoices for the month 
in XML and puts it in a common dirctory. So at anytime there could be 
multiple files. Each file contains several invoices. These invoices are 
for different vendors.
2. My PHP snippet will list all the files in the directory. I have got 
this part right after a lot of research, phew! It displays only xml 
files and keeps out the others like files begining with . (dot) etc. 
This is listed as a series of checkboxes so that the user can view the 
list of invoices available. Once the user clicks on the checkboxes I 
POST the file name to the server with the following code


$BillLocation = /home/cmi/Integration/xml_files;
$StyleSheet = Bill.xsl;
$DirHandle = opendir($BillLocation);

if ($_POST['_submit_check'])
{
$MyBill = new Displaybill($_POST[BillChosen]);
$MyBill-parse($_POST[BillChosen]);
$MyBill-Show_Bill($MemberId, $StyleSheet);
}
{
$result = List_Directory($DirHandle);

}

I get a following error Fatal error: Class 'Displaybill' not found in 
/home/sridhar/Sastra/2010-ClubMan-Integration/ListAvailableBills.php on 
line 15


I have the Displaybill class in the same location as the other file 
still PHP is not able to locate it. What could be wrong? Any help would 
be appreciated.


Running the whole thing on localhost with the vhosts configured to teh 
above directory.


Best regards

Sridhar



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] [ERROR LOG FORMATTER] - any recommendations for web viewable error log formatters?

2010-08-09 Thread Tristan
a client of mine use to have some color coded one but, I can't find it
again. anyone using one that they particularly like?

similar to this but was hoping for something in PHP

http://www.psychogenic.com/en/products/Errorlog.php

Thanks, T


Re: [PHP] [ERROR LOG FORMATTER] - any recommendations for web viewable error log formatters?

2010-08-09 Thread Peter Lind
On 9 August 2010 20:40, Tristan sunnrun...@gmail.com wrote:
 a client of mine use to have some color coded one but, I can't find it
 again. anyone using one that they particularly like?

 similar to this but was hoping for something in PHP

 http://www.psychogenic.com/en/products/Errorlog.php

 Thanks, T


Xdebug formats errors, try installing that.

Regards
Peter

-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
/hype

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] [ERROR LOG FORMATTER] - any recommendations for web viewable error log formatters?

2010-08-09 Thread Tristan
Looking for something that does error logs on the server.

Thanks, T

On Mon, Aug 9, 2010 at 12:59 PM, Peter Lind peter.e.l...@gmail.com wrote:

 On 9 August 2010 20:40, Tristan sunnrun...@gmail.com wrote:
  a client of mine use to have some color coded one but, I can't find it
  again. anyone using one that they particularly like?
 
  similar to this but was hoping for something in PHP
 
  http://www.psychogenic.com/en/products/Errorlog.php
 
  Thanks, T
 

 Xdebug formats errors, try installing that.

 Regards
 Peter

 --
 hype
 WWW: http://plphp.dk / http://plind.dk
 LinkedIn: http://www.linkedin.com/in/plind
 BeWelcome/Couchsurfing: Fake51
 Twitter: http://twitter.com/kafe15
 /hype



Re: [PHP] [ERROR LOG FORMATTER] - any recommendations for web viewable error log formatters?

2010-08-09 Thread Bastien Koert
On Mon, Aug 9, 2010 at 3:12 PM, Tristan sunnrun...@gmail.com wrote:
 Looking for something that does error logs on the server.

 Thanks, T

 On Mon, Aug 9, 2010 at 12:59 PM, Peter Lind peter.e.l...@gmail.com wrote:

 On 9 August 2010 20:40, Tristan sunnrun...@gmail.com wrote:
  a client of mine use to have some color coded one but, I can't find it
  again. anyone using one that they particularly like?
 
  similar to this but was hoping for something in PHP
 
  http://www.psychogenic.com/en/products/Errorlog.php
 
  Thanks, T
 

 Xdebug formats errors, try installing that.

 Regards
 Peter

 --
 hype
 WWW: http://plphp.dk / http://plind.dk
 LinkedIn: http://www.linkedin.com/in/plind
 BeWelcome/Couchsurfing: Fake51
 Twitter: http://twitter.com/kafe15
 /hype



 Splunk http://www.splunk.com/

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] [ERROR LOG FORMATTER] - any recommendations for web viewable error log formatters?

2010-08-09 Thread Tristan
Thanks but, holy overkill. I just need something simple. Thanks for the
advice guys.

-T

On Mon, Aug 9, 2010 at 2:30 PM, Bastien Koert phps...@gmail.com wrote:

 On Mon, Aug 9, 2010 at 3:12 PM, Tristan sunnrun...@gmail.com wrote:
  Looking for something that does error logs on the server.
 
  Thanks, T
 
  On Mon, Aug 9, 2010 at 12:59 PM, Peter Lind peter.e.l...@gmail.com
 wrote:
 
  On 9 August 2010 20:40, Tristan sunnrun...@gmail.com wrote:
   a client of mine use to have some color coded one but, I can't find it
   again. anyone using one that they particularly like?
  
   similar to this but was hoping for something in PHP
  
   http://www.psychogenic.com/en/products/Errorlog.php
  
   Thanks, T
  
 
  Xdebug formats errors, try installing that.
 
  Regards
  Peter
 
  --
  hype
  WWW: http://plphp.dk / http://plind.dk
  LinkedIn: http://www.linkedin.com/in/plind
  BeWelcome/Couchsurfing: Fake51
  Twitter: http://twitter.com/kafe15
  /hype
 
 

  Splunk http://www.splunk.com/

 --

 Bastien

 Cat, the other other white meat



[PHP] Error on Signing Encrypting PayPal Website Payment Button with openssl_

2010-07-24 Thread Keith

Hi, anyone has experience creating PayPal Encrypted Website Payment button?
I follow PayPal SDK example but the encrypted value is not correct.

I think the error should be with openssl_pkcs7_sign() since PayPal can 
decrypt it with PayPal private key but does not recognize my signed data. 
PayPal also told me that it is my encryption error.


Please kindly advice on the code below.

Thanks!
Keith
___
//$buttonParams is key=value pair string with \n separation between each 
key=value pair

$mypub = 'file://'.realpath('./mypubcert.pem');
$myprv = 'file://'.realpath('./myprvkey.pem');
$paypalpubcert= 'file://'.realpath('./paypal_cert_pem.pem');

$dataStrFile  = realpath(tempnam('./tmp', 'pp_'));
$fd = fopen($dataStrFile, 'w');
fwrite($fd, $buttonParams);
fclose($fd);

$signedDataFile = realpath(tempnam('./tmp', 'pp_'));
openssl_pkcs7_sign($dataStrFile, $signedDataFile, $mypub, $myprv,array(), 
PKCS7_BINARY);

unlink($dataStrFile);

$signedData = file_get_contents($signedDataFile);
$signedDataArray = explode(\n\n, $signedData);  //I don't understand why 
this code, just follow example only.
$signedData = base64_decode($signedDataArray[1]);  //I don't understand why 
this code, just follow example only.

unlink($signedDataFile);

$decodedSignedDataFile = realpath(tempnam('./tmp', 'pp_'));
$fd = fopen($decodedSignedDataFile, 'w');fwrite($fd, 
$signedData);

fclose($fd);

$encryptedDataFile = realpath(tempnam('./tmp', 'pp_'));
openssl_pkcs7_encrypt($decodedSignedDataFile, $encryptedDataFile, 
$paypalpubcert, array(), PKCS7_BINARY);

unlink($decodedSignedDataFile);

$encryptedData = file_get_contents($encryptedDataFile);
unlink($encryptedDataFile);

$encryptedDataArray = explode(\n\n, $encryptedData);
$encryptedData = trim(str_replace(\n, '', $encryptedDataArray[1])); //why 
this?


$encryptedData = -BEGIN PKCS7-.$encryptedData.-END 
PKCS7-;
$encryptedBtn = form 
action='https://www.sandbox.paypal.com/cgi-bin/webscr' method='post'input 
type='hidden' name='cmd' value='_s-xclick'INPUT TYPE='hidden' 
NAME='encrypted' VALUE='$encryptedData'input type='image' 
src='https://www.sandbox.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif' 
border='0' name='submit' alt='PayPal - The safer, easier way to pay 
online!'img alt='' border='0' 
src='https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif' width='1' 
height='1'/form;


echo $encryptedBtn ;
_




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-28 Thread Pete Ford

On 27/04/10 16:37, tedd wrote:

Error handling is almost an art form.



More like a black art - voodoo perhaps...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-28 Thread viraj
On Tue, Apr 27, 2010 at 7:34 PM, Gary . php-gene...@garydjones.name wrote:
 On Tue, Apr 27, 2010 at 10:46 AM, Peter Lind wrote:
 On 27 April 2010 10:42, Gary . wrote:
 How do you guys handle errors during, say, db insertions.

 Let's say you have an ongoing transaction which fails on the n-th
 insert. Ok, you roll back the transaction, no problem. How do you then
 inform the user? Just using the text from pg_result_error  or
 something?


 If it's a normal user, give them some info about what went wrong but
 not the specific error returned.

 Yeah. I know :( Originally I couldn't find a nice way of translating
 between db errors and user errors. The only interface to the db
 errors that I could find was the error messages returned from
 pg_last_error. Yes, I could have used an array translating between the
 the strings returned by pg_last_error or whatever, but *gag* it would
 not only have made the code look horrible but would also have been
 susceptible to changes in the error messages returned by the db
 interface. In the end I changed tack slightly and used pg_send_* and
 pg_result_error_field to get a short code I could use as a reference
 into an array.

thought of adding few extra things i do.

i keep a constant to check the running environment. before i do the
'trigger_error' with pg/mysql raised error, i conditionally check
whethr it's 'live', 'beta' or 'dev' environment and use different
error_handlers. if it's 'production' environment, the error handler
will write the detail error with all back-trace and possible sql
queries and data into a log file with a unique id, and displays a
friendly message with that reference id, so the user can report to sys
admin if he/she wishes.

~viraj





 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Error handling strategies (db related)

2010-04-27 Thread Gary .
How do you guys handle errors during, say, db insertions.

Let's say you have an ongoing transaction which fails on the n-th
insert. Ok, you roll back the transaction, no problem. How do you then
inform the user? Just using the text from pg_result_error  or
something?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Peter Lind
On 27 April 2010 10:42, Gary . php-gene...@garydjones.name wrote:
 How do you guys handle errors during, say, db insertions.

 Let's say you have an ongoing transaction which fails on the n-th
 insert. Ok, you roll back the transaction, no problem. How do you then
 inform the user? Just using the text from pg_result_error  or
 something?


If it's a normal user, give them some info about what went wrong but
not the specific error returned. If it's an admin with dev knowledge
(i.e. you) then consider handing out the returned error as well.

Rule of thumb: aim to inform the user without confusing. There's
nothing worse than This didn't work, sorry - why didn't it work??
Was it my fault? Can I get it to work somehow?

Regards
Peter


-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
/hype

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Michiel Sikma
On 27 April 2010 10:42, Gary . php-gene...@garydjones.name wrote:

 How do you guys handle errors during, say, db insertions.

 Let's say you have an ongoing transaction which fails on the n-th
 insert. Ok, you roll back the transaction, no problem. How do you then
 inform the user? Just using the text from pg_result_error  or
 something?


Developers are usually lazy about error reporting because it's much easier
to just return the error code. Some parsing is very useful to the user,
since overtly technical information is just confusing.

The error should never be something that the user himself can avoid (since
you're supposed to have error checking and handling before the user
submits), so your error should make this clear to him. It helps to let him
know that the developer has been notified and that he can try again later.

Michiel


Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Paul M Foster
On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote:

 How do you guys handle errors during, say, db insertions.
 
 Let's say you have an ongoing transaction which fails on the n-th
 insert. Ok, you roll back the transaction, no problem. How do you then
 inform the user? Just using the text from pg_result_error  or
 something?

I use trigger_error() and stop execution at that point. I give the user
an error that basically says, Talk to the admin/programmer. And I send
the programmer a message containing a trace of what occurred. The theory
is that, all things being equal, such an error should never occur and
there is no user recovery. If the user properly entered the data they
were asked for, then the transaction should go through without incident.
If something prevents the transaction from going through, it's likely a
coding problem and up to the programmer or admin to repair.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Peter Lind
On 27 April 2010 15:36, Paul M Foster pa...@quillandmouse.com wrote:
 On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote:

 How do you guys handle errors during, say, db insertions.

 Let's say you have an ongoing transaction which fails on the n-th
 insert. Ok, you roll back the transaction, no problem. How do you then
 inform the user? Just using the text from pg_result_error  or
 something?

 I use trigger_error() and stop execution at that point. I give the user
 an error that basically says, Talk to the admin/programmer. And I send
 the programmer a message containing a trace of what occurred. The theory
 is that, all things being equal, such an error should never occur and
 there is no user recovery. If the user properly entered the data they
 were asked for, then the transaction should go through without incident.
 If something prevents the transaction from going through, it's likely a
 coding problem and up to the programmer or admin to repair.


Fair reasoning, but it amounts to throwing a bucket of cold water in
the face of your user. If I was looking at an error like that, I'd get
mighty annoyed with the software, and after a while would definitely
look for alternatives. Whether or not there's a coding problem, you
have to look at the situation from the point of the user: a complete
failure with no information is like a BSOD/TSOD ... and we all know
the effect they have on a user.

Regards
Peter

-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
/hype

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Gary .
On Tue, Apr 27, 2010 at 10:46 AM, Peter Lind wrote:
 On 27 April 2010 10:42, Gary . wrote:
 How do you guys handle errors during, say, db insertions.

 Let's say you have an ongoing transaction which fails on the n-th
 insert. Ok, you roll back the transaction, no problem. How do you then
 inform the user? Just using the text from pg_result_error  or
 something?


 If it's a normal user, give them some info about what went wrong but
 not the specific error returned.

Yeah. I know :( Originally I couldn't find a nice way of translating
between db errors and user errors. The only interface to the db
errors that I could find was the error messages returned from
pg_last_error. Yes, I could have used an array translating between the
the strings returned by pg_last_error or whatever, but *gag* it would
not only have made the code look horrible but would also have been
susceptible to changes in the error messages returned by the db
interface. In the end I changed tack slightly and used pg_send_* and
pg_result_error_field to get a short code I could use as a reference
into an array.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Paul M Foster
On Tue, Apr 27, 2010 at 03:41:04PM +0200, Peter Lind wrote:

 On 27 April 2010 15:36, Paul M Foster pa...@quillandmouse.com wrote:
  On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote:
 
  How do you guys handle errors during, say, db insertions.
 
  Let's say you have an ongoing transaction which fails on the n-th
  insert. Ok, you roll back the transaction, no problem. How do you then
  inform the user? Just using the text from pg_result_error  or
  something?
 
  I use trigger_error() and stop execution at that point. I give the user
  an error that basically says, Talk to the admin/programmer. And I send
  the programmer a message containing a trace of what occurred. The theory
  is that, all things being equal, such an error should never occur and
  there is no user recovery. If the user properly entered the data they
  were asked for, then the transaction should go through without incident.
  If something prevents the transaction from going through, it's likely a
  coding problem and up to the programmer or admin to repair.
 
 
 Fair reasoning, but it amounts to throwing a bucket of cold water in
 the face of your user. If I was looking at an error like that, I'd get
 mighty annoyed with the software, and after a while would definitely
 look for alternatives. Whether or not there's a coding problem, you
 have to look at the situation from the point of the user: a complete
 failure with no information is like a BSOD/TSOD ... and we all know
 the effect they have on a user.

I assume (1) that I've vetted the user data and given them the option to
repair it if it's faulty; (2) beyond the beta phase, this type of error
should not happen. If it does, it's a coding problem. Given that the
user can do *nothing* about this and it *is* a coding problem, what
would you tell the user?

If I was the user, I'd be cranky as well. But if I were a smart user,
I'd realize that the programmer made a mistake and put the
responsibility firmly on him. And expect him to fix it pronto.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Peter Lind
On 27 April 2010 16:07, Paul M Foster pa...@quillandmouse.com wrote:
 On Tue, Apr 27, 2010 at 03:41:04PM +0200, Peter Lind wrote:

 On 27 April 2010 15:36, Paul M Foster pa...@quillandmouse.com wrote:
  On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote:
 
  How do you guys handle errors during, say, db insertions.
 
  Let's say you have an ongoing transaction which fails on the n-th
  insert. Ok, you roll back the transaction, no problem. How do you then
  inform the user? Just using the text from pg_result_error  or
  something?
 
  I use trigger_error() and stop execution at that point. I give the user
  an error that basically says, Talk to the admin/programmer. And I send
  the programmer a message containing a trace of what occurred. The theory
  is that, all things being equal, such an error should never occur and
  there is no user recovery. If the user properly entered the data they
  were asked for, then the transaction should go through without incident.
  If something prevents the transaction from going through, it's likely a
  coding problem and up to the programmer or admin to repair.
 

 Fair reasoning, but it amounts to throwing a bucket of cold water in
 the face of your user. If I was looking at an error like that, I'd get
 mighty annoyed with the software, and after a while would definitely
 look for alternatives. Whether or not there's a coding problem, you
 have to look at the situation from the point of the user: a complete
 failure with no information is like a BSOD/TSOD ... and we all know
 the effect they have on a user.

 I assume (1) that I've vetted the user data and given them the option to
 repair it if it's faulty; (2) beyond the beta phase, this type of error
 should not happen. If it does, it's a coding problem. Given that the
 user can do *nothing* about this and it *is* a coding problem, what
 would you tell the user?

Sorry, but there was a problem inserting the data into the database.
The developers have been notified about this error and will hopefully
have it fixed very soon. We apologize for the inconvenience.

At the very least, something along those lines.

 If I was the user, I'd be cranky as well. But if I were a smart user,
 I'd realize that the programmer made a mistake and put the
 responsibility firmly on him. And expect him to fix it pronto.

If only the world consisted of smart users ... I think, however, that
we're generally closer to the opposite. And no, I don't hate users -
I've just seen too many people do things that were very far removed
from smart.

Regards
Peter

-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
/hype

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Paul M Foster
On Tue, Apr 27, 2010 at 04:13:20PM +0200, Peter Lind wrote:

 On 27 April 2010 16:07, Paul M Foster pa...@quillandmouse.com wrote:
  On Tue, Apr 27, 2010 at 03:41:04PM +0200, Peter Lind wrote:
 
  On 27 April 2010 15:36, Paul M Foster pa...@quillandmouse.com wrote:
   On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote:
  
   How do you guys handle errors during, say, db insertions.
  
   Let's say you have an ongoing transaction which fails on the n-th
   insert. Ok, you roll back the transaction, no problem. How do you then
   inform the user? Just using the text from pg_result_error  or
   something?
  
   I use trigger_error() and stop execution at that point. I give the user
   an error that basically says, Talk to the admin/programmer. And I send
   the programmer a message containing a trace of what occurred. The theory
   is that, all things being equal, such an error should never occur and
   there is no user recovery. If the user properly entered the data they
   were asked for, then the transaction should go through without incident.
   If something prevents the transaction from going through, it's likely a
   coding problem and up to the programmer or admin to repair.
  
 
  Fair reasoning, but it amounts to throwing a bucket of cold water in
  the face of your user. If I was looking at an error like that, I'd get
  mighty annoyed with the software, and after a while would definitely
  look for alternatives. Whether or not there's a coding problem, you
  have to look at the situation from the point of the user: a complete
  failure with no information is like a BSOD/TSOD ... and we all know
  the effect they have on a user.
 
  I assume (1) that I've vetted the user data and given them the option to
  repair it if it's faulty; (2) beyond the beta phase, this type of error
  should not happen. If it does, it's a coding problem. Given that the
  user can do *nothing* about this and it *is* a coding problem, what
  would you tell the user?
 
 Sorry, but there was a problem inserting the data into the database.
 The developers have been notified about this error and will hopefully
 have it fixed very soon. We apologize for the inconvenience.
 
 At the very least, something along those lines.

Well of course. No reason to slap the user in the face. I agree. But in
the end, this is about the same as saying, Talk to the programmer,
just a nicer way of saying it.

 
  If I was the user, I'd be cranky as well. But if I were a smart user,
  I'd realize that the programmer made a mistake and put the
  responsibility firmly on him. And expect him to fix it pronto.
 
 If only the world consisted of smart users ... I think, however, that
 we're generally closer to the opposite. And no, I don't hate users -
 I've just seen too many people do things that were very far removed
 from smart.

Unfortunately, true. Sometimes I think computer users should be required
to take a course in using a computer before being allowed behind the
keyboard.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Peter Lind
On 27 April 2010 16:24, Paul M Foster pa...@quillandmouse.com wrote:
 On Tue, Apr 27, 2010 at 04:13:20PM +0200, Peter Lind wrote:

 On 27 April 2010 16:07, Paul M Foster pa...@quillandmouse.com wrote:
  On Tue, Apr 27, 2010 at 03:41:04PM +0200, Peter Lind wrote:
 
  On 27 April 2010 15:36, Paul M Foster pa...@quillandmouse.com wrote:
   On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote:
  
   How do you guys handle errors during, say, db insertions.
  
   Let's say you have an ongoing transaction which fails on the n-th
   insert. Ok, you roll back the transaction, no problem. How do you then
   inform the user? Just using the text from pg_result_error  or
   something?
  
   I use trigger_error() and stop execution at that point. I give the user
   an error that basically says, Talk to the admin/programmer. And I send
   the programmer a message containing a trace of what occurred. The theory
   is that, all things being equal, such an error should never occur and
   there is no user recovery. If the user properly entered the data they
   were asked for, then the transaction should go through without incident.
   If something prevents the transaction from going through, it's likely a
   coding problem and up to the programmer or admin to repair.
  
 
  Fair reasoning, but it amounts to throwing a bucket of cold water in
  the face of your user. If I was looking at an error like that, I'd get
  mighty annoyed with the software, and after a while would definitely
  look for alternatives. Whether or not there's a coding problem, you
  have to look at the situation from the point of the user: a complete
  failure with no information is like a BSOD/TSOD ... and we all know
  the effect they have on a user.
 
  I assume (1) that I've vetted the user data and given them the option to
  repair it if it's faulty; (2) beyond the beta phase, this type of error
  should not happen. If it does, it's a coding problem. Given that the
  user can do *nothing* about this and it *is* a coding problem, what
  would you tell the user?

 Sorry, but there was a problem inserting the data into the database.
 The developers have been notified about this error and will hopefully
 have it fixed very soon. We apologize for the inconvenience.

 At the very least, something along those lines.

 Well of course. No reason to slap the user in the face. I agree. But in
 the end, this is about the same as saying, Talk to the programmer,
 just a nicer way of saying it.

Of course, it's just a question of degree. If the user can't correct
the error, there's only one person that can: the programmer. Question
is what you tell the user in that situation.


  If I was the user, I'd be cranky as well. But if I were a smart user,
  I'd realize that the programmer made a mistake and put the
  responsibility firmly on him. And expect him to fix it pronto.

 If only the world consisted of smart users ... I think, however, that
 we're generally closer to the opposite. And no, I don't hate users -
 I've just seen too many people do things that were very far removed
 from smart.

 Unfortunately, true. Sometimes I think computer users should be required
 to take a course in using a computer before being allowed behind the
 keyboard.


While I love to rant at stupid users, the truth is probably that
programmers are the ones who should take courses in how users think.
In the end, if I fail to understand my users, it doesn't matter how
great my program is: they'll still fail to use it. Anyway, those are
just truisms :) Nothing new under the sun.

Regards
Peter

-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
/hype

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Nathan Rixham
Peter Lind wrote:
 On 27 April 2010 16:24, Paul M Foster pa...@quillandmouse.com wrote:
 On Tue, Apr 27, 2010 at 04:13:20PM +0200, Peter Lind wrote:

 On 27 April 2010 16:07, Paul M Foster pa...@quillandmouse.com wrote:
 On Tue, Apr 27, 2010 at 03:41:04PM +0200, Peter Lind wrote:

 On 27 April 2010 15:36, Paul M Foster pa...@quillandmouse.com wrote:
 On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote:

 How do you guys handle errors during, say, db insertions.

 Let's say you have an ongoing transaction which fails on the n-th
 insert. Ok, you roll back the transaction, no problem. How do you then
 inform the user? Just using the text from pg_result_error  or
 something?
 I use trigger_error() and stop execution at that point. I give the user
 an error that basically says, Talk to the admin/programmer. And I send
 the programmer a message containing a trace of what occurred. The theory
 is that, all things being equal, such an error should never occur and
 there is no user recovery. If the user properly entered the data they
 were asked for, then the transaction should go through without incident.
 If something prevents the transaction from going through, it's likely a
 coding problem and up to the programmer or admin to repair.

 Fair reasoning, but it amounts to throwing a bucket of cold water in
 the face of your user. If I was looking at an error like that, I'd get
 mighty annoyed with the software, and after a while would definitely
 look for alternatives. Whether or not there's a coding problem, you
 have to look at the situation from the point of the user: a complete
 failure with no information is like a BSOD/TSOD ... and we all know
 the effect they have on a user.
 I assume (1) that I've vetted the user data and given them the option to
 repair it if it's faulty; (2) beyond the beta phase, this type of error
 should not happen. If it does, it's a coding problem. Given that the
 user can do *nothing* about this and it *is* a coding problem, what
 would you tell the user?
 Sorry, but there was a problem inserting the data into the database.
 The developers have been notified about this error and will hopefully
 have it fixed very soon. We apologize for the inconvenience.

 At the very least, something along those lines.
 Well of course. No reason to slap the user in the face. I agree. But in
 the end, this is about the same as saying, Talk to the programmer,
 just a nicer way of saying it.
 
 Of course, it's just a question of degree. If the user can't correct
 the error, there's only one person that can: the programmer. Question
 is what you tell the user in that situation.
 
 If I was the user, I'd be cranky as well. But if I were a smart user,
 I'd realize that the programmer made a mistake and put the
 responsibility firmly on him. And expect him to fix it pronto.
 If only the world consisted of smart users ... I think, however, that
 we're generally closer to the opposite. And no, I don't hate users -
 I've just seen too many people do things that were very far removed
 from smart.
 Unfortunately, true. Sometimes I think computer users should be required
 to take a course in using a computer before being allowed behind the
 keyboard.

 
 While I love to rant at stupid users, the truth is probably that
 programmers are the ones who should take courses in how users think.
 In the end, if I fail to understand my users, it doesn't matter how
 great my program is: they'll still fail to use it. Anyway, those are
 just truisms :) Nothing new under the sun.

I'm still shocked you guys are still writing code that has errors in it,
what's worse is you know about the errors, and instead of fixing them
you're just telling the user about it!

:p

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Teus Benschop
 I'm still shocked you guys are still writing code that has errors in it,
 what's worse is you know about the errors, and instead of fixing them
 you're just telling the user about it!
 

The point here is that we, programmers, know that we write code with
bugs in it. We are realistic about it, that is, we know that perfect
code does not exist, and that there are bugs in it. So what we care
about is to bring this reality to the users in a gracious manner. And
the other thing is that if for example a database is down, that is not
our fault, it is an external error, but this error should be brought to
the user as well. Teus.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd

At 9:36 AM -0400 4/27/10, Paul M Foster wrote:

On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote:


 How do you guys handle errors during, say, db insertions.

 Let's say you have an ongoing transaction which fails on the n-th
 insert. Ok, you roll back the transaction, no problem. How do you then
 inform the user? Just using the text from pg_result_error  or
 something?


I use trigger_error() and stop execution at that point. I give the user
an error that basically says, Talk to the admin/programmer. And I send
the programmer a message containing a trace of what occurred. The theory
is that, all things being equal, such an error should never occur and
there is no user recovery. If the user properly entered the data they
were asked for, then the transaction should go through without incident.
If something prevents the transaction from going through, it's likely a
coding problem and up to the programmer or admin to repair.

Paul



+1

I do something similar with the accounts I want to monitor.

For example, when I access the database during development, I use 
code similar to this --


// --- script
$sql = SELECT * FROM users WHERE user_id = $uid ;
$result = mysql_query($sql) or die(report($query,__LINE__ ,__FILE__));
// --

-- and then a report function similar to this --

// -- functions
function report($query, $line, $file)
   {
   echo($query . 'br /' .$line . 'br /' . $file . 'br /' . 
mysql_error());

   }
// --

This provides me with information as to what happened and where.

When the project goes live (out of development) then I replace the 
report function with code that can send me an email telling me what 
happened (to what domain) as well as an explanation to the user 
(screen display and sometimes even email) and sometimes an email is 
sent to the client (i.e., the user's credit card was denied for xxx 
reason trying to purchase product xxx at this date).


Note, all my error reporting functions are located in a single 
function script that is included with every script that has access to 
the database. That way I can turn on/off error reporting and make 
alterations as to how to handle errors in one file. The difference 
between development and live is a simply a change in one script.


Error handling is almost an art form.

Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Nathan Rixham
Teus Benschop wrote:
 I'm still shocked you guys are still writing code that has errors in it,
 what's worse is you know about the errors, and instead of fixing them
 you're just telling the user about it!

 
 The point here is that we, programmers, know that we write code with
 bugs in it. We are realistic about it, that is, we know that perfect
 code does not exist, and that there are bugs in it. So what we care
 about is to bring this reality to the users in a gracious manner. And
 the other thing is that if for example a database is down, that is not
 our fault, it is an external error, but this error should be brought to
 the user as well. Teus.
 

had hoped the addition of a (now stripped) :p emote would ensure taking
the above as a joke tbh  ;)

regardless, might I add that exceptions or errors mapped through to the
appropriate HTTP status code and a friendly site specific error document
may be a good way to proceed.

A good example of friendly error documents can be seen at most of the
major sites around the web that we all frequent (or are at least aware of).

Further, these friendly documents make it clear that the error is a
server / application error and that no action the user takes will fix
the error.

Best,

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd

At 4:13 PM +0200 4/27/10, Peter Lind wrote:

If only the world consisted of smart users ... I think, however, that
we're generally closer to the opposite. And no, I don't hate users -
I've just seen too many people do things that were very far removed
from smart.

Regards
Peter


Peter et al:

Smart is a relative term. I have one account where the majority of 
users are PhD's -- and they indeed have the smarts and the 
sheepskins to prove it.


You would be surprised as to how many of those forget their logons 
and insist that they did not enter their logons as they were 
recorded. For example, I had one user (i.e., fictitious Mary Smith) 
who said that marysmith was not her logon because she always uses 
msmith for all her logons -- but that was what was recorded in the 
database.


I tried to explain to her that the database doesn't make this stuff 
up, for example how would the script know to use marysmith for her 
logon if she had not provided it? But somehow it was the script's 
fault for not knowing she always uses msmith. Keep in mind these 
are people with PhD's. I have many other stories.


As I see it, one of the problems we face as developers is confronting 
user's egos. They have an image of themselves and our scripts can 
threaten that image by making them feel ignorant. We have to deal 
with that in a way that informs them, but doesn't demean them in any 
fashion.


Here's a real world example -- over 20 years ago a company made an 
electronic hand-held chess game.


While the game was successful, the company received a considerable 
amount of repairs, way over what they had expected. They wanted to 
find out why and after an investigation they found that their 
software made the computer's chess-moves TOO quickly. So, they place 
a time delay into the software so that it would look to the user 
like the computer was thinking about its moves. That time-delay 
solved the problem.


Apparently, some end-users got pissed when they thought the computer 
could so easily beat them. But, if the computer took more time to 
beat them, then that was more acceptable and the end-users were less 
inclined to throw the game into a wall.


So with respect to software engineering, how users view what's going 
on is important.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd

At 10:24 AM -0400 4/27/10, Paul M Foster wrote:

Unfortunately, true. Sometimes I think computer users should be required
to take a course in using a computer before being allowed behind the
keyboard.

Paul


Yeah, like I believe that everyone should do through at least one 
divorce before getting married.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Ashley Sheridan
On Tue, 2010-04-27 at 12:12 -0400, tedd wrote:

 At 4:13 PM +0200 4/27/10, Peter Lind wrote:
 If only the world consisted of smart users ... I think, however, that
 we're generally closer to the opposite. And no, I don't hate users -
 I've just seen too many people do things that were very far removed
 from smart.
 
 Regards
 Peter
 
 Peter et al:
 
 Smart is a relative term. I have one account where the majority of 
 users are PhD's -- and they indeed have the smarts and the 
 sheepskins to prove it.
 
 You would be surprised as to how many of those forget their logons 
 and insist that they did not enter their logons as they were 
 recorded. For example, I had one user (i.e., fictitious Mary Smith) 
 who said that marysmith was not her logon because she always uses 
 msmith for all her logons -- but that was what was recorded in the 
 database.
 
 I tried to explain to her that the database doesn't make this stuff 
 up, for example how would the script know to use marysmith for her 
 logon if she had not provided it? But somehow it was the script's 
 fault for not knowing she always uses msmith. Keep in mind these 
 are people with PhD's. I have many other stories.
 
 As I see it, one of the problems we face as developers is confronting 
 user's egos. They have an image of themselves and our scripts can 
 threaten that image by making them feel ignorant. We have to deal 
 with that in a way that informs them, but doesn't demean them in any 
 fashion.
 
 Here's a real world example -- over 20 years ago a company made an 
 electronic hand-held chess game.
 
 While the game was successful, the company received a considerable 
 amount of repairs, way over what they had expected. They wanted to 
 find out why and after an investigation they found that their 
 software made the computer's chess-moves TOO quickly. So, they place 
 a time delay into the software so that it would look to the user 
 like the computer was thinking about its moves. That time-delay 
 solved the problem.
 
 Apparently, some end-users got pissed when they thought the computer 
 could so easily beat them. But, if the computer took more time to 
 beat them, then that was more acceptable and the end-users were less 
 inclined to throw the game into a wall.
 
 So with respect to software engineering, how users view what's going 
 on is important.
 
 Cheers,
 
 tedd
 
 -- 
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com
 


Sounds like you've got a few stories that would a lot of people happy
were you to share them on the DailyWTF ;)

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd

At 4:31 PM +0200 4/27/10, Peter Lind wrote:

While I love to rant at stupid users, the truth is probably that
programmers are the ones who should take courses in how users think.
In the end, if I fail to understand my users, it doesn't matter how
great my program is: they'll still fail to use it. Anyway, those are
just truisms :) Nothing new under the sun.

Regards
Peter



Peter:

You're right on. I just read three books on the subject:

1. Don't Make Me Think by Steve Krug.

This is a somewhat dated book, but his perspective is right-on and 
is the basis for understanding usability.


2. Neuro Web Design bu Susan M. Weinschenk.

The theory behind why people do what they do is explained in great 
detail in this book. It makes a great book to read regardless of if 
you're trying to sell something on the net or elsewhere. However, 
this book is focused on selling things to people via the net.


3. Rocket Surgery Made Easy by Steve Krug.

This is the second book in Steve's How to do it yourself in 
usability studies. It will give you exactly what you need to do to 
set up inexpensive usability studies. Usability studies are important 
in software and web design.


If developers (and clients) read those books, we would have less 
problems dealing with users.


Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd

At 4:23 PM +0100 4/27/10, Nathan Rixham wrote:


I'm still shocked you guys are still writing code that has errors in it,
what's worse is you know about the errors, and instead of fixing them
you're just telling the user about it!

:p


Here's my code that doesn't contain errors:

?php

?

Cheers,

ted

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Peter Lind
On 27 April 2010 18:21, tedd tedd.sperl...@gmail.com wrote:
 At 4:31 PM +0200 4/27/10, Peter Lind wrote:

 While I love to rant at stupid users, the truth is probably that
 programmers are the ones who should take courses in how users think.
 In the end, if I fail to understand my users, it doesn't matter how
 great my program is: they'll still fail to use it. Anyway, those are
 just truisms :) Nothing new under the sun.

 Regards
 Peter


 Peter:

 You're right on. I just read three books on the subject:

 1. Don't Make Me Think by Steve Krug.

 This is a somewhat dated book, but his perspective is right-on and is the
 basis for understanding usability.

+1. Great book that is.

 2. Neuro Web Design bu Susan M. Weinschenk.

 The theory behind why people do what they do is explained in great detail in
 this book. It makes a great book to read regardless of if you're trying to
 sell something on the net or elsewhere. However, this book is focused on
 selling things to people via the net.

Will have to look at that, sounds interesting.

 3. Rocket Surgery Made Easy by Steve Krug.

 This is the second book in Steve's How to do it yourself in usability
 studies. It will give you exactly what you need to do to set up inexpensive
 usability studies. Usability studies are important in software and web
 design.

 If developers (and clients) read those books, we would have less problems
 dealing with users.


Haven't read his second, guess I should :) Thanks for the recommendations.

Regards
Peter


-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
/hype

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd

At 5:09 PM +0100 4/27/10, Ashley Sheridan wrote:




Sounds like you've got a few stories that would a lot of people 
happy were you to share them on the DailyWTF ;)


Thanks,
Ash


Ash:

Sharing them here is more direct and meaningful to what we do, but I 
will investigate what you suggest.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Paul M Foster
On Tue, Apr 27, 2010 at 12:12:31PM -0400, tedd wrote:

 At 4:13 PM +0200 4/27/10, Peter Lind wrote:
 If only the world consisted of smart users ... I think, however, that
 we're generally closer to the opposite. And no, I don't hate users -
 I've just seen too many people do things that were very far removed
 from smart.

 Regards
 Peter

 Peter et al:

 Smart is a relative term. I have one account where the majority of
 users are PhD's -- and they indeed have the smarts and the
 sheepskins to prove it.

 You would be surprised as to how many of those forget their logons
 and insist that they did not enter their logons as they were
 recorded. For example, I had one user (i.e., fictitious Mary Smith)
 who said that marysmith was not her logon because she always uses
 msmith for all her logons -- but that was what was recorded in the
 database.

 I tried to explain to her that the database doesn't make this stuff
 up, for example how would the script know to use marysmith for her
 logon if she had not provided it? But somehow it was the script's
 fault for not knowing she always uses msmith. Keep in mind these
 are people with PhD's. I have many other stories.

There's the problem right there. PhD egos. Seen it before.

In my company, we deal with a lot of doctors. For us, that means
chiropractors, dentists, veterinarians, optomotrists and the like. Who
we don't deal with is doctors of the MD variety. They are way too
arrogant, and their staffs typically back that claim up. The few times
we've dealt with them, it's always been a disaster.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Error handling strategies (db related)

2010-04-27 Thread Tommy Pham
 At 10:24 AM -0400 4/27/10, Paul M Foster wrote:
Unfortunately, true. Sometimes I think computer users should be
required to take a course in using a computer before being allowed
behind the keyboard.

Paul

I came across a term long ago amidst my readings: PEBKAC

Problem
Exists
Between
Keyboard
And
Chair

Regards,
Tommy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Gary .
On 4/27/10, tedd wrote:
 At 4:23 PM +0100 4/27/10, Nathan Rixham wrote:

I'm still shocked you guys are still writing code that has errors in it,
what's worse is you know about the errors, and instead of fixing them
you're just telling the user about it!

:p

 Here's my code that doesn't contain errors:

 ?php

 ?

Wow! What license are you applying to that? Can I re-use it without
fear or being sued for copyright infringement?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Andrew Ballard
On Tue, Apr 27, 2010 at 12:23 PM, tedd tedd.sperl...@gmail.com wrote:
 At 4:23 PM +0100 4/27/10, Nathan Rixham wrote:

 I'm still shocked you guys are still writing code that has errors in it,
 what's worse is you know about the errors, and instead of fixing them
 you're just telling the user about it!

 :p

 Here's my code that doesn't contain errors:

 ?php

 ?

 Cheers,

 ted

 --
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



Watch out for that new warning message:

br /
bWarning/b:  Deadbeat script. Your code does not do anything
useful in bteddscript.php/b on line b1/bbr /


:-)

Andrew

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Message - Need help troubleshooting

2010-03-02 Thread Rick Dwyer

On Mar 2, 2010, at 12:31 AM, Rene Veerman wrote:


i doubt you passed us the entire .js.php script..


The rest of the JS is as follows:

a href='javascript:loadOSS()'img src='/images/myimage.jpg'  
width='161' height='57' align='right' /Open Window...


As far as other PHP goes, the whole page is PHP so I wouldn't know  
where to even start.  My guess was that the problem was originating  
from the previous code I sent over, but I don't know enough PHP to be  
sure.





does the script itself ever fail, asides from showing this msg?


No it works fine.  The most annoying thing in making it difficult to  
to troubleshoot is this message does not always appear.



--Rick







On Tue, Mar 2, 2010 at 5:46 AM, Rick Dwyer rpdw...@earthlink.net  
wrote:

Hello List.

I have some JS code that open a new window with a contact form in  
it.  When
the link is clicked to open the new window, I will get the  
following error

SOMETIMES:

Warning: Unknown: Your script possibly relies on a session side- 
effect
which existed until PHP 4.2.3. Please be advised that the session  
extension

does not consider global variables as a source of data, unless
register_globals is enabled. You can disable this functionality and  
this
warning by setting session.bug_compat_42 or session.bug_compat_warn  
to off,

respectively. in Unknown on line 0

My JS code with a bit of PHP in it looks like this:

function loadOSS()
var oss_itemid = ?php echo $item_id; ?;
var loadOSS = window.open(my_url/my_file.php?iid= + oss_itemid, ,
scrollbars 
= 
no 
,menubar 
= 
no 
,height 
=600,width=600,resizable=yes,toolbar=no,location=no,status=no);

}

As I said above, the error message does not always appear.

Is the error due to the fact I am JS  PHP together?

Any help in understanding what I am doing wrong is appreciated.

 --Rick



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Message - Need help troubleshooting

2010-03-02 Thread Rene Veerman
k, add ?php error_reporting(0); ? to your script,
to prevent the error from showing.

On Tue, Mar 2, 2010 at 2:38 PM, Rick Dwyer rpdw...@earthlink.net wrote:
 On Mar 2, 2010, at 12:31 AM, Rene Veerman wrote:
 does the script itself ever fail, asides from showing this msg?

 No it works fine.  The most annoying thing in making it difficult to to
 troubleshoot is this message does not always appear.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error Message - Need help troubleshooting

2010-03-02 Thread Ashley Sheridan
On Tue, 2010-03-02 at 14:49 +0100, Rene Veerman wrote:

 k, add ?php error_reporting(0); ? to your script,
 to prevent the error from showing.
 
 On Tue, Mar 2, 2010 at 2:38 PM, Rick Dwyer rpdw...@earthlink.net wrote:
  On Mar 2, 2010, at 12:31 AM, Rene Veerman wrote:
  does the script itself ever fail, asides from showing this msg?
 
  No it works fine.  The most annoying thing in making it difficult to to
  troubleshoot is this message does not always appear.
 


If there is a genuine problem, that won't actually fix it though.

How is $item_id created? You've not shown that in your PHP script
examples.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Error Message - Need help troubleshooting

2010-03-02 Thread Rick Dwyer

On Mar 2, 2010, at 8:48 AM, Ashley Sheridan wrote:


How is $item_id created? You've not shown that in your PHP script  
examples.


// parse item id from the url
$refer=$_SERVER['HTTP_REFERER'];
$thispage=$_SERVER['PHP_SELF'];
$item_id=substr($thispage, -9);
$item_id=substr($item_id, 0, 5);

$_SESSION['item_id'] = $item_id;

The above is where item_id is created and added to a session.

The important thing is that this error never showed up before until I  
added the Javascript link below:


var oss_itemid = ?php echo $item_id; ?;
var loadOSS = window.open(http://www.myurl/myfile.php?iid=; +  
oss_itemid, ,  
scrollbars 
= 
no 
,menubar 
= 
no 
,height=600,width=600,resizable=yes,toolbar=no,location=no,status=no);



When I was testing initially, I had removed the variable above in the  
link with a hard coded value and I never received this error.  Only  
when I made it dynamic did this error appear.


Thanks for any help.

--Rick

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   3   4   5   6   7   8   9   10   >