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



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



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



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

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



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] 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



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
 



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

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



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



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



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



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



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 Ashley Sheridan
On Tue, 2010-04-27 at 12:31 -0400, tedd wrote:

 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
 


I've just spent my last weeks worth of spare time looking at the last
few years of posts on that site, and the IT and programming related ones
just make me chuckle!

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




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



Re: [PHP] Error Message - Need help troubleshooting

2010-03-02 Thread Ashley Sheridan
On Tue, 2010-03-02 at 09:35 -0500, Rick Dwyer wrote:

 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
 

I'm assuming then that both the Javascript an the PHP code you have
above are both on the same page. The only way I can see your problem
occurring would be if your javascript part was on a different page and
you were attempting to output the $item_id. If PHP could not find a
variable with that name, it may be reverting to using the item_id value
found in $_SESSION, which would give you the error you're seeing.

Try changing the line to

var oss_itemid = ?php echo $_SESSION['item_id']; ?;

and see if that gives you the error.

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




Re: [PHP] Error Message - Need help troubleshooting

2010-03-02 Thread Joseph Thayne
I do not know if the question has been answered, but how are you opening 
the session?  Are you using session_start() or are you using 
session_register()?


Rick Dwyer wrote:

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



Re: [PHP] Error Message - Need help troubleshooting

2010-03-02 Thread Rick Dwyer


On Mar 2, 2010, at 9:35 AM, Ashley Sheridan wrote:

I'm assuming then that both the Javascript an the PHP code you have  
above are both on the same page. The only way I can see your problem  
occurring would be if your javascript part was on a different page  
and you were attempting to output the $item_id. If PHP could not  
find a variable with that name, it may be reverting to using the  
item_id value found in $_SESSION, which would give you the error  
you're seeing.



Yes this is the case.

However, what you said brings up a point if interest.  The page that  
the link is bringing up contains the following:


if ($_GET[iid]=='') {
$item_id = ($_SESSION[item_id]);
}
else
{
$item_id = $_GET[iid];
}

This code determines if the user is getting there from the initial  
link and if so, sets the variable item_id to the value passed in the  
URL.
Again however, this was not returning errors when the link was  
hardcoded with a value in place of item_id.


--Rick


--
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 9:45 AM, Joseph Thayne wrote:

I do not know if the question has been answered, but how are you  
opening the session?  Are you using session_start() or are you using  
session_register()?


Hi Joseph.

It is created via:

session_start();

--Rick


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



Re: [PHP] Error message

2009-09-05 Thread Tommy Pham
- Original Message 
 From: Bruce Dobson bruce_...@yahoo.co.nz
 To: php-general@lists.php.net
 Sent: Saturday, September 5, 2009 4:19:29 PM
 Subject: [PHP] Error message
 
 Hi folks,
 
 I am new on this list and to php. I have just downloaded and gotten php 5.3.0 
 working with IIS on one computer but my efforts to install it on another 

What OS? What version of IIS?  Did you setup as CGI/FCGI or as ISAPI?

 computer come up with the error message:  
 
 14001 (0x36b1) 
 
 Can anybody tell me what this relates to?

Did you enable file logging in the php.ini?  PS: you might want to ask this in 
php-windows list instead. ;)

Regards,
Tommy

 
 Thanks
 Bruce

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



Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread hack988 hack988
Some Php's tigger info output to client before you set header.try this
code first
---
ob_start();//first line write this code
some code for your self
header(location:index.php);
ob_end_flush();
---
second.
You must check php.ini found that if flush implicit option turn on.
implicit_flush = On
=
implicit_flush = Off

test your codes again.

If codes run correctly,check your codes line by lines ,found that such
as 'echo','print'... and so on before 'you
header(location:index.php)' line.
2009/8/28 Keith survivor_...@hotmail.com:
 I have a user sign up page that collects sign up information from user with
 form.
 This form will then be submitted to another process.php page for setting up
 the user account and send email to the user.
 After the email been sent out, the user will be directed back to homepage
 with header(location: index.php).
 However, error happen with warning: [Cannot modify header information -
 headers already sent by...]
 Any workaround for this?

 Thanks for help!
 Keith



 --
 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 when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Ashley Sheridan
