php-general Digest 16 Jul 2009 05:32:16 -0000 Issue 6232

2009-07-15 Thread php-general-digest-help
php-general Digest 16 Jul 2009 05:32:16 - Issue 6232 Topics (messages 295430 through 295449): Re: Pattern Matching[Resolved] 295430 by: VamVan Re: I have an idea 295431 by: Martin Scotta 295432 by: tedd 295433 by: Martin Scotta 295435 by: Govinda

Re: [PHP] Alphabetical pagination

2009-07-15 Thread Ashley Sheridan
On Wednesday 15 July 2009 06:35:04 Jim Lucas wrote: Andrew Ballard wrote: On Tue, Jul 14, 2009 at 3:38 PM, Miller, Teriontmil...@springfi.gannett.com wrote: I am trying to make a page that displays a-z like a b c d e etc as links then when you click open one it reloads itself and shows

Re: [PHP] Scrapping email content

2009-07-15 Thread Tom Chubb
2009/7/15 Areba Collins arebacoll...@gmail.com Hello guys, i have a quick one: Im working on an app that reads email and converts it into a post on a forum, everything works fine except the threaded comments at the bottom. I would like to delete everything that is from a previous email

Re: [PHP] Mac OS X Server

2009-07-15 Thread Thijs Lensselink
The Doctor wrote: ALl right, I just install MySQL 5.1.36 on a Mac OS X Server but the PHP is looking at the Mysql 5.0.67 ? How do I tell the php.ini to look at the 5.1 instead of the 5.0? You don't do that from the php.ini file. Either recompile PHP against the new MySQL source. If you

Re: [PHP] Scrapping email content

2009-07-15 Thread Ashley Sheridan
On Wednesday 15 July 2009 08:38:28 Tom Chubb wrote: 2009/7/15 Areba Collins arebacoll...@gmail.com Hello guys, i have a quick one: Im working on an app that reads email and converts it into a post on a forum, everything works fine except the threaded comments at the bottom. I would

[PHP] Re: I have an idea

2009-07-15 Thread Carlos Medina
Martin Scotta schrieb: Hi Do you noted that all the discussion here are about problems, bugs, or just urgent pleaaase help me I have an idea. It is not really THE idea... but it is. What happen if tell this idea to the community? I don't know, so, let's take a look. PHP is a great language.

Re: [PHP] Re: I have an idea

2009-07-15 Thread Michael A. Peters
Carlos Medina wrote: Martin Scotta schrieb: Hi Do you noted that all the discussion here are about problems, bugs, or just urgent pleaaase help me I have an idea. It is not really THE idea... but it is. What happen if tell this idea to the community? I don't know, so, let's take a look. PHP

Re: [PHP] [GD] Image errors

