php-general Digest 19 Dec 2008 12:32:06 -0000 Issue 5854
php-general Digest 19 Dec 2008 12:32:06 - Issue 5854 Topics (messages 284810 through 284825): Re: utf8 php howto? 284810 by: Daniel Kolbo 284818 by: Per Jessen SimpleXML - issue with getting data out of the object returned 284811 by: Dan Joseph 284812 by: German Geek 284813 by: Dan Joseph If programming languages were religions 284814 by: Michael Kubler Re: CLI in background on windows 284815 by: Ondrej Kulaty 284816 by: Daniel Kolbo 284817 by: Jason 284819 by: Fanda imagick raises error 284820 by: vuthecuong 284821 by: Jochem Maas HTTP Error 500 - IsapiModule 284822 by: Gary Maddock-Greene 284823 by: David Robley 284824 by: Stut Re: IE8 and HTML5 284825 by: Mark Weaver Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Daniel Kolbo wrote: Hello, I have a text file encoded in utf-8. i am using fopen/fgets/echo etc.. how do i display these utf8 characters from the file on the web? I have tried different combinations of header(Content-Type: text/html; charset=iso-8859-1); header(Content-Type: text/html; charset=utf-8) and utf8_decode/utf8_encode functions I can't seem to get the characters from the file to display as non-giberish on the web. if i set the charset=utf8, and type the unique characters in directly to my document (hard coded) and save the document as utf8, then the characters display properly on the web. examples: 1) save file as utf-8, web produces correct characters ?php header(Content-Type: text/html; charset=utf-8); ? HTMLBODY [type special characters here using russian keyboard layout] /BODY/HTML 2) save file as ASCI, web produces [giberish] ?php header(Content-Type: text/html; charset=iso-8859-1); ? HTMLBODY ?php echo utf8_decode(fgets($handle)); ? /BODY/HTML 3) save file as utf-8, web produces [giberish] ?php header(Content-Type: text/html; charset=utf-8); ? HTMLBODY ?php echo fgets($handle)); ? /BODY/HTML Thanks for your help, dK found a solution: save the .php file as ASCII ?php header(Content-Type: text/html; charset=utf-8); ? HTMLBODY ?php $line_buff = fgets($handle)); echo echo mb_convert_encoding($line_buff, 'HTML-ENTITIES','UTF-8'); ? /BODY/HTML thanks, dK ---End Message--- ---BeginMessage--- Daniel Kolbo wrote: Hello, I have a text file encoded in utf-8. i am using fopen/fgets/echo etc.. how do i display these utf8 characters from the file on the web? header(Content-Type: text/html; charset=utf-8) readfile(your-utf8-file); /Per Jessen, Zürich ---End Message--- ---BeginMessage--- Hi, I have a basic XML document that I am grabbing with simplexml_load_string(), here is the print_r: SimpleXMLElement Object ( [Package] = SimpleXMLElement Object ( [PackageID] = 804 [PackageName] = Silver [BandwidthGB] = 20 [WebStorageMB] = 5120 [DBStorageMB] = 250 [POPMailBoxes] = 50 [WebStorageUnits] = 5 [BandwidthUnits] = 1 [DBStorageUnits] = 1 [POPUnits] = 5 [DomainHeaders] = 50 [DBType] = MSSQL [OSType] = Windows [Enabled] = True ) [Count] = 1 ) When I try and access $x-Package-PackageID I don't get 804, I get: SimpleXMLElement Object ( [0] = 804 ) Could someone tell me how I just get the value 804 out of there? -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life. ---End Message--- ---BeginMessage--- Tim-Hinnerk Heuer http://www.ihostnz.com On Fri, Dec 19, 2008 at 3:50 PM, Dan Joseph dmjos...@gmail.com wrote: Hi, I have a basic XML document that I am grabbing with simplexml_load_string(), here is the print_r: SimpleXMLElement Object ( [Package] = SimpleXMLElement Object ( [PackageID] = 804 [PackageName] = Silver [BandwidthGB] = 20 [WebStorageMB] = 5120 [DBStorageMB] = 250 [POPMailBoxes] = 50 [WebStorageUnits] = 5 [BandwidthUnits] = 1 [DBStorageUnits] = 1 [POPUnits] = 5 [DomainHeaders] = 50 [DBType] = MSSQL [OSType] = Windows [Enabled] = True ) [Count] = 1 ) When I try and access $x-Package-PackageID I don't get 804, I get: SimpleXMLElement Object ( [0] = 804 ) Had that problem before: $val = (string) $x-Package-PackageID; or $val
Re: [PHP] CLI in background on windows
At 16:49 18/12/2008, you wrote: Hi, I am looking for some method, how to run php cli script on background in windows. It should be started by windows task manager. Run php-win.exe rather than php.exe, this will prevent the console window from opening whilst the task is running. Schedule as normal using the Task Scheduler. We have several such tasks on our 2K3 SP2 server running this way. Should you need to debug, change the php-win.exe back to php.exe to see the console output. Example commandlines: d:\php\php-win.exe d:\phpcli\phpinfo.php This will result in no output. d:\php\php.exe d:\phpcli\phpinfo.php Will result in a console window appearing and the phpinfo(); output printed, then the window will close. HTH J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] utf8 php howto?
Daniel Kolbo wrote: Hello, I have a text file encoded in utf-8. i am using fopen/fgets/echo etc.. how do i display these utf8 characters from the file on the web? header(Content-Type: text/html; charset=utf-8) readfile(your-utf8-file); /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CLI in background on windows
Jason networkad...@emarket2.com píse v diskusním príspevku news:70.f5.09584.8465b...@pb1.pair.com... At 16:49 18/12/2008, you wrote: Hi, I am looking for some method, how to run php cli script on background in windows. It should be started by windows task manager. Run php-win.exe rather than php.exe, this will prevent the console window from opening whilst the task is running. Schedule as normal using the Task Scheduler. We have several such tasks on our 2K3 SP2 server running this way. Should you need to debug, change the php-win.exe back to php.exe to see the console output. Example commandlines: d:\php\php-win.exe d:\phpcli\phpinfo.php This will result in no output. d:\php\php.exe d:\phpcli\phpinfo.php Will result in a console window appearing and the phpinfo(); output printed, then the window will close. HTH J This looks it works. Great! That is what I was looking for. Thank you very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagick raises error
Hi, Currently I'm reading below page: http://www.imagemagick.org/Usage/api/#php When I tried imagick example of it, php raised error about function : Imagick::readimage() . Fatal error: Non-static method Imagick::readimage() cannot be called statically in /usr/local/www/apache22/data/php/im/imagick_hello.php on line 2 I don't know what is the cause. How can I solve this? I'm running latest IM 6.4.7 with imagick 2.2.1, php 5.2.8 in Freebsd 7.0, all built from ports. Thanks and regards, below is whole example of above site: ?php $handle = imagick_readimage( getcwd() . image.jpg ); if ( imagick_iserror( $handle ) ) { $reason = imagick_failedreason( $handle ) ; $description = imagick_faileddescription( $handle ) ; print Handle Read failed!BR\n; print Reason: $reasonBR\n; print Description: $descriptionBR\n; exit ; } header( Content-type: . imagick_getmimetype( $handle ) ); print imagick_image2blob( $handle ); ? -- View this message in context: http://www.nabble.com/imagick-raises-error-tp21088873p21088873.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagick raises error
vuthecuong schreef: Hi, Currently I'm reading below page: http://www.imagemagick.org/Usage/api/#php When I tried imagick example of it, php raised error about function : Imagick::readimage() . Fatal error: Non-static method Imagick::readimage() cannot be called statically in /usr/local/www/apache22/data/php/im/imagick_hello.php on line 2 it looks like there was a functional interface as well as an OO interface for imagick ... the functions themselves seem to live on but the underlying extension only seems to work via OO interface. the docs only describe an OO interface for imagick extension: http://php.net/manual/en/book.imagick.php see the user notes on this page for an example on how to use the OO interface: http://php.net/manual/en/function.imagick-readimage.php I don't know what is the cause. How can I solve this? I'm running latest IM 6.4.7 with imagick 2.2.1, php 5.2.8 in Freebsd 7.0, all built from ports. Thanks and regards, below is whole example of above site: ?php $handle = imagick_readimage( getcwd() . image.jpg ); if ( imagick_iserror( $handle ) ) { $reason = imagick_failedreason( $handle ) ; $description = imagick_faileddescription( $handle ) ; print Handle Read failed!BR\n; print Reason: $reasonBR\n; print Description: $descriptionBR\n; exit ; } header( Content-type: . imagick_getmimetype( $handle ) ); print imagick_image2blob( $handle ); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTTP Error 500 - IsapiModule
Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTTP Error 500 - IsapiModule
Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. Cheers -- David Robley The best defense against logic is stupidity. Today is Pungenday, the 61st day of The Aftermath in the YOLD 3174. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: HTTP Error 500 - IsapiModule
2008/12/19 David Robley robl...@aapt.net.au: Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. I might be wrong but I think syntax errors can cause a 500 status when using ISAPI. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
Richard Heyes wrote: I have less issues with Chrome and its beta Not thrashing my HDD is also kinda basic, but Chrome 0.2 was more than happy to do that. Thrashing? That's not a bug... it's a feature and that thrashing was chrome indexing (read harvesting information) your hard drive. Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTTP Error 500 - IsapiModule
Thanks David, but my log doesn't tell me anything (I don't think) !! I am assuming we are referring to the inetpub logs? -Gary David Robley robl...@aapt.net.au wrote in message news:71.4b.09584.6698b...@pb1.pair.com... Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. Cheers -- David Robley The best defense against logic is stupidity. Today is Pungenday, the 61st day of The Aftermath in the YOLD 3174. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: HTTP Error 500 - IsapiModule
Please include the list when replying. 2008/12/19 G. Maddock-Greene g...@maddock-greene.co.uk: You may be right Stuart ... I am thinking this too. I can access my database with an auto generated call using say Dreamweaver, but my hand code is throwing the error ... though I cannot see why!! It's really frustrating Look in your php.ini and make sure log_errors is on and the filename it's directed at is writable by IIS. Restart IIS and PHP errors should then appear in that file. Alternatively use the PHP command line executable with the -l (lint) argument to check the syntax of a file. -Stuart -- http://stut.net/ - Original Message - From: Stut stut...@gmail.com Newsgroups: php.general To: robl...@aapt.net.au Cc: php-general@lists.php.net Sent: Friday, December 19, 2008 11:58 AM Subject: Re: [PHP] Re: HTTP Error 500 - IsapiModule 2008/12/19 David Robley robl...@aapt.net.au: Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. I might be wrong but I think syntax errors can cause a 500 status when using ISAPI. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: HTTP Error 500 - IsapiModule
Thanks Stuart, Logs are no enabled and I generate this line: #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken Sorry this is only my 2nd day with php/MySQL and I really need to get this working so I appreciate the help. -Gary Stut stut...@gmail.com wrote in message news:a5f019de0812190459w486205a4n5fe8fea317890...@mail.gmail.com... Please include the list when replying. 2008/12/19 G. Maddock-Greene g...@maddock-greene.co.uk: You may be right Stuart ... I am thinking this too. I can access my database with an auto generated call using say Dreamweaver, but my hand code is throwing the error ... though I cannot see why!! It's really frustrating Look in your php.ini and make sure log_errors is on and the filename it's directed at is writable by IIS. Restart IIS and PHP errors should then appear in that file. Alternatively use the PHP command line executable with the -l (lint) argument to check the syntax of a file. -Stuart -- http://stut.net/ - Original Message - From: Stut stut...@gmail.com Newsgroups: php.general To: robl...@aapt.net.au Cc: php-general@lists.php.net Sent: Friday, December 19, 2008 11:58 AM Subject: Re: [PHP] Re: HTTP Error 500 - IsapiModule 2008/12/19 David Robley robl...@aapt.net.au: Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. I might be wrong but I think syntax errors can cause a 500 status when using ISAPI. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: HTTP Error 500 - IsapiModule
2008/12/19 Gary Maddock-Greene g...@maddock-greene.co.uk: Thanks Stuart, Logs are no enabled and I generate this line: #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken Sorry this is only my 2nd day with php/MySQL and I really need to get this working so I appreciate the help. That's the IIS log not the PHP log. See here for details: http://uk.php.net/errorfunc.configuration Look for log_errors and error_log. They work together to give you a PHP error log file. Did you try using php -l on the file? -Stuart -- http://stut.net/ Stut stut...@gmail.com wrote in message news:a5f019de0812190459w486205a4n5fe8fea317890...@mail.gmail.com... Please include the list when replying. 2008/12/19 G. Maddock-Greene g...@maddock-greene.co.uk: You may be right Stuart ... I am thinking this too. I can access my database with an auto generated call using say Dreamweaver, but my hand code is throwing the error ... though I cannot see why!! It's really frustrating Look in your php.ini and make sure log_errors is on and the filename it's directed at is writable by IIS. Restart IIS and PHP errors should then appear in that file. Alternatively use the PHP command line executable with the -l (lint) argument to check the syntax of a file. -Stuart -- http://stut.net/ - Original Message - From: Stut stut...@gmail.com Newsgroups: php.general To: robl...@aapt.net.au Cc: php-general@lists.php.net Sent: Friday, December 19, 2008 11:58 AM Subject: Re: [PHP] Re: HTTP Error 500 - IsapiModule 2008/12/19 David Robley robl...@aapt.net.au: Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. I might be wrong but I think syntax errors can cause a 500 status when using ISAPI. -Stuart -- http://stut.net/ -- 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] Re: HTTP Error 500 - IsapiModule
Ok error log reads: [19-Dec-2008 13:31:08] PHP Parse error: parse error in C:\inetpub\wwwroot\search\search.php on line 20 Sorry didn't try your suggestion php -1 ... not sure how to!! Stuart stut...@gmail.com wrote in message news:a5f019de0812190516r3cdcdacana356320f39a8d...@mail.gmail.com... 2008/12/19 Gary Maddock-Greene g...@maddock-greene.co.uk: Thanks Stuart, Logs are no enabled and I generate this line: #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken Sorry this is only my 2nd day with php/MySQL and I really need to get this working so I appreciate the help. That's the IIS log not the PHP log. See here for details: http://uk.php.net/errorfunc.configuration Look for log_errors and error_log. They work together to give you a PHP error log file. Did you try using php -l on the file? -Stuart -- http://stut.net/ Stut stut...@gmail.com wrote in message news:a5f019de0812190459w486205a4n5fe8fea317890...@mail.gmail.com... Please include the list when replying. 2008/12/19 G. Maddock-Greene g...@maddock-greene.co.uk: You may be right Stuart ... I am thinking this too. I can access my database with an auto generated call using say Dreamweaver, but my hand code is throwing the error ... though I cannot see why!! It's really frustrating Look in your php.ini and make sure log_errors is on and the filename it's directed at is writable by IIS. Restart IIS and PHP errors should then appear in that file. Alternatively use the PHP command line executable with the -l (lint) argument to check the syntax of a file. -Stuart -- http://stut.net/ - Original Message - From: Stut stut...@gmail.com Newsgroups: php.general To: robl...@aapt.net.au Cc: php-general@lists.php.net Sent: Friday, December 19, 2008 11:58 AM Subject: Re: [PHP] Re: HTTP Error 500 - IsapiModule 2008/12/19 David Robley robl...@aapt.net.au: Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. I might be wrong but I think syntax errors can cause a 500 status when using ISAPI. -Stuart -- http://stut.net/ -- 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] Re: HTTP Error 500 - IsapiModule
$sql_query = mysql_query(SELECT * FROM products WHERE MATCH(product_name,product_image) AGAINST('$search_term')); // This is line 20 where I am getting the parse error many mathces (too many matches cause returning of 0 results) if($results = mysql_num_rows($sql_query) != 0) Stuart stut...@gmail.com wrote in message news:a5f019de0812190516r3cdcdacana356320f39a8d...@mail.gmail.com... 2008/12/19 Gary Maddock-Greene g...@maddock-greene.co.uk: Thanks Stuart, Logs are no enabled and I generate this line: #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken Sorry this is only my 2nd day with php/MySQL and I really need to get this working so I appreciate the help. That's the IIS log not the PHP log. See here for details: http://uk.php.net/errorfunc.configuration Look for log_errors and error_log. They work together to give you a PHP error log file. Did you try using php -l on the file? -Stuart -- http://stut.net/ Stut stut...@gmail.com wrote in message news:a5f019de0812190459w486205a4n5fe8fea317890...@mail.gmail.com... Please include the list when replying. 2008/12/19 G. Maddock-Greene g...@maddock-greene.co.uk: You may be right Stuart ... I am thinking this too. I can access my database with an auto generated call using say Dreamweaver, but my hand code is throwing the error ... though I cannot see why!! It's really frustrating Look in your php.ini and make sure log_errors is on and the filename it's directed at is writable by IIS. Restart IIS and PHP errors should then appear in that file. Alternatively use the PHP command line executable with the -l (lint) argument to check the syntax of a file. -Stuart -- http://stut.net/ - Original Message - From: Stut stut...@gmail.com Newsgroups: php.general To: robl...@aapt.net.au Cc: php-general@lists.php.net Sent: Friday, December 19, 2008 11:58 AM Subject: Re: [PHP] Re: HTTP Error 500 - IsapiModule 2008/12/19 David Robley robl...@aapt.net.au: Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. I might be wrong but I think syntax errors can cause a 500 status when using ISAPI. -Stuart -- http://stut.net/ -- 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] Re: HTTP Error 500 - IsapiModule
2008/12/19 Gary Maddock-Greene g...@maddock-greene.co.uk: Ok error log reads: [19-Dec-2008 13:31:08] PHP Parse error: parse error in C:\inetpub\wwwroot\search\search.php on line 20 So that's what your problem is. Go look at line 20 - there's a syntax error on it. Sorry didn't try your suggestion php -1 ... not sure how to!! Fair enough, just use the error log. -Stuart -- http://stut.net/ Stuart stut...@gmail.com wrote in message news:a5f019de0812190516r3cdcdacana356320f39a8d...@mail.gmail.com... 2008/12/19 Gary Maddock-Greene g...@maddock-greene.co.uk: Thanks Stuart, Logs are no enabled and I generate this line: #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken Sorry this is only my 2nd day with php/MySQL and I really need to get this working so I appreciate the help. That's the IIS log not the PHP log. See here for details: http://uk.php.net/errorfunc.configuration Look for log_errors and error_log. They work together to give you a PHP error log file. Did you try using php -l on the file? -Stuart -- http://stut.net/ Stut stut...@gmail.com wrote in message news:a5f019de0812190459w486205a4n5fe8fea317890...@mail.gmail.com... Please include the list when replying. 2008/12/19 G. Maddock-Greene g...@maddock-greene.co.uk: You may be right Stuart ... I am thinking this too. I can access my database with an auto generated call using say Dreamweaver, but my hand code is throwing the error ... though I cannot see why!! It's really frustrating Look in your php.ini and make sure log_errors is on and the filename it's directed at is writable by IIS. Restart IIS and PHP errors should then appear in that file. Alternatively use the PHP command line executable with the -l (lint) argument to check the syntax of a file. -Stuart -- http://stut.net/ - Original Message - From: Stut stut...@gmail.com Newsgroups: php.general To: robl...@aapt.net.au Cc: php-general@lists.php.net Sent: Friday, December 19, 2008 11:58 AM Subject: Re: [PHP] Re: HTTP Error 500 - IsapiModule 2008/12/19 David Robley robl...@aapt.net.au: Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. I might be wrong but I think syntax errors can cause a 500 status when using ISAPI. -Stuart -- http://stut.net/ -- 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] Re: HTTP Error 500 - IsapiModule
2008/12/19 Gary Maddock-Greene g...@maddock-greene.co.uk: $sql_query = mysql_query(SELECT * FROM products WHERE MATCH(product_name,product_image) AGAINST('$search_term')); // This is line 20 where I am getting the parse error many mathces (too many matches cause returning of 0 results) That line is not valid code. I'm guessing it's part of a comment that has mistakenly been broken across 2 lines. -Stuart -- http://stut.net/ Stuart stut...@gmail.com wrote in message news:a5f019de0812190516r3cdcdacana356320f39a8d...@mail.gmail.com... 2008/12/19 Gary Maddock-Greene g...@maddock-greene.co.uk: Thanks Stuart, Logs are no enabled and I generate this line: #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken Sorry this is only my 2nd day with php/MySQL and I really need to get this working so I appreciate the help. That's the IIS log not the PHP log. See here for details: http://uk.php.net/errorfunc.configuration Look for log_errors and error_log. They work together to give you a PHP error log file. Did you try using php -l on the file? -Stuart -- http://stut.net/ Stut stut...@gmail.com wrote in message news:a5f019de0812190459w486205a4n5fe8fea317890...@mail.gmail.com... Please include the list when replying. 2008/12/19 G. Maddock-Greene g...@maddock-greene.co.uk: You may be right Stuart ... I am thinking this too. I can access my database with an auto generated call using say Dreamweaver, but my hand code is throwing the error ... though I cannot see why!! It's really frustrating Look in your php.ini and make sure log_errors is on and the filename it's directed at is writable by IIS. Restart IIS and PHP errors should then appear in that file. Alternatively use the PHP command line executable with the -l (lint) argument to check the syntax of a file. -Stuart -- http://stut.net/ - Original Message - From: Stut stut...@gmail.com Newsgroups: php.general To: robl...@aapt.net.au Cc: php-general@lists.php.net Sent: Friday, December 19, 2008 11:58 AM Subject: Re: [PHP] Re: HTTP Error 500 - IsapiModule 2008/12/19 David Robley robl...@aapt.net.au: Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. I might be wrong but I think syntax errors can cause a 500 status when using ISAPI. -Stuart -- http://stut.net/ -- 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] Re: HTTP Error 500 - IsapiModule
Yes .. thanks Stuart. If I comment out that line I now get a different problem!! Unable to connect to database. One step closer!!! Stuart stut...@gmail.com wrote in message news:a5f019de0812190556g611cd672k25a30b77d02ad...@mail.gmail.com... 2008/12/19 Gary Maddock-Greene g...@maddock-greene.co.uk: $sql_query = mysql_query(SELECT * FROM products WHERE MATCH(product_name,product_image) AGAINST('$search_term')); // This is line 20 where I am getting the parse error many mathces (too many matches cause returning of 0 results) That line is not valid code. I'm guessing it's part of a comment that has mistakenly been broken across 2 lines. -Stuart -- http://stut.net/ Stuart stut...@gmail.com wrote in message news:a5f019de0812190516r3cdcdacana356320f39a8d...@mail.gmail.com... 2008/12/19 Gary Maddock-Greene g...@maddock-greene.co.uk: Thanks Stuart, Logs are no enabled and I generate this line: #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken Sorry this is only my 2nd day with php/MySQL and I really need to get this working so I appreciate the help. That's the IIS log not the PHP log. See here for details: http://uk.php.net/errorfunc.configuration Look for log_errors and error_log. They work together to give you a PHP error log file. Did you try using php -l on the file? -Stuart -- http://stut.net/ Stut stut...@gmail.com wrote in message news:a5f019de0812190459w486205a4n5fe8fea317890...@mail.gmail.com... Please include the list when replying. 2008/12/19 G. Maddock-Greene g...@maddock-greene.co.uk: You may be right Stuart ... I am thinking this too. I can access my database with an auto generated call using say Dreamweaver, but my hand code is throwing the error ... though I cannot see why!! It's really frustrating Look in your php.ini and make sure log_errors is on and the filename it's directed at is writable by IIS. Restart IIS and PHP errors should then appear in that file. Alternatively use the PHP command line executable with the -l (lint) argument to check the syntax of a file. -Stuart -- http://stut.net/ - Original Message - From: Stut stut...@gmail.com Newsgroups: php.general To: robl...@aapt.net.au Cc: php-general@lists.php.net Sent: Friday, December 19, 2008 11:58 AM Subject: Re: [PHP] Re: HTTP Error 500 - IsapiModule 2008/12/19 David Robley robl...@aapt.net.au: Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. I might be wrong but I think syntax errors can cause a 500 status when using ISAPI. -Stuart -- http://stut.net/ -- 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] Re: HTTP Error 500 - IsapiModule
Stuart you have been very helpful thank you. I have learnt a number of valuable lessons this afternoon. - Gary Gary Maddock-Greene g...@maddock-greene.co.uk wrote in message news:a4.34.09584.e39ab...@pb1.pair.com... Yes .. thanks Stuart. If I comment out that line I now get a different problem!! Unable to connect to database. One step closer!!! Stuart stut...@gmail.com wrote in message news:a5f019de0812190556g611cd672k25a30b77d02ad...@mail.gmail.com... 2008/12/19 Gary Maddock-Greene g...@maddock-greene.co.uk: $sql_query = mysql_query(SELECT * FROM products WHERE MATCH(product_name,product_image) AGAINST('$search_term')); // This is line 20 where I am getting the parse error many mathces (too many matches cause returning of 0 results) That line is not valid code. I'm guessing it's part of a comment that has mistakenly been broken across 2 lines. -Stuart -- http://stut.net/ Stuart stut...@gmail.com wrote in message news:a5f019de0812190516r3cdcdacana356320f39a8d...@mail.gmail.com... 2008/12/19 Gary Maddock-Greene g...@maddock-greene.co.uk: Thanks Stuart, Logs are no enabled and I generate this line: #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken Sorry this is only my 2nd day with php/MySQL and I really need to get this working so I appreciate the help. That's the IIS log not the PHP log. See here for details: http://uk.php.net/errorfunc.configuration Look for log_errors and error_log. They work together to give you a PHP error log file. Did you try using php -l on the file? -Stuart -- http://stut.net/ Stut stut...@gmail.com wrote in message news:a5f019de0812190459w486205a4n5fe8fea317890...@mail.gmail.com... Please include the list when replying. 2008/12/19 G. Maddock-Greene g...@maddock-greene.co.uk: You may be right Stuart ... I am thinking this too. I can access my database with an auto generated call using say Dreamweaver, but my hand code is throwing the error ... though I cannot see why!! It's really frustrating Look in your php.ini and make sure log_errors is on and the filename it's directed at is writable by IIS. Restart IIS and PHP errors should then appear in that file. Alternatively use the PHP command line executable with the -l (lint) argument to check the syntax of a file. -Stuart -- http://stut.net/ - Original Message - From: Stut stut...@gmail.com Newsgroups: php.general To: robl...@aapt.net.au Cc: php-general@lists.php.net Sent: Friday, December 19, 2008 11:58 AM Subject: Re: [PHP] Re: HTTP Error 500 - IsapiModule 2008/12/19 David Robley robl...@aapt.net.au: Gary Maddock-Greene wrote: Hi, Don't know if this is the right group but I am having real problems trying to connect to my MySQL db with php. I am trying to create a search form. I can connect and display in my browser a simple call to a db record but when I try to execute my search script I get a 500 Internal Server error: IsapiModule / ExecuterequestHandler. I'm stumped! Any help please or pointers. Thanks Gary The first thing when you get a 500 error, which is a server error not php, is to check the server error log. I might be wrong but I think syntax errors can cause a 500 status when using ISAPI. -Stuart -- http://stut.net/ -- 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] utf8 php howto?
For IE, you also want to add the META tags for HTTP-EQUIV for you charset. In some circumstances, with mixed charsets on a page, and with IE in quirks mode, IE will try to guess the charset and get it (very) wrong. You really do want a DOCTYPE and a document that validates if at all possible. It makes all the difference in the world to the browser treating your lovely UTF-8 document as UTF-8 or html-soup and doing whatever it wants since you obviously don't know what you are doing. :-) Certainly if you save it as ASCII and convert the UTF-8 into ASCII not-really-equivalent, and then try to display it, you'll get sub-optimal results. Only way to use UTF-8 is to have UTF-8 used consistently through the whole chain. HTTP form requests. MySQL client MySQL server HTTP output. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] utf8 php howto?
c...@l-i-e.com wrote: In some circumstances, with mixed charsets on a page, and with IE in quirks mode, IE will try to guess the charset and get it (very) wrong. A single page or response can only have one characterset, there is no mixing possible. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] utf8 php howto?
In some circumstances, with mixed charsets on a page, and with IE in quirks mode, IE will try to guess the charset and get it (very) wrong. A single page or response can only have one characterset, there is no mixing possible. Allow me to re-explain. Step 1. Generate HTTP headers that claim your document is UTF-8. Step 2. Generate some really bad HTML Step 3. Don't include a DOCTYPE [At this point, IE is in quirks mode, and assumes your charset in the HTTP headers is meaningless, because you clearly don't know what you are doing.] Step 4. Make the first N-bytes of innerHTML English ASCII, then quote something in non-ASCII in one language, then something else in another. IE will attempt to GUESS what charset to use, based on a heuristic evaluation of the bytes of innerHTML content. IE being IE, it will guess WRONG, sometimes. I spent the better part of a week working through this one time. I had zero control over fixing the Content or validating the HTML or getting a DOCTYPE on it, for corporate reasons far too complex to go into here. I did have a way to cram in the META HTTP-EQUIV tag, which finally convinced IE that it really really was UTF-8, despite it being in quirks mode. I cannot now produce the HTML/URL in question, at least not readily, nor am I sure any more what version of IE it was, since it was at a job in a bug reporting system I no longer have access to. You're just going to have to trust me that after I set up the same HTML on my OWN server just so I could tweak it by hand to go through all the permutations, I am quite convinced that this was a reproducible and consistent, if wacky, behaviour. I probably still have that copy of the document around on my own server, somewhere, though where I have it is a bit of a poser, and I can't access my own server from my current day job, so there it is. Dunno why MSIE trusts a META tag more than an HTTP header, but it fits the MS mind-set if you Zen on that enough. [Be careful not to think on it too much and get sucked in...] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: HTTP Error 500 - IsapiModule
Sorry didn't try your suggestion php -1 ... not sure how to!! Open up MS-DOS prompt. Figure out where your php.exe lives. Let's pretend it's in C:\\php5\php.exe cd to the directory where your script lives. cd C:\\inetpub\wwwroot\search C:\\php5\php.exe -l search.php After you get it to work just once this way... Next Task: You can also edit your path by right-clicking on My Computer and finding Environment Variables or somesuch in the endless MS dialogs. Tack on YOUR path to php.exe with a ; in front, not including the php.exe, and then you can just type: php.exe -l search.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: HTTP Error 500 - IsapiModule
Gary Maddock-Greene wrote: Yes .. thanks Stuart. If I comment out that line I now get a different problem!! Unable to connect to database. One step closer!!! Well, now take and place a simple or die(mysql_error()); after your mysql_connect() call $rh = mysql_connect() or die(mysql_error()); Mind you that the above is not recommended in production code. But, it works for trying to figure out this type of problem. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
Mark Weaver wrote: Richard Heyes wrote: I have less issues with Chrome and its beta Not thrashing my HDD is also kinda basic, but Chrome 0.2 was more than happy to do that. Thrashing? That's not a bug... it's a feature and that thrashing was chrome indexing (read harvesting information) your hard drive. Mark This is why I removed it from my system. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Require error
So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/www.zootboy.com/sl/testing.php on line 13 I have no idea what's going on. All the files have 777 perms. -- --Zootboy
Re: [PHP] Require error
No. The file is called testing.php and it is trying to include sql.inc On Fri, Dec 19, 2008 at 12:36 PM, Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:28 AM, sean greenslade zootboys...@gmail.comwrote: So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/www.zootboy.com/sl/testing.php on line 13 I have no idea what's going on. All the files have 777 perms. -- --Zootboy Are you trying to require itself? -- Kyle Terry | www.kyleterry.com -- --Zootboy
Re: [PHP] Require error
Bottom Post sean greenslade zootboys...@gmail.com wrote: No. The file is called testing.php and it is trying to include sql.inc On Fri, Dec 19, 2008 at 12:36 PM, Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:28 AM, sean greenslade zootboys...@gmail.comwrote: So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/www.zootboy.com/sl/testing.php on line 13 I have no idea what's going on. All the files have 777 perms. -- --Zootboy Are you trying to require itself? Change your line to: require('$incl') or die('File not found'); Require can be dork about things like this, I normally wind up handling to fiddle with the coding for them. Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Require error
On Fri, Dec 19, 2008 at 9:43 AM, Wolf lonew...@nc.rr.com wrote: Bottom Post sean greenslade zootboys...@gmail.com wrote: No. The file is called testing.php and it is trying to include sql.inc On Fri, Dec 19, 2008 at 12:36 PM, Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:28 AM, sean greenslade zootboys...@gmail.comwrote: So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/ www.zootboy.com/sl/testing.php on line 13 I have no idea what's going on. All the files have 777 perms. -- --Zootboy Are you trying to require itself? Change your line to: require('$incl') or die('File not found'); Require can be dork about things like this, I normally wind up handling to fiddle with the coding for them. Wolf Actually, single quoted will be string literal. He would need to encase them in double quotes so the parser knows it might be looking for a variable. require($incl) is what he wants. -- Kyle Terry | www.kyleterry.com
Re: [PHP] Require error
sean greenslade zootboys...@gmail.com wrote: On Fri, Dec 19, 2008 at 12:43 PM, Wolf lonew...@nc.rr.com wrote: Bottom Post sean greenslade zootboys...@gmail.com wrote: No. The file is called testing.php and it is trying to include sql.inc On Fri, Dec 19, 2008 at 12:36 PM, Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:28 AM, sean greenslade zootboys...@gmail.comwrote: So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/ www.zootboy.com/sl/testing.php on line 13 I have no idea what's going on. All the files have 777 perms. -- --Zootboy Are you trying to require itself? Change your line to: require('$incl') or die('File not found'); Require can be dork about things like this, I normally wind up handling to fiddle with the coding for them. Wolf Sorry, GMail defaults to top post. Also, I had tried that before. Same errors. Keep replies on the list too, in case someone else stumbles in... :) Did you try switching it from require to include? Did you try just using the full path to the file? Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Require error
Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:43 AM, Wolf lonew...@nc.rr.com wrote: Bottom Post sean greenslade zootboys...@gmail.com wrote: No. The file is called testing.php and it is trying to include sql.inc On Fri, Dec 19, 2008 at 12:36 PM, Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:28 AM, sean greenslade zootboys...@gmail.comwrote: So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/ www.zootboy.com/sl/testing.php on line 13 I have no idea what's going on. All the files have 777 perms. -- --Zootboy Are you trying to require itself? Change your line to: require('$incl') or die('File not found'); Require can be dork about things like this, I normally wind up handling to fiddle with the coding for them. Wolf Actually, single quoted will be string literal. He would need to encase them in double quotes so the parser knows it might be looking for a variable. require($incl) is what he wants. See! I told you I always have problems with those! :) Normally I'm not so literal though. so yeah: require($incl); include($incl); I prefer the includes over the requires, but that is personal preference. Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Require error
On Fri, Dec 19, 2008 at 12:50 PM, Wolf lonew...@nc.rr.com wrote: Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:43 AM, Wolf lonew...@nc.rr.com wrote: Bottom Post sean greenslade zootboys...@gmail.com wrote: No. The file is called testing.php and it is trying to include sql.inc On Fri, Dec 19, 2008 at 12:36 PM, Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:28 AM, sean greenslade zootboys...@gmail.comwrote: So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/ www.zootboy.com/sl/testing.php on line 13 I have no idea what's going on. All the files have 777 perms. -- --Zootboy Are you trying to require itself? Change your line to: require('$incl') or die('File not found'); Require can be dork about things like this, I normally wind up handling to fiddle with the coding for them. Wolf Actually, single quoted will be string literal. He would need to encase them in double quotes so the parser knows it might be looking for a variable. require($incl) is what he wants. See! I told you I always have problems with those! :) Normally I'm not so literal though. so yeah: require($incl); include($incl); I prefer the includes over the requires, but that is personal preference. Wolf I tried includes, and they fail as well. I tried putting the var in double-quotes, and it did nothing. -- --Zootboy
Re: [PHP] Require error
On Fri, Dec 19, 2008 at 9:50 AM, Wolf lonew...@nc.rr.com wrote: Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:43 AM, Wolf lonew...@nc.rr.com wrote: Bottom Post sean greenslade zootboys...@gmail.com wrote: No. The file is called testing.php and it is trying to include sql.inc On Fri, Dec 19, 2008 at 12:36 PM, Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:28 AM, sean greenslade zootboys...@gmail.comwrote: So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/ www.zootboy.com/sl/testing.php on line 13 I have no idea what's going on. All the files have 777 perms. -- --Zootboy Are you trying to require itself? Change your line to: require('$incl') or die('File not found'); Require can be dork about things like this, I normally wind up handling to fiddle with the coding for them. Wolf Actually, single quoted will be string literal. He would need to encase them in double quotes so the parser knows it might be looking for a variable. require($incl) is what he wants. See! I told you I always have problems with those! :) Normally I'm not so literal though. so yeah: require($incl); include($incl); I prefer the includes over the requires, but that is personal preference. Wolf It really all depends on how you want to handle errors. If you want to kill the script because the database can't be reached, use require or require_once, if you want the script to continue and handle everything differently in the event that a file isn't loaded, use include or include_once. -- Kyle Terry | www.kyleterry.com
Re: [PHP] Require error
On Fri, Dec 19, 2008 at 12:55 PM, Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:50 AM, Wolf lonew...@nc.rr.com wrote: Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:43 AM, Wolf lonew...@nc.rr.com wrote: Bottom Post sean greenslade zootboys...@gmail.com wrote: No. The file is called testing.php and it is trying to include sql.inc On Fri, Dec 19, 2008 at 12:36 PM, Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 9:28 AM, sean greenslade zootboys...@gmail.comwrote: So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/ www.zootboy.com/sl/testing.php on line 13 I have no idea what's going on. All the files have 777 perms. -- --Zootboy Are you trying to require itself? Change your line to: require('$incl') or die('File not found'); Require can be dork about things like this, I normally wind up handling to fiddle with the coding for them. Wolf Actually, single quoted will be string literal. He would need to encase them in double quotes so the parser knows it might be looking for a variable. require($incl) is what he wants. See! I told you I always have problems with those! :) Normally I'm not so literal though. so yeah: require($incl); include($incl); I prefer the includes over the requires, but that is personal preference. Wolf It really all depends on how you want to handle errors. If you want to kill the script because the database can't be reached, use require or require_once, if you want the script to continue and handle everything differently in the event that a file isn't loaded, use include or include_once. -- Kyle Terry | www.kyleterry.com I want the page to stop if it can't access the DB. It is required for the function of the page. -- --Zootboy
Re: [PHP] Require error
So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 Line 13? PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/www.zootboy.com/sl/testing.php on line 13 I have no idea what's going on. All the files have 777 perms. What happens if you remove the die() statement? require $incl; -- Philip Graham -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Require error
On Fri, Dec 19, 2008 at 1:04 PM, Philip Graham phi...@lightbox.org wrote: So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 Line 13? PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/www.zootboy.com/sl/testing.phpon line 13 I have no idea what's going on. All the files have 777 perms. What happens if you remove the die() statement? require $incl; -- Philip Graham Hey! That fixed it. That's strange. -- --Zootboy
Re: [PHP] Require error
On Fri, Dec 19, 2008 at 10:07 AM, sean greenslade zootboys...@gmail.comwrote: On Fri, Dec 19, 2008 at 1:04 PM, Philip Graham phi...@lightbox.org wrote: So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 Line 13? PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/ www.zootboy.com/sl/testing.phpon line 13 I have no idea what's going on. All the files have 777 perms. What happens if you remove the die() statement? require $incl; -- Philip Graham Hey! That fixed it. That's strange. -- --Zootboy I totally forgot you have to wrap requires and includes in () if you are putting the die statement after it. (require $incl) or die('message'); //should work just fine for you. -- Kyle Terry | www.kyleterry.com
FWD: [PHP] Require error
On Fri, Dec 19, 2008 at 1:11 PM, Kyle Terry k...@kyleterry.com wrote: On Fri, Dec 19, 2008 at 10:07 AM, sean greenslade zootboys...@gmail.comwrote: On Fri, Dec 19, 2008 at 1:04 PM, Philip Graham phi...@lightbox.org wrote: So, I have this code in a php file called testing.php: $incl = '/webs/www.zootboy.com/sl/sql.inc'; if(!is_readable($incl)) die('ERROR: MySQL Include file does not exist??!?'); require $incl or die('MySQL page not found. Unable to continue.'); When I run the code in command line, it outputs this: [r...@localhost ~]# php -f /webs/www.zootboy.com/sl/testing.php PHP Warning: require(1): failed to open stream: No such file or directory in /webs/www.zootboy.com/sl/testing.php on line 13 Line 13? PHP Fatal error: require(): Failed opening required '1' (include_path='/var/php/inc/') in /webs/ www.zootboy.com/sl/testing.phpon line 13 I have no idea what's going on. All the files have 777 perms. What happens if you remove the die() statement? require $incl; -- Philip Graham Hey! That fixed it. That's strange. -- --Zootboy I totally forgot you have to wrap requires and includes in () if you are putting the die statement after it. (require $incl) or die('message'); //should work just fine for you. -- Kyle Terry | www.kyleterry.com That worked. Thanks! Forwarded to php list. Sorry, I forgot to cc it. -- --Zootboy
Re: [PHP] IE8 and HTML5
This is why I removed it from my system. FWIW, it doesn't do it now. I still by far prefer Firefox. If anything, it's because of Firebug. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated December 5th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] search for person by comparing his data with data in mysql
hi, I have to build a little search form. a visitor enters his/her personal and work data (first name, last name, email, org. name, phones (home phone, work phone, cell) home address, work address) using a form, and then administrator has to compare these data with existing data in database (mysql). if record in database has the same first name as the visitor, the record will get 1 point. if the last name is the same - 3 points. if both names are the same - clearly 4 points. if email matches 7 points, phone number 4 points, etc. the list to be shown on the screen is list of all records they have at least 1 point. and the list has to be sorted by number of points. also, matching parts on the list have to be highlighted (with different background color, of the font different color). I did some testing and the code is really basic, using LIKE, and I'm assuming not so good way. first, I'll get all records from database. while reading I compare data from DB with visitor's data. my query (simplified) looks something like this $query = SELECT p.person_id, p.first_name, p.last_name, p.phone as phone_home, p.primary_org, p.address_id, p.email as personal_email, o.full_name, o.organization_id, o.phone as phone_work, o.address_id as org_address, a.address1, a.city, a.state, a.zip, a.county FROM people p LEFT JOIN organization o ON (o.instance=.$_SESSION['instance']. AND o.organization_id=p.organization_id) LEFT JOIN addresses a ON (a.entity_id=o.organization_id AND a.instance=.$_SESSION['instance'].) WHERE p.instance_id=.$_SESSION['instance']. AND m.instance_id=.$_SESSION['instance']. AND p.person_id = .$_SESSION['person_id']. AND o.active='Y' AND ( p.last_name LIKE '%.mysql_real_escape_string($person['last_name']).%' OR o.email_address = '.mysql_real_escape_string($person['email_address']).' OR p.email = '.mysql_real_escape_string($person['email']).' ; if (!empty($phone_home)) { $query .= OR p.phone = '.$person['phone'].'; } if (!empty($person['phone'])) { $query .= OR o.phone = '.$person['phone'].'; } if (!empty($person['org_name'])) { $query .= OR o.full_name LIKE '%.mysql_real_escape_string($person['org_name']).%'; } $query .= ) ORDER BY p.last_name ASC, p.first_name ASC ; $myquery = mysql_query($query); while($result = mysql_fetch_array($myquery)) { # I compare record with visitor's data and assign points to $RANK[$result['person_id']] # if there is at least one match assign the record to an array $RECORDS['person_id'] } then sort $RANK desc and then list sorted array $RANK on screen with matching $RECORDS elements. It works but it could take 10-15 seconds to create the list if database has e.g. 10,000 records anybody had the same or similar project? I'll appreciate any suggestion. how to setup database (mysql) and the best way to do the search code (php). thanks for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] utf8 php howto?
On Fri, Dec 19, 2008 at 7:01 AM, c...@l-i-e.com wrote: For IE, you also want to add the META tags for HTTP-EQUIV for you charset. This has been the most reliable, as long as you're presenting HTML, this is all I ever put in a page. No header() or anything. Only way to use UTF-8 is to have UTF-8 used consistently through the whole chain. HTTP form requests. MySQL client MySQL server HTTP output. If you're not using MySQL string functions you can put UTF-8 encoded content into normal latin-based columns. It just treats it as binary data. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: HTTP Error 500 - IsapiModule
On Fri, Dec 19, 2008 at 11:48 AM, Jim Lucas li...@cmsws.com wrote: Gary Maddock-Greene wrote: Yes .. thanks Stuart. If I comment out that line I now get a different problem!! Unable to connect to database. One step closer!!! Well, now take and place a simple or die(mysql_error()); after your mysql_connect() call $rh = mysql_connect() or die(mysql_error()); Mind you that the above is not recommended in production code. But, it works for trying to figure out this type of problem. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Assuming you are using some flavor of IE, ensure the Always Show Friendly Errors Messages is unchecked the browser's Tools internet options advanced tab -- Bastien Cat, the other other white meat
Re: [PHP] search for person by comparing his data with data in mysql
select first_name like '%$first_name%' + 3 * last_name like '%$last_name%' + 7 * email = '$email' as score, first_name, last_name, email, person_id from person . . . order by score desc limit 10 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] de-bug no input file specified
Hi, is it possible to de-bug a 'no input file specified' error. I get the error when trying to run my search script but do not know whats causing it. Is it a common error? PHP5 with MySQL adn IIS7 Thanks - Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] de-bug no input file specified
On December 19, 2008 17:20:32 Gary Maddock-Greene wrote: Hi, is it possible to de-bug a 'no input file specified' error. I get the error when trying to run my search script but do not know whats causing it. Is it a common error? What code/command/request is causing the error? PHP5 with MySQL adn IIS7 Thanks - Gary -- Philip Graham Lightbox Technologies Suite 312 240 Catherine St. Ottawa, ON, K2P 2G8 613-686-1661 ext. 102 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] de-bug no input file specified
Hi Philip, Here is my code ... ?php if (!function_exists(GetSQLValueString)) { function GetSQLValueString($theValue, $theType, $theDefinedValue = , $theNotDefinedValue = ) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists(mysql_real_escape_string) ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case text: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case long: case int: $theValue = ($theValue != ) ? intval($theValue) : NULL; break; case double: $theValue = ($theValue != ) ? ' . doubleval($theValue) . ' : NULL; break; case date: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case defined: $theValue = ($theValue != ) ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_rsSearch = -1; if (isset($_GET['product_name'])) { $colname_rsSearch = $_GET['product_name']; } mysql_select_db($database_MyDatabase, $MyDatabase); $query_rsSearch = sprintf(SELECT * FROM products WHERE product_name LIKE %s, GetSQLValueString(% . $colname_rsSearch . %, text)); $rsSearch = mysql_query($query_rsSearch, $MyDatabase) or die(mysql_error()); $row_rsSearch = mysql_fetch_assoc($rsSearch); $totalRows_rsSearch = mysql_num_rows($rsSearch); ? - Gary Philip Graham phi...@lightbox.org wrote in message news:200812191734.10664.phi...@lightbox.org... On December 19, 2008 17:20:32 Gary Maddock-Greene wrote: Hi, is it possible to de-bug a 'no input file specified' error. I get the error when trying to run my search script but do not know whats causing it. Is it a common error? What code/command/request is causing the error? PHP5 with MySQL adn IIS7 Thanks - Gary -- Philip Graham Lightbox Technologies Suite 312 240 Catherine St. Ottawa, ON, K2P 2G8 613-686-1661 ext. 102 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] de-bug no input file specified
first off - you must be coming from ASP for that code :P second - that error is usually due to the SCRIPT_FILENAME being incorrect. not the code in the script. On Fri, Dec 19, 2008 at 2:54 PM, Gary Maddock-Greene g...@maddock-greene.co.uk wrote: Hi Philip, Here is my code ... ?php if (!function_exists(GetSQLValueString)) { function GetSQLValueString($theValue, $theType, $theDefinedValue = , $theNotDefinedValue = ) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists(mysql_real_escape_string) ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case text: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case long: case int: $theValue = ($theValue != ) ? intval($theValue) : NULL; break; case double: $theValue = ($theValue != ) ? ' . doubleval($theValue) . ' : NULL; break; case date: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case defined: $theValue = ($theValue != ) ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_rsSearch = -1; if (isset($_GET['product_name'])) { $colname_rsSearch = $_GET['product_name']; } mysql_select_db($database_MyDatabase, $MyDatabase); $query_rsSearch = sprintf(SELECT * FROM products WHERE product_name LIKE %s, GetSQLValueString(% . $colname_rsSearch . %, text)); $rsSearch = mysql_query($query_rsSearch, $MyDatabase) or die(mysql_error()); $row_rsSearch = mysql_fetch_assoc($rsSearch); $totalRows_rsSearch = mysql_num_rows($rsSearch); ? - Gary Philip Graham phi...@lightbox.org wrote in message news:200812191734.10664.phi...@lightbox.org... On December 19, 2008 17:20:32 Gary Maddock-Greene wrote: Hi, is it possible to de-bug a 'no input file specified' error. I get the error when trying to run my search script but do not know whats causing it. Is it a common error? What code/command/request is causing the error? PHP5 with MySQL adn IIS7 Thanks - Gary -- Philip Graham Lightbox Technologies Suite 312 240 Catherine St. Ottawa, ON, K2P 2G8 613-686-1661 ext. 102 -- 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] de-bug no input file specified
the code was generated by Dreamweaver CS3 .. its php! How do I check the SCRIPT_FILENAME please? mike mike...@gmail.com wrote in message news:bd9320b30812191502t2448ef31xa8ad8758f8638...@mail.gmail.com... first off - you must be coming from ASP for that code :P second - that error is usually due to the SCRIPT_FILENAME being incorrect. not the code in the script. On Fri, Dec 19, 2008 at 2:54 PM, Gary Maddock-Greene g...@maddock-greene.co.uk wrote: Hi Philip, Here is my code ... ?php if (!function_exists(GetSQLValueString)) { function GetSQLValueString($theValue, $theType, $theDefinedValue = , $theNotDefinedValue = ) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists(mysql_real_escape_string) ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case text: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case long: case int: $theValue = ($theValue != ) ? intval($theValue) : NULL; break; case double: $theValue = ($theValue != ) ? ' . doubleval($theValue) . ' : NULL; break; case date: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case defined: $theValue = ($theValue != ) ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_rsSearch = -1; if (isset($_GET['product_name'])) { $colname_rsSearch = $_GET['product_name']; } mysql_select_db($database_MyDatabase, $MyDatabase); $query_rsSearch = sprintf(SELECT * FROM products WHERE product_name LIKE %s, GetSQLValueString(% . $colname_rsSearch . %, text)); $rsSearch = mysql_query($query_rsSearch, $MyDatabase) or die(mysql_error()); $row_rsSearch = mysql_fetch_assoc($rsSearch); $totalRows_rsSearch = mysql_num_rows($rsSearch); ? - Gary Philip Graham phi...@lightbox.org wrote in message news:200812191734.10664.phi...@lightbox.org... On December 19, 2008 17:20:32 Gary Maddock-Greene wrote: Hi, is it possible to de-bug a 'no input file specified' error. I get the error when trying to run my search script but do not know whats causing it. Is it a common error? What code/command/request is causing the error? PHP5 with MySQL adn IIS7 Thanks - Gary -- Philip Graham Lightbox Technologies Suite 312 240 Catherine St. Ottawa, ON, K2P 2G8 613-686-1661 ext. 102 -- 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] de-bug no input file specified
Hi Philip, Here is my code ... ?php if (!function_exists(GetSQLValueString)) { function GetSQLValueString($theValue, $theType, $theDefinedValue = , $theNotDefinedValue = ) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists(mysql_real_escape_string) ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case text: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case long: case int: $theValue = ($theValue != ) ? intval($theValue) : NULL; break; case double: $theValue = ($theValue != ) ? ' . doubleval($theValue) . ' : NULL; break; case date: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case defined: $theValue = ($theValue != ) ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_rsSearch = -1; if (isset($_GET['product_name'])) { $colname_rsSearch = $_GET['product_name']; } mysql_select_db($database_MyDatabase, $MyDatabase); $query_rsSearch = sprintf(SELECT * FROM products WHERE product_name LIKE %s, GetSQLValueString(% . $colname_rsSearch . %, text)); $rsSearch = mysql_query($query_rsSearch, $MyDatabase) or die(mysql_error()); $row_rsSearch = mysql_fetch_assoc($rsSearch); $totalRows_rsSearch = mysql_num_rows($rsSearch); ? - Gary It doesn't look like your code is the problem, how is the file being executed. Through the command line or IIS? In either case it sounds like either you have don't have permissions on the file, you're pointing at the wrong file or you've got a bad config setting somewhere. You can always try searching 'php no input file specified' and see if others before you have had the same problem for a quick fix. Other than that I'm sorry I can't be of more help but unfortunately I'm not at all familiar with PHP on windows/IIS. -- Philip Graham -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] de-bug no input file specified
yeah but it stinks of microsoft/vb/asp :) i can't really tell you in IIS, but that's the common reason nginx has a no input file specified - people ask about it all the time. On Fri, Dec 19, 2008 at 3:15 PM, Gary Maddock-Greene g...@maddock-greene.co.uk wrote: the code was generated by Dreamweaver CS3 .. its php! How do I check the SCRIPT_FILENAME please? mike mike...@gmail.com wrote in message news:bd9320b30812191502t2448ef31xa8ad8758f8638...@mail.gmail.com... first off - you must be coming from ASP for that code :P second - that error is usually due to the SCRIPT_FILENAME being incorrect. not the code in the script. On Fri, Dec 19, 2008 at 2:54 PM, Gary Maddock-Greene g...@maddock-greene.co.uk wrote: Hi Philip, Here is my code ... ?php if (!function_exists(GetSQLValueString)) { function GetSQLValueString($theValue, $theType, $theDefinedValue = , $theNotDefinedValue = ) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists(mysql_real_escape_string) ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case text: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case long: case int: $theValue = ($theValue != ) ? intval($theValue) : NULL; break; case double: $theValue = ($theValue != ) ? ' . doubleval($theValue) . ' : NULL; break; case date: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case defined: $theValue = ($theValue != ) ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_rsSearch = -1; if (isset($_GET['product_name'])) { $colname_rsSearch = $_GET['product_name']; } mysql_select_db($database_MyDatabase, $MyDatabase); $query_rsSearch = sprintf(SELECT * FROM products WHERE product_name LIKE %s, GetSQLValueString(% . $colname_rsSearch . %, text)); $rsSearch = mysql_query($query_rsSearch, $MyDatabase) or die(mysql_error()); $row_rsSearch = mysql_fetch_assoc($rsSearch); $totalRows_rsSearch = mysql_num_rows($rsSearch); ? - Gary Philip Graham phi...@lightbox.org wrote in message news:200812191734.10664.phi...@lightbox.org... On December 19, 2008 17:20:32 Gary Maddock-Greene wrote: Hi, is it possible to de-bug a 'no input file specified' error. I get the error when trying to run my search script but do not know whats causing it. Is it a common error? What code/command/request is causing the error? PHP5 with MySQL adn IIS7 Thanks - Gary -- Philip Graham Lightbox Technologies Suite 312 240 Catherine St. Ottawa, ON, K2P 2G8 613-686-1661 ext. 102 -- 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] de-bug no input file specified
Thanks Philip i am running a search from a form (page 1) querying the db and returning the result on page 2 (well thats the theory) ! Philip Graham phi...@lightbox.org wrote in message news:200812191822.58155.phi...@lightbox.org... Hi Philip, Here is my code ... ?php if (!function_exists(GetSQLValueString)) { function GetSQLValueString($theValue, $theType, $theDefinedValue = , $theNotDefinedValue = ) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists(mysql_real_escape_string) ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case text: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case long: case int: $theValue = ($theValue != ) ? intval($theValue) : NULL; break; case double: $theValue = ($theValue != ) ? ' . doubleval($theValue) . ' : NULL; break; case date: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case defined: $theValue = ($theValue != ) ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_rsSearch = -1; if (isset($_GET['product_name'])) { $colname_rsSearch = $_GET['product_name']; } mysql_select_db($database_MyDatabase, $MyDatabase); $query_rsSearch = sprintf(SELECT * FROM products WHERE product_name LIKE %s, GetSQLValueString(% . $colname_rsSearch . %, text)); $rsSearch = mysql_query($query_rsSearch, $MyDatabase) or die(mysql_error()); $row_rsSearch = mysql_fetch_assoc($rsSearch); $totalRows_rsSearch = mysql_num_rows($rsSearch); ? - Gary It doesn't look like your code is the problem, how is the file being executed. Through the command line or IIS? In either case it sounds like either you have don't have permissions on the file, you're pointing at the wrong file or you've got a bad config setting somewhere. You can always try searching 'php no input file specified' and see if others before you have had the same problem for a quick fix. Other than that I'm sorry I can't be of more help but unfortunately I'm not at all familiar with PHP on windows/IIS. -- Philip Graham -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] de-bug no input file specified
Hi Mike ... I think Adobe code does look like VB script actually ... I agree :) I wish I knew php better (so I didn't have to rely on crappy Dreamweaver code), I only started using it today and just want to script a simple search form on a 5 colomn products table ... not too hard eh? I have php installed, IIS7 running beautifully .. but can't get this simple form working. mike mike...@gmail.com wrote in message news:bd9320b30812191522w365dfd7cx5ca8829ab53f2...@mail.gmail.com... yeah but it stinks of microsoft/vb/asp :) i can't really tell you in IIS, but that's the common reason nginx has a no input file specified - people ask about it all the time. On Fri, Dec 19, 2008 at 3:15 PM, Gary Maddock-Greene g...@maddock-greene.co.uk wrote: the code was generated by Dreamweaver CS3 .. its php! How do I check the SCRIPT_FILENAME please? mike mike...@gmail.com wrote in message news:bd9320b30812191502t2448ef31xa8ad8758f8638...@mail.gmail.com... first off - you must be coming from ASP for that code :P second - that error is usually due to the SCRIPT_FILENAME being incorrect. not the code in the script. On Fri, Dec 19, 2008 at 2:54 PM, Gary Maddock-Greene g...@maddock-greene.co.uk wrote: Hi Philip, Here is my code ... ?php if (!function_exists(GetSQLValueString)) { function GetSQLValueString($theValue, $theType, $theDefinedValue = , $theNotDefinedValue = ) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists(mysql_real_escape_string) ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case text: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case long: case int: $theValue = ($theValue != ) ? intval($theValue) : NULL; break; case double: $theValue = ($theValue != ) ? ' . doubleval($theValue) . ' : NULL; break; case date: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case defined: $theValue = ($theValue != ) ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_rsSearch = -1; if (isset($_GET['product_name'])) { $colname_rsSearch = $_GET['product_name']; } mysql_select_db($database_MyDatabase, $MyDatabase); $query_rsSearch = sprintf(SELECT * FROM products WHERE product_name LIKE %s, GetSQLValueString(% . $colname_rsSearch . %, text)); $rsSearch = mysql_query($query_rsSearch, $MyDatabase) or die(mysql_error()); $row_rsSearch = mysql_fetch_assoc($rsSearch); $totalRows_rsSearch = mysql_num_rows($rsSearch); ? - Gary Philip Graham phi...@lightbox.org wrote in message news:200812191734.10664.phi...@lightbox.org... On December 19, 2008 17:20:32 Gary Maddock-Greene wrote: Hi, is it possible to de-bug a 'no input file specified' error. I get the error when trying to run my search script but do not know whats causing it. Is it a common error? What code/command/request is causing the error? PHP5 with MySQL adn IIS7 Thanks - Gary -- Philip Graham Lightbox Technologies Suite 312 240 Catherine St. Ottawa, ON, K2P 2G8 613-686-1661 ext. 102 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using php in custom built http server
Hey, I built my own http server, and I'm wanting to add php to it. the server is in Objective-C. I know I can use terminal commands to do it, but if I was to do that how would I get headers and stuff php sends, and how would I send php HTTP_REMOTE_ADDRESS and stuff like that? I would prefer doing it with terminal commands, but I am willing it do it with a library or however I have to do it. Thanks, Mr. Gecko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using php in custom built http server
Hey, I built my own http server, and I'm wanting to add php to it. the server is in Objective-C. I know I can use terminal commands to do it, but if I was to do that how would I get headers and stuff php sends, and how would I send php HTTP_REMOTE_ADDRESS and stuff like that? I would prefer doing it with terminal commands, but I am willing it do it with a library or however I have to do it. Thanks, Mr. Gecko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: de-bug no input file specified
Gary Maddock-Greene wrote: Hi, is it possible to de-bug a 'no input file specified' error. I get the error when trying to run my search script but do not know whats causing it. Is it a common error? PHP5 with MySQL adn IIS7 Thanks - Gary make a small php file called info.php with the following contents: ?php phpinfo(); ? save it and run it through iis, if you get the same error then it's php not being installed correctly if it does run correctly then we'll need to let the debugging commence! regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using php in custom built http server
Mr. Gecko wrote: Hey, I built my own http server, and I'm wanting to add php to it. the server is in Objective-C. I know I can use terminal commands to do it, but if I was to do that how would I get headers and stuff php sends, and how would I send php HTTP_REMOTE_ADDRESS and stuff like that? I would prefer doing it with terminal commands, but I am willing it do it with a library or however I have to do it. Thanks, Mr. Gecko I'd get the php source if i was you and go from there.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: de-bug no input file specified
Gary Maddock-Greene wrote: Hi, is it possible to de-bug a 'no input file specified' error. I get the error when trying to run my search script but do not know whats causing it. Is it a common error? PHP5 with MySQL adn IIS7 Thanks - Gary .. just did some more reading.. are you running php as a CGI app? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using php in custom built http server
On Fri, Dec 19, 2008 at 5:58 PM, Mr. Gecko grmrge...@gmail.com wrote: Hey, I built my own http server, and I'm wanting to add php to it. the server is in Objective-C. I know I can use terminal commands to do it, but if I was to do that how would I get headers and stuff php sends, and how would I send php HTTP_REMOTE_ADDRESS and stuff like that? there is a well known book, by sara golemon, extending embedding phphttp://tinyurl.com/a75bbk. youll almost certainly want to grab that. there are also some nice pdf's and articles online, mostly for writing extensions afaict. only a small portion of the book about embedding php, but to give you a quick overview, the most simple approach to embedding essentially boils down to including libphp, and invoking it with a string of php the C level eval(). the book will get you going from there. im sure if you know what youre doing, which if you could write a webserver in objc, i suppose you would, should be able to get the eval-based approach working 'pretty quickly'TM. from there you can experiment w/ the info the book has and it would probly be good to find some smaller webserver projects that support php, like lighttpd http://www.lighttpd.net/download. lighttpd is stricly C tho, if im not mistaken, but im sure youll find some nice example segments there. I would prefer doing it with terminal commands, but I am willing it do it with a library or however I have to do it. well, im not sure what you need to do, make-file-wise, to get C to compile into an objective-C application, but i know it can be done, b/c i did it on an iphone app where we used the C interface to sqlite3. im sure if youre webserver is using objective-C classes, and some of its neat runtime features, you might wind up writing some sort of OO wrapper around phps embedding api, but thats just a guess. btw, is this a private project or is the code out there somewhere ? -nathan
Re: [PHP] Using php in custom built http server
Also could look at using fastcgi and would not have to embed libphp and such. On Dec 19, 2008, at 9:58 PM, Nathan Nobbe quickshif...@gmail.com wrote: On Fri, Dec 19, 2008 at 5:58 PM, Mr. Gecko grmrge...@gmail.com wrote: Hey, I built my own http server, and I'm wanting to add php to it. the server is in Objective-C. I know I can use terminal commands to do it, but if I was to do that how would I get headers and stuff php sends, and how would I send php HTTP_REMOTE_ADDRESS and stuff like that? there is a well known book, by sara golemon, extending embedding phphttp://tinyurl.com/a75bbk. youll almost certainly want to grab that. there are also some nice pdf's and articles online, mostly for writing extensions afaict. only a small portion of the book about embedding php, but to give you a quick overview, the most simple approach to embedding essentially boils down to including libphp, and invoking it with a string of php the C level eval(). the book will get you going from there. im sure if you know what youre doing, which if you could write a webserver in objc, i suppose you would, should be able to get the eval-based approach working 'pretty quickly'TM. from there you can experiment w/ the info the book has and it would probly be good to find some smaller webserver projects that support php, like lighttpd http://www.lighttpd.net/download. lighttpd is stricly C tho, if im not mistaken, but im sure youll find some nice example segments there. I would prefer doing it with terminal commands, but I am willing it do it with a library or however I have to do it. well, im not sure what you need to do, make-file-wise, to get C to compile into an objective-C application, but i know it can be done, b/c i did it on an iphone app where we used the C interface to sqlite3. im sure if youre webserver is using objective-C classes, and some of its neat runtime features, you might wind up writing some sort of OO wrapper around phps embedding api, but thats just a guess. btw, is this a private project or is the code out there somewhere ? -nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using php in custom built http server
On Fri, Dec 19, 2008 at 11:14 PM, mike mike...@gmail.com wrote: Also could look at using fastcgi and would not have to embed libphp and such. actually, i think thats how lighttpd does it ;) -nathan
Re: [PHP] Using php in custom built http server
Yep Nginx, lighttpd, Zeus it's the only way. Apache has the option and I think a lot of people recommend it for various reasons. I'd recommend nginx over lighttpd :) On Dec 19, 2008, at 10:15 PM, Nathan Nobbe quickshif...@gmail.com wrote: On Fri, Dec 19, 2008 at 11:14 PM, mike mike...@gmail.com wrote: Also could look at using fastcgi and would not have to embed libphp and such. actually, i think thats how lighttpd does it ;) -nathan