On Fri, 2009-08-28 at 17:32 +0800, Keith wrote:
 I have a user sign up page that collects sign up information from user with 
 form.
 This form will then be submitted to another process.php page for setting up 
 the user account and send email to the user.
 After the email been sent out, the user will be directed back to homepage 
 with header(location: index.php).
 However, error happen with warning: [Cannot modify header information - 
 headers already sent by...]
 Any workaround for this?
 
 Thanks for help!
 Keith
  
 
 

You don't need a workaround. The header(Location...) thing will only
work if you have not sent any content to the browser yet. That includes
even a single space or newline.

It looks like in your process.php page, something is being output to the
browser. Are you able to do a code dump of that page?

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




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



Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Floyd Resler
Another solution would be to use JavaScript.  In your process.php  
script you could do this:

printhere
script language=javascript
window.location.href=index.php
/script
here;

Not strictly a PHP solution but it works.

Take care,
Floyd

On Aug 28, 2009, at 5:34 AM, Ashley Sheridan wrote:


On Fri, 2009-08-28 at 17:32 +0800, Keith wrote:
I have a user sign up page that collects sign up information from  
user with

form.
This form will then be submitted to another process.php page for  
setting up

the user account and send email to the user.
After the email been sent out, the user will be directed back to  
homepage

with header(location: index.php).
However, error happen with warning: [Cannot modify header  
information -

headers already sent by...]
Any workaround for this?

Thanks for help!
Keith





You don't need a workaround. The header(Location...) thing will only
work if you have not sent any content to the browser yet. That  
includes

even a single space or newline.

It looks like in your process.php page, something is being output to  
the

browser. Are you able to do a code dump of that page?

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




--
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 when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Martin Scotta
On Fri, Aug 28, 2009 at 9:36 AM, Floyd Resler fres...@adex-intl.com wrote:

 Another solution would be to use JavaScript.  In your process.php script
 you could do this:
 printhere
 script language=javascript
window.location.href=index.php
 /script
 here;

 Not strictly a PHP solution but it works.

 Take care,
 Floyd


 On Aug 28, 2009, at 5:34 AM, Ashley Sheridan wrote:

  On Fri, 2009-08-28 at 17:32 +0800, Keith wrote:

 I have a user sign up page that collects sign up information from user
 with
 form.
 This form will then be submitted to another process.php page for setting
 up
 the user account and send email to the user.
 After the email been sent out, the user will be directed back to homepage
 with header(location: index.php).
 However, error happen with warning: [Cannot modify header information -
 headers already sent by...]
 Any workaround for this?

 Thanks for help!
 Keith




 You don't need a workaround. The header(Location...) thing will only
 work if you have not sent any content to the browser yet. That includes
 even a single space or newline.

 It looks like in your process.php page, something is being output to the
 browser. Are you able to do a code dump of that page?

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




 --
 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


Actually there aren't a safe way to make a redirect. Every technique relies
on the client-side to perform the redirection.

We have 4 alternatives (correct me if I miss anything) to do a safe
redirection.

   1. header Location
   2. meta tag refresh
   3. javascript
   4. the user


We will try every one in the given order...

Let's suppose we want to redirect the client to $url...

?php

session_write_close();
header( 'Location: '. $url ); # redirect by http header (1)

?html
head
titleRedirecting.../title

!-- redirect by meta tag (2) --
meta http-equiv=refresh content=2;url=?php echo $url? /

script type=text/javascript/*![CDATA[*/
// redirect by javascript (3)
window.location = '?php echo $url ?';
/*]]*//script

/head
body
pYou are about to be redirected to ?php echo $url? in 2
seconds/p
p
!-- redirect by user (4) --
a href=?php echo $url?
Click here if your browser do not redirect automatically
/a
/p
/body
/html
?php exit; ?


It's recommended that your use a common redirect method in your site, this
is not mandatory but it is a good practice.

This simple script also helps to prevent session problems under some evil
web-server by closing the session before any output.