2009-07-15 Thread Peter Ford
Ash, Martin, Seems you are both wandering around the obvious problem... I suspect that $tipo (in the next line) is *supposed* to be $type - sounds like a partial Italian translation to me... So given that $type=imagecreatefrompng (for example, if the mime check returns 'png' - not very

Re: [PHP] [GD] Image errors

2009-07-15 Thread Peter Ford
Martin Scotta wrote: Why are you ussing GD? All you need is output the image to the browser? try this... I didn't test/run this code, but it may work... public function showPicture( $id ) { header('Content-type:' . mime_content_type( $this-updir . $id . '.png' ) ); readfile(

Re: [PHP] Pattern Matching

2009-07-15 Thread Lenin
On Wed, Jul 15, 2009 at 3:24 AM, VamVanvamsee...@gmail.com wrote: contact/me - Contact US perfect match would be easy because I can exactly look for what I want. It becomes tricky when I introduce wild cards like contact/* for example. It could also be contact/me/* How would I match

[PHP] error_append_string and error_log

2009-07-15 Thread Javier Ruiz
Hi! I'm trying to append some extra info to my php errors. It works well when I'm displaying errors on screen, but it doesn't work to log the extra info into an error file (log_errors and error_log). I mean, if I use this: ?php ini_set('display_errors', 1); ini_set('log_errors', 1);

Re: [PHP] Re: I have an idea

2009-07-15 Thread Carlos Medina
Michael A. Peters schrieb: Carlos Medina wrote: Martin Scotta schrieb: Hi Do you noted that all the discussion here are about problems, bugs, or just urgent pleaaase help me I have an idea. It is not really THE idea... but it is. What happen if tell this idea to the community? I don't know,

[PHP] IP to geo-location advice

2009-07-15 Thread Patrick
Hi Everyone Could anyone give me some advice on the best way to do IP to geo-location with php using open source code? Thanks in advance-Patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] error_append_string and error_log

2009-07-15 Thread Ashley Sheridan
On Wednesday 15 July 2009 12:44:21 Javier Ruiz wrote: Hi! I'm trying to append some extra info to my php errors. It works well when I'm displaying errors on screen, but it doesn't work to log the extra info into an error file (log_errors and error_log). I mean, if I use this: ?php

Re: [PHP] IP to geo-location advice

2009-07-15 Thread Daniel Brown
On Wed, Jul 15, 2009 at 08:14, Patrickoptoma...@rogers.com wrote: Could anyone give me some advice on the best way to do IP to geo-location with php using open source code? Advice: RTFM. ;-P http://php.net/geoip -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net

Re: [PHP] Alphabetical pagination

2009-07-15 Thread Andrew Ballard
On Wed, Jul 15, 2009 at 3:28 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wednesday 15 July 2009 06:35:04 Jim Lucas wrote: Andrew Ballard wrote: On Tue, Jul 14, 2009 at 3:38 PM, Miller, Teriontmil...@springfi.gannett.com wrote: I am trying to make a page that displays a-z like

[PHP] Re: IP to geo-location advice

2009-07-15 Thread pan
Patrick wrote: Hi Everyone Could anyone give me some advice on the best way to do IP to geo-location with php using open source code? Thanks in advance-Patrick That is not an easy problem. You can go to ARIN, APNIC, etc and get /8 and smaller assignments. But, if the new assignee hasn't

Re: [PHP] error_append_string and error_log

2009-07-15 Thread Javier Ruiz
Hi, thanks for your reply. The thing is, I need to set it in runtime (ini_set) since I want to append the URI that generated the error, so I'll need to use some $_SERVER variables. Regards JaviRuiz. On Wed, Jul 15, 2009 at 2:25 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On

Re: [PHP] IP to geo-location advice

2009-07-15 Thread Per Jessen
Patrick wrote: Hi Everyone Could anyone give me some advice on the best way to do IP to geo-location with php using open source code? Use DNS and http://countries.nerd.dk. /Per -- Per Jessen, Zürich (24.2°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] I have an idea

2009-07-15 Thread Govinda
PHP is a great language. You can do a lot of things with him, even have fun with it. My idea is to make a simple game where your have to write some AI to beat the other players AI The idea, as simple as it looks, is really difficult to implement specially about security so, do you like me idea?

[PHP] Error handling

2009-07-15 Thread Paul M Foster
This note shows up in the documentation for set_error_handler(): The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is

Re: [PHP] Alphabetical pagination

2009-07-15 Thread tedd
At 12:38 PM -0700 7/14/09, Miller, Terion wrote: I am trying to make a page that displays a-z like a b c d e etc as links then when you click open one it reloads itself and shows only the query results that go with that letter...i'm not getting itI get a page that says ARRAY over and over...

Re: [PHP] Alphabetical pagination

2009-07-15 Thread Ashley Sheridan
On Wednesday 15 July 2009 16:21:22 tedd wrote: At 12:38 PM -0700 7/14/09, Miller, Terion wrote: I am trying to make a page that displays a-z like a b c d e etc as links then when you click open one it reloads itself and shows only the query results that go with that letter...i'm not getting

Re: [PHP] Alphabetical pagination

2009-07-15 Thread Miller, Terion
On 7/15/09 10:30 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Wednesday 15 July 2009 16:21:22 tedd wrote: At 12:38 PM -0700 7/14/09, Miller, Terion wrote: I am trying to make a page that displays a-z like a b c d e etc as links then when you click open one it reloads itself and

Re: [PHP] I have an idea

2009-07-15 Thread tedd
At 1:21 AM -0300 7/15/09, Martin Scotta wrote: Hi Do you noted that all the discussion here are about problems, bugs, or just urgent pleaaase help me I have an idea. It is not really THE idea... but it is. What happen if tell this idea to the community? I don't know, so, let's take a look.

Re: [PHP] I have an idea

2009-07-15 Thread Ashley Sheridan
On Wednesday 15 July 2009 16:29:49 tedd wrote: At 1:21 AM -0300 7/15/09, Martin Scotta wrote: Hi Do you noted that all the discussion here are about problems, bugs, or just urgent pleaaase help me I have an idea. It is not really THE idea... but it is. What happen if tell this idea to the

Re: [PHP] Alphabetical pagination

2009-07-15 Thread tedd
At 4:30 PM +0100 7/15/09, Ashley Sheridan wrote: On Wednesday 15 July 2009 16:21:22 tedd wrote: At 12:38 PM -0700 7/14/09, Miller, Terion wrote: I am trying to make a page that displays a-z like a b c d e etc as links then when you click open one it reloads itself and shows only the query

Re: [PHP] Alphabetical pagination

2009-07-15 Thread Andrew Ballard
On Wed, Jul 15, 2009 at 11:30 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wednesday 15 July 2009 16:21:22 tedd wrote: At 12:38 PM -0700 7/14/09, Miller, Terion wrote: I am trying to make a page that displays a-z like a b c d e etc as links then when you click open one it reloads

Re: [PHP] Alphabetical pagination

2009-07-15 Thread tedd
At 8:29 AM -0700 7/15/09, Miller, Terion wrote: Hi all thanks for all the suggestions, I really had no idea this was going to be so difficult.. I think you are making it more difficult than it has to be. Please review what I said and try it out. Cheers, tedd -- ---

[PHP] running php script as a user?

2009-07-15 Thread Adam Williams
I have a page where a user authenticates, fills in some information in an HTML form, and then when clicking on the submit button, will need to execute a php schell script as that user to write some data to their /home/username directory. Since apache web server runs as the user nobody, how

Re: [PHP] Alphabetical pagination

2009-07-15 Thread Ashley Sheridan
On Wednesday 15 July 2009 16:46:53 Andrew Ballard wrote: On Wed, Jul 15, 2009 at 11:30 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wednesday 15 July 2009 16:21:22 tedd wrote: At 12:38 PM -0700 7/14/09, Miller, Terion wrote: I am trying to make a page that displays a-z like a b

[PHP] Exception not being caught

2009-07-15 Thread Weston C
So, I've got a little piece of code designed to play with catching the exception that's thrown when an object doesn't have a __toString method. ?php class A { } $a = new A(); // Ayn would be proud, right? try { echo a is ,$a,\n; } catch(Exception $e) { echo

Re: [PHP] Alphabetical pagination

2009-07-15 Thread Martin Scotta
SET @letter := 'B'; SELECT name FROM table WHERE SUBSTRING(name, 1) == @letter; SELECT name FROM table WHERE name like concat(@letter, '%'); I don't know a faster way to do it On Wed, Jul 15, 2009 at 12:57 PM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wednesday 15 July 2009 16:46:53

Re: [PHP] Re: I have an idea

2009-07-15 Thread Martin Scotta
On Wed, Jul 15, 2009 at 4:55 AM, Carlos Medinai...@simply-networks.de wrote: Martin Scotta schrieb: Hi Do you noted that all the discussion here are about problems, bugs, or just urgent pleaaase help me I have an idea. It is not really THE idea... but it is. What happen if tell this idea

Re: [PHP] Pattern Matching[Resolved]

2009-07-15 Thread VamVan
On Wed, Jul 15, 2009 at 4:21 AM, Lenin le...@phpxperts.net wrote: On Wed, Jul 15, 2009 at 3:24 AM, VamVanvamsee...@gmail.com wrote: contact/me - Contact US perfect match would be easy because I can exactly look for what I want. It becomes tricky when I introduce wild cards like

Re: [PHP] I have an idea

2009-07-15 Thread Martin Scotta
On Wed, Jul 15, 2009 at 10:38 AM, Govindagovinda.webdnat...@gmail.com wrote: PHP is a great language. You can do a lot of things with him, even have fun with it. My idea is to make a simple game where your have to write some AI to beat the other players AI The idea, as simple as it looks, is

Re: [PHP] I have an idea

2009-07-15 Thread tedd
At 4:40 PM +0100 7/15/09, Ashley Sheridan wrote: On Wednesday 15 July 2009 16:29:49 tedd wrote: Here's an AI (rule based) php game: http://sperling.com/quarters/ Get your AI to beat mine. :-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com

Re: [PHP] I have an idea

2009-07-15 Thread Martin Scotta
On Wed, Jul 15, 2009 at 12:29 PM, teddtedd.sperl...@gmail.com wrote: At 1:21 AM -0300 7/15/09, Martin Scotta wrote: Hi Do you noted that all the discussion here are about problems, bugs, or just urgent pleaaase help me I have an idea. It is not really THE idea... but it is. What happen if

Re: [PHP] Alphabetical pagination

2009-07-15 Thread Miller, Terion
--snip How do I write the for each loop in here: //alphabetical pagination links if (!isset($_GET['letter'])) {$letter = A;} else {$letter = $_GET['letter'];}

Re: [PHP] I have an idea

2009-07-15 Thread Govinda
That's the idea. You will have fun programming the AI and looking how it match between others. I'd like to see your game, do you still have it? -- Martin Scotta I would love to see someone write an AI to beat my best skill level that I could get into the AI. I can beat expert level now,

[PHP] boolean vs int comparison

2009-07-15 Thread Martin Scotta
I always have doubts about comparison between boolean and integers. Lets PHP shows hows is that he does. The results where: false$int === true / $int !== 0 false = $int === true false$int === false false = $int === false / $int !== 0 false == $int === false / $int !== 0 false === $int

Re: [PHP] I have an idea

2009-07-15 Thread Ashley Sheridan
On Wed, 2009-07-15 at 12:28 -0400, tedd wrote: At 4:40 PM +0100 7/15/09, Ashley Sheridan wrote: On Wednesday 15 July 2009 16:29:49 tedd wrote: Here's an AI (rule based) php game: http://sperling.com/quarters/ Get your AI to beat mine. :-) Cheers, tedd -- ---

Re: [PHP] I have an idea

2009-07-15 Thread Daniel Brown
On Wed, Jul 15, 2009 at 15:30, Ashley Sheridana...@ashleysheridan.co.uk wrote: Done! In order to never lose, don't play ;) That's what I had expected. ;-P About eleven years ago, a co-worker and I each wanted the same day off. I had seniority, but decided to play fair with him and

Re: [PHP] I have an idea

2009-07-15 Thread VamVan
On Wed, Jul 15, 2009 at 12:40 PM, Daniel Brown danbr...@php.net wrote: On Wed, Jul 15, 2009 at 15:30, Ashley Sheridana...@ashleysheridan.co.uk wrote: Done! In order to never lose, don't play ;) That's what I had expected. ;-P About eleven years ago, a co-worker and I each wanted

Re: [PHP] I have an idea

2009-07-15 Thread Tom Worster
On 7/15/09 12:21 AM, Martin Scotta martinsco...@gmail.com wrote: Hi Do you noted that all the discussion here are about problems, bugs, or just urgent pleaaase help me I have an idea. It is not really THE idea... but it is. What happen if tell this idea to the community? I don't know, so,

Re: [PHP] I have an idea

2009-07-15 Thread tedd
At 3:40 PM -0400 7/15/09, Daniel Brown wrote: When I got to his house, he ordered the pizza and asked if I was ready to lose. I told him quite the contrary: before the game starts, the score is a tie at zero-zero. Reminds me of many years ago when I was in New Orleans and a street kid

Re: [PHP] Scope of Variables and use of global and this-var

2009-07-15 Thread tedd
At 12:21 PM +0200 7/14/09, Anton Heuschen wrote: In my index.php page I then use $dbconnect again but do I simply use $dbconnect again ... or must I say global $dbconnect and then use it in the rest of the DB calls? or use GLOBALS .. Anton: My way -- every time I open a database, I do

[PHP] why is this SIMPLE elseif not firing?

2009-07-15 Thread Govinda
Sorry this is isn't good 'ninja' material.. but I gotta start where I am. this: echo 'is set (EditExistingClient) ='. isset($EditExistingClient).br / \n; is returning: is set (EditExistingClient) =1br / but this, later down the page: elseif ((isset($EditExistingClient)) ||

[PHP] Re: why is this SIMPLE elseif not firing?

2009-07-15 Thread Govinda
nevermind.. sorry for the noise. It was my if clause that was firing too much, and never even reaching that elseif. -G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] why is this SIMPLE elseif not firing?

2009-07-15 Thread Jim Lucas
Govinda wrote: Sorry this is isn't good 'ninja' material.. but I gotta start where I am. this: echo 'is set (EditExistingClient) ='. isset($EditExistingClient).br /\n; I realize this is after the fact, but... The above does not indicate WHAT it is set too. Just that it is set. it

Re: [PHP] why is this SIMPLE elseif not firing?

2009-07-15 Thread Govinda
I realize this is after the fact, but... The above does not indicate WHAT it is set too. Just that it is set. it could be set to /null/, FALSE, or 0 and they would all return false, and fail, in your if condition later on. I understand. I appreciate your taking the time to explain

Re: [PHP] PHP/mysql equivalent of PEAR's tableInfo()??

2009-07-15 Thread Jason Pruim
On Jul 13, 2009, at 10:03 AM, Govinda wrote: I have this code: $db_billing=mysqli_connect(localhost,metheuser,mypass,billing); if (mysqli_connect_error()) { die(Can't connect: . mysqli_connect_error()); } mysqli //$dbname = 'billing'; $sql = SHOW TABLES;

Re: [PHP] PHP/mysql equivalent of PEAR's tableInfo()??

2009-07-15 Thread Govinda
Better late then never! :) I played around with your code tonight and got this working on a test server: ?PHP $db_billing = mysql_connect($DBHOST, $DBUSER, $DBPASS) or die(Could not connect: .mysql_error()); $db_selected = mysql_select_db($DB, $db_billing); if(!$db_selected)

Re: [PHP] why is this SIMPLE elseif not firing?

2009-07-15 Thread Stuart
2009/7/15 Govinda govinda.webdnat...@gmail.com: Sorry this is isn't good 'ninja' material..  but I gotta start where I am. this: echo 'is set (EditExistingClient) ='. isset($EditExistingClient).br /\n; is returning: is set (EditExistingClient) =1br / but this, later down the page: elseif

Re: [PHP] why is this SIMPLE elseif not firing?

2009-07-15 Thread Stuart
Oops, clearly too early in the morning to be looking at code. Sorry. -Stuart 2009/7/16 Stuart stut...@gmail.com: 2009/7/15 Govinda govinda.webdnat...@gmail.com: Sorry this is isn't good 'ninja' material..  but I gotta start where I am. this: echo 'is set (EditExistingClient) ='.