-- 
Martin Scotta


Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Ashley Sheridan
On Fri, 2009-08-28 at 10:34 -0300, Martin Scotta wrote:
 Actually there aren't a safe way to make a redirect 
 
 We have 4 alternatives (correct me if I miss anything) to do a safe
 redirection.

Erm wtf?!

The best bet is always going with a header() redirect. The only time
I've seen that fail is when the developer of the PHP script has made a
mistake. The browser should always honor this type of redirect, and you
have none of the issues with Javascript turned off, browser plugins
blocking redirects, or stupid users etc.

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




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



Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Keith

Hi all,
Yes, you are right, it was due to echo for testing purpose not been 
commented out prior to header().
However, there is hidden root cause too --  PHPMailer will echo invalid 
address to the screen.
When I have tested with 1 valid email address and 1 invalid with 
someth...@locahost, PHPMailer will echo out the invalid someth...@localhost.
However, in this case, $mail-send() still will return value of TRUE as long 
as at least 1 email been sent out.
After I have commented out all these [echo], no more header issue occur 
again.


It's works too using Floyd's recommended javascript! However, the message 
will echoed out first before redirect to index.php, but this is fast enough 
to be neglectable.


I have one more question regarding error logging.
I have set as below:

ini_set('log_errors', 1);
ini_set('error_log', http://domain.com/log/logfile.txt;);
ini_set('error_reporting', 'E_ALL');
ini_set('error_append_string', '\r\n');

I have simulated an error which can be displayed on screen because I've put 
ini_set('display_errors',1).

However, the error was not been logged.

Which format should I used for log file? *.log or *.txt?

Since I'm using third party web hosting, I can only access web directory, 
should I use

[http://domain.com/log/logfile.*] or
[C:\some_path\domain.com\log\logfile.*] or just
[/log/logfile.*]?

Thanks!
Keith


Floyd Resler fres...@adex-intl.com wrote in message 
news:a536e452-54a2-4f55-8ae0-28e875a59...@adex-intl.com...
Another solution would be to use JavaScript.  In your process.php  script 
you could do this:

printhere
script language=javascript
window.location.href=index.php
/script
here;

Not strictly a PHP solution but it works.

Take care,
Floyd

On Aug 28, 2009, at 5:34 AM, Ashley Sheridan wrote:


On Fri, 2009-08-28 at 17:32 +0800, Keith wrote:
I have a user sign up page that collects sign up information from  user 
with

form.
This form will then be submitted to another process.php page for 
setting up

the user account and send email to the user.
After the email been sent out, the user will be directed back to 
homepage

with header(location: index.php).
However, error happen with warning: [Cannot modify header  information -
headers already sent by...]
Any workaround for this?

Thanks for help!
Keith





You don't need a workaround. The header(Location...) thing will only
work if you have not sent any content to the browser yet. That  includes
even a single space or newline.

It looks like in your process.php page, something is being output to  the
browser. Are you able to do a code dump of that page?

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




--
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 when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Martin Scotta
On Fri, Aug 28, 2009 at 10:39 AM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:

 On Fri, 2009-08-28 at 10:34 -0300, Martin Scotta wrote:
  Actually there aren't a safe way to make a redirect
 
  We have 4 alternatives (correct me if I miss anything) to do a safe
  redirection.

 Erm wtf?!

 The best bet is always going with a header() redirect. The only time
 I've seen that fail is when the developer of the PHP script has made a
 mistake. The browser should always honor this type of redirect, and you
 have none of the issues with Javascript turned off, browser plugins
 blocking redirects, or stupid users etc.

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




What you are is truth if it only applies to computer browsers.
There are many clients where the Location header don't work.

Curl is a good example, you can determine to follow the Redirect or just
skip it.
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false)

Another example could be mobile phones, especially wml based, do not follow
a redirection and you have to provide a click here to redirect link and
relies on the user to follow the redirection.

Do not trust that your client is always a browser. It could be anything that
can open a connection and send a request.

Also you can't know who is at the other side. The client can provide fake
UA, IP, everything... or can't send anything but the need to make a valid
request.

-- 
Martin Scotta


Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Stuart
2009/8/28 Martin Scotta martinsco...@gmail.com:
 On Fri, Aug 28, 2009 at 10:39 AM, Ashley Sheridan
 a...@ashleysheridan.co.ukwrote:

 On Fri, 2009-08-28 at 10:34 -0300, Martin Scotta wrote:
  Actually there aren't a safe way to make a redirect
 
  We have 4 alternatives (correct me if I miss anything) to do a safe
  redirection.

 Erm wtf?!

 The best bet is always going with a header() redirect. The only time
 I've seen that fail is when the developer of the PHP script has made a
 mistake. The browser should always honor this type of redirect, and you
 have none of the issues with Javascript turned off, browser plugins
 blocking redirects, or stupid users etc.

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




 What you are is truth if it only applies to computer browsers.
 There are many clients where the Location header don't work.

 Curl is a good example, you can determine to follow the Redirect or just
 skip it.
 curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false)

 Another example could be mobile phones, especially wml based, do not follow
 a redirection and you have to provide a click here to redirect link and
 relies on the user to follow the redirection.

 Do not trust that your client is always a browser. It could be anything that
 can open a connection and send a request.

 Also you can't know who is at the other side. The client can provide fake
 UA, IP, everything... or can't send anything but the need to make a valid
 request.

In the realm of assumptions made by developers, that the client
understands and will correctly process a 301/302 response is one of
the safer assumptions. It's certainly safer than assuming the client
will respect a meta tag or javascript.

If you really try to deal with every possible client to that extent
you'll never ship anything. Yes it's important to be as supportive as
possible, but care should be taken to pick the battles that are worth
fighting.

-Stuart

-- 
http://stut.net/

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



Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Ben Dunlap
 Which format should I used for log file? *.log or *.txt?

Doesn't matter to PHP -- but you do need to provide a local path, not a URL.

 [http://domain.com/log/logfile.*] or

No...

 [C:\some_path\domain.com\log\logfile.*] or just

Yes!

Ben

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



Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Ashley Sheridan
On Fri, 2009-08-28 at 09:28 -0700, Ben Dunlap wrote:
  Which format should I used for log file? *.log or *.txt?
 
 Doesn't matter to PHP -- but you do need to provide a local path, not a URL.
 
  [http://domain.com/log/logfile.*] or
 
 No...
 
  [C:\some_path\domain.com\log\logfile.*] or just
 
 Yes!
 
 Ben
 
You should try and put the log somewhere that is not in the web root, to
prevent anyone from accessing it and getting information which could
help a hack.


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




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



Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Keith

Ash, Ben, Thanks!

For my web server, I can access to:
./httpdocs
./httpsdocs

all the http documents are stored inside httpdocs and SSL documents inside 
httpsdocs.
The web root you mean here is referred to ./httpdocs and ./httpsdocs or the 
parent directory of them?
If I  put the logfile inside ./log/logfile.txt where ./log is same level as 
./httpdocs, can the web users access it?


Thanks!
Keith


Ashley Sheridan a...@ashleysheridan.co.uk wrote in message 
news:1251477059.27899.117.ca...@localhost...

On Fri, 2009-08-28 at 09:28 -0700, Ben Dunlap wrote:

 Which format should I used for log file? *.log or *.txt?

Doesn't matter to PHP -- but you do need to provide a local path, not a 
URL.


 [http://domain.com/log/logfile.*] or

No...

 [C:\some_path\domain.com\log\logfile.*] or just

Yes!

Ben


You should try and put the log somewhere that is not in the web root, to
prevent anyone from accessing it and getting information which could
help a hack.


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





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



Re: [PHP] Error Trapping

2009-07-10 Thread Eddie Drapkin
On Fri, Jul 10, 2009 at 10:56 AM, Floyd Reslerfres...@adex-intl.com wrote:
 I'm having a hard time getting my head around this problem.  I have to
 connect to a FoxPro database using an ODBC driver.  Sometimes when I connect
 I get an error.  The error doesn't occur all the time and usually another
 connect attempt works.  I can trap the error through an error handler.
  However, I use a class to connect to the database.  What I want to do is to
 check for that error and, if it occurs, try to connect again.  Since the
 error handler is outside the class, how can I create the object again and
 make sure it gets passed back to my script that called it?  I hope that made
 sense!

 Thanks!
 Floyd

Why is the error outside the class? If you connect with a class, something like:

public function __construct() {
  $this-handle = false;
  while($this-handle === false) {
$this-handle == odbc_connect();
  }
}

ought to work fine.  Alternatively, you could check out PDO, which is
supposed to be the next generation of database connections in PHP, and
won't create an object without a connection.

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



Re: [PHP] Error Trapping

2009-07-10 Thread Floyd Resler

Eddie,
	Thanks for the tip.  It suddenly occurred to me what I was doing  
wrong.  I do use an error trap but I was telling my script to stop  
running after the error.  So, now I ignore it and continue through the  
loop you suggested.  I guess it was working exactly the way I had  
written it!


Thanks!
Floyd

On Jul 10, 2009, at 11:23 AM, Eddie Drapkin wrote:

On Fri, Jul 10, 2009 at 10:56 AM, Floyd Reslerfres...@adex- 
intl.com wrote:
I'm having a hard time getting my head around this problem.  I have  
to
connect to a FoxPro database using an ODBC driver.  Sometimes when  
I connect
I get an error.  The error doesn't occur all the time and usually  
another
connect attempt works.  I can trap the error through an error  
handler.
 However, I use a class to connect to the database.  What I want to  
do is to
check for that error and, if it occurs, try to connect again.   
Since the
error handler is outside the class, how can I create the object  
again and
make sure it gets passed back to my script that called it?  I hope  
that made

sense!

Thanks!
Floyd


Why is the error outside the class? If you connect with a class,  
something like:


public function __construct() {
 $this-handle = false;
 while($this-handle === false) {
   $this-handle == odbc_connect();
 }
}

ought to work fine.  Alternatively, you could check out PDO, which is
supposed to be the next generation of database connections in PHP, and
won't create an object without a connection.




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



Re: [PHP] Error Trapping

2009-07-10 Thread Eddie Drapkin
On Fri, Jul 10, 2009 at 11:39 AM, Floyd Reslerfres...@adex-intl.com wrote:
 Eddie,
        Thanks for the tip.  It suddenly occurred to me what I was doing
 wrong.  I do use an error trap but I was telling my script to stop running
 after the error.  So, now I ignore it and continue through the loop you
 suggested.  I guess it was working exactly the way I had written it!

 Thanks!
 Floyd

 On Jul 10, 2009, at 11:23 AM, Eddie Drapkin wrote:

 On Fri, Jul 10, 2009 at 10:56 AM, Floyd Reslerfres...@adex-intl.com
 wrote:

 I'm having a hard time getting my head around this problem.  I have to
 connect to a FoxPro database using an ODBC driver.  Sometimes when I
 connect
 I get an error.  The error doesn't occur all the time and usually another
 connect attempt works.  I can trap the error through an error handler.
  However, I use a class to connect to the database.  What I want to do is
 to
 check for that error and, if it occurs, try to connect again.  Since the
 error handler is outside the class, how can I create the object again and
 make sure it gets passed back to my script that called it?  I hope that
 made
 sense!

 Thanks!
 Floyd

 Why is the error outside the class? If you connect with a class, something
 like:

 public function __construct() {
  $this-handle = false;
  while($this-handle === false) {
   $this-handle == odbc_connect();
  }
 }

 ought to work fine.  Alternatively, you could check out PDO, which is
 supposed to be the next generation of database connections in PHP, and
 won't create an object without a connection.




;)

Sometimes all it takes is a fresh look at an old problem!

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



Re: [PHP] error with hosting

2009-04-24 Thread Andrew Ballard
On Tue, Apr 21, 2009 at 1:20 PM, Jan G.B. ro0ot.w...@googlemail.com wrote:
 Do yourself a favour:

 * remopve that 1337 hax0r name - it makes you look like a dumbass

This coming from someone whose e-mail address is ro0ot.w...@?
Sounds a little ironic.  ;-)

Andrew

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



Re: [PHP] error with hosting

2009-04-24 Thread Jan G.B.
2009/4/24 Andrew Ballard aball...@gmail.com:
 On Tue, Apr 21, 2009 at 1:20 PM, Jan G.B. ro0ot.w...@googlemail.com wrote:
 Do yourself a favour:

 * remopve that 1337 hax0r name - it makes you look like a dumbass

 This coming from someone whose e-mail address is ro0ot.w...@?
 Sounds a little ironic.  ;-)

Got me. ;)
But try to find any free google-name like Jan, etc.. I was looking
for something with root in the address. and actually this is only
the address, not my NAME.

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



Re: [PHP] error with hosting

2009-04-24 Thread 9el
On Fri, Apr 24, 2009 at 7:41 PM, Jan G.B. ro0ot.w...@googlemail.com wrote:

 2009/4/24 Andrew Ballard aball...@gmail.com:
  On Tue, Apr 21, 2009 at 1:20 PM, Jan G.B. ro0ot.w...@googlemail.com
 wrote:
  Do yourself a favour:
 
  * remopve that 1337 hax0r name - it makes you look like a dumbass
 
  This coming from someone whose e-mail address is ro0ot.w...@?
  Sounds a little ironic.  ;-)

 Got me. ;)
 But try to find any free google-name like Jan, etc.. I was looking
 for something with root in the address. and actually this is only
 the address, not my NAME.


HAHAHAHA  you gotta look at this :D http://tr.im/jxK7


Re: [PHP] error with hosting

2009-04-21 Thread Jan G.B.
2009/4/21 ®0L¥ rol...@gmail.com:
 I have a littli application in PHP that I do with appserv, in my local
 server work ok but when I upload de page.php to the hosting server don't
 work, the hosting say in your page that support php and the web server is
 apache because the directory is httpdocs, and why my page dond;t work in the
 hosting and work ok in my local server ??


 //before I have a html form

  form action=find.php method=post
                  tr
                    td height=24 valign=top class=menu
 style=text-align: lefttable width=210 border=0 cellspacing=0
 cellpadding=0
                      tr
                        td width=7 height=23
 class=text_1/span/td
                        td width=105span class=text_1Your Company
 Name:/span/td
                        td width=98 valign=topinput name=cname
 type=text size=11 maxlength=20 align=right/td
                      /tr
                    /table/td
                  /tr
                  tr
                   td height=22 valign=toptable width=210
 border=0 cellspacing=0 cellpadding=0
                      tr
                        td width=7 height=22
 class=text_1/span/td
                        td width=105span class=text_1Your E-Mail
 Address:/span/td
                        td width=98 valign=topinput name=email
 type=text size=11 maxlength=40 align=right/td
                      /tr
                    /table/td
                  /tr
                  tr
                    td height=42 valign=toptable width=210
 border=0 cellspacing=0 cellpadding=0
                      tr
                        td class=text_1 width=124 height=27 Find by
 Zip Code: /td
                        td width=86input name=zip type=text
 size=9 maxlength=5 align=right/td
                        /tr
                    /table
                      table width=210 border=0 cellspacing=0
 cellpadding=0
                        tr
                          td class=text_1 width=90 height=22/td
                          td width=79/td
                          td width=41 valign=bottominput type=image
 src=images/find.jpg width=33 height=20/td
                        /tr
                      /table/td
                  /tr
 /form


 // I try with this application in find.php


 ?
                if (!$cname)
                {
                    echo font color=\maroon\Enter your Company
 Name./font;
                }
                elseif
 (!ereg(^[a-za-z0-9_\...@[a-za-z0-9\-]+\.[a-za-z0-9\-\.]+$, $email))
                {

Do yourself a favour:

* remopve that 1337 hax0r name - it makes you look like a dumbass
* buy a PHP related book
* change your code to work with register_globals OFF
* don't rely on regular expressions to validate an email without
reading the email RFC nor knowing regular expressions
* don't use ereg! preg is what you want
instead you can check out filter_input() on http://php.net/manual ..
Look out for FILTER_VALIDATE_EMAIL


* Have a nice day [optional]
:-)





                    echo font color=\maroon\Enter a Valid E-Mail
 Address./font;
                }
                elseif (strlen($zip)5)
                {
                    echo font color=\maroon\Enter a Valid Zip
 Code./font;
                }
                elseif (ereg([^0-9], $zip))
                {
                    echo font color=\maroon\Enter a Valid Zip
 Code./font;
                }
                else
                {
                    echo font color=\maroon\Find an Agent close to
 you./font;
                }
  ?

 Thanks to all.

 --
 salu2 ®0L¥


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



Re: [PHP] Error on .htaccess

2009-04-01 Thread Daniel Brown
On Wed, Apr 1, 2009 at 10:39, Igor Escobar titiolin...@gmail.com wrote:
 In all the servers i had tested my system i dont have any problem, but in
 this server the apache are displaying to me the error 500 Internal Server
 Error.

 Someone can say tome what is wront with my .htaccess?

This is a question for the Apache list, Igor, it has nothing to do
with PHP in this particular case.

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1

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



Re: [PHP] Error on .htaccess

2009-04-01 Thread Virgilio Quilario
 In all the servers i had tested my system i dont have any problem, but in
 this server the apache are displaying to me the error 500 Internal Server
 Error.

 Someone can say tome what is wront with my .htaccess?

 RewriteEngine On
 IfModule mod_rewrite.c
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond $1 !-d
 RewriteRule ^(.*)$ load.php?$1 [QSA,L]
 /IfModule

 This server are running PHP 5.2.9 and Apache 1.3.41 (Unix).

 Regards,
 Igor Escobar
 systems analyst  interface designer
 www . igorescobar . com


hi Igor,

try this and make sure load.php exist in your root web folder.

IfModule mod_rewrite.c
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !-d
RewriteRule ^(.*)$ /load.php?$1 [QSA,L]
/IfModule

not sure what you are trying to achieve with this line
RewriteRule ^(.*)$ /load.php?$1 [QSA,L]

i you mean to pass the query string, replace $1 with %{QUERY_STRING}

good luck

virgil
http://www.jampmark.com

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



Re: [PHP] Error printer_open()

2009-03-27 Thread Bastien Koert
On Fri, Mar 27, 2009 at 8:37 AM, Gerardo Picotti gpico...@erio.com.arwrote:

 Hi.
 I'm trying to use the printer functions in my php development.
 I add the php_printer.dll in the c:/php/ext/ path.
 I add the line in the php.ini file like that: extension=php_printer.dll.
 But that doesn't work and gives the next error:

 Fatal error: Call to undefined function printer_open().

 What can I do?
 Thanks for your help!


 Gerardo


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

 Does the php_printer.dll exist in the EXT folder?


-- 

Bastien

Cat, the other other white meat


Re: [PHP] Error printer_open()

2009-03-27 Thread Gerardo Picotti

Yes, dll file exists in this folder: C:\PHP\EXT


Bastien Koert escribió:



On Fri, Mar 27, 2009 at 8:37 AM, Gerardo Picotti gpico...@erio.com.ar 
mailto:gpico...@erio.com.ar wrote:


Hi.
I'm trying to use the printer functions in my php development.
I add the php_printer.dll in the c:/php/ext/ path.
I add the line in the php.ini file like that:
extension=php_printer.dll.
But that doesn't work and gives the next error:

Fatal error: Call to undefined function printer_open().

What can I do?
Thanks for your help!


Gerardo


-- 
PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php

Does the php_printer.dll exist in the EXT folder?


--

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 in Building an XML File

2009-03-09 Thread Virgilio Quilario
 I am using PHP to build an XML file, but I keep on getting an XML
 error when open the file in Google Chrome.
 -
 This page contains the following errors:

 error on line 30 at column 318: Entity 'iuml' not defined
 Below is a rendering of the page up to the first error.
 

 is this something to do with document encoding?

 I am using these as headers for the script

 header(content-type:text/xml;charset=utf-8);
 header(Content-Disposition:attachment;filename=google_feed.xml);



hi Joe,

the document encoding has nothing to do with the error.
maybe you have  just before the iuml.
make it amp;iuml.
or maybe copy and paste that line here because i suspect there is
something else.

Virgil
http://www.jampmark.com

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



  1   2   3   4   5   6   7   >