[PHP] XPath 2.0 in PHP 5.3

2009-05-06 Thread Raymond Irving
Hi, Does any one knows if XPath 2.0 will be supported in 5.3? __ Raymond Irving -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Remote MySQL Connecton Problems

2009-05-06 Thread Ray Hauge
Hello everyone, I've run into a bit of a sticky situation trying to connect to a remote MySQL database. Here's the background: Connecting from the command line on the web server works. Connecting from a different vhost works. There's no information in mysql_error. In fact, mysql_select_db(

[PHP] Re: SimpleXML Class

2009-05-06 Thread Nathan Rixham
Cesco wrote: Could you help me clarify one thing that I don't understand... let's put it simple, just imagine that I have a tiny XML document with a list of movies: Gone with the wind I want to read this XML file and write the name of the first (and only) movie in the lis

Re: [PHP] speaking of control structures...

2009-05-06 Thread Clancy
On Wed, 06 May 2009 08:54:14 -0400, f...@thefsb.org (Tom Worster) wrote: ... >clancy, i can't argue with you. my desired usage of break is really just a >cover-up for a goto. i know. > >it makes no logical sense but i think i'd sooner adopt oop than gotos. my >mom taught me to program back in

Re: [PHP] speaking of control structures...

2009-05-06 Thread Nathan Rixham
Robert Cummings wrote: On Wed, 2009-05-06 at 08:41 -0400, Tom Worster wrote: On 5/6/09 7:05 AM, "Robert Cummings" wrote: That seems like an abuse of exceptions. But then we're already abusing loops. I just don't think one could say it's the proper way to do it :) i don't have a lot of intere

Re: [PHP] speaking of control structures...

2009-05-06 Thread Marcus Gnaß
Robert Cummings wrote: > On Wed, 2009-05-06 at 22:23 +0200, Marcus Gnaß wrote: >> Robert Cummings wrote: >>> On Wed, 2009-05-06 at 12:56 +0200, Marcus Gnaß wrote: Tom Worster wrote: > there's a control structure i wish php had: a simple block that you can > break out of, e.g. > >>

[PHP] SimpleXML Class

2009-05-06 Thread Cesco
Could you help me clarify one thing that I don't understand... let's put it simple, just imagine that I have a tiny XML document with a list of movies: Gone with the wind I want to read this XML file and write the name of the first (and only) movie in th

Re: [PHP] speaking of control structures...

2009-05-06 Thread Robert Cummings
On Wed, 2009-05-06 at 15:50 -0500, Shawn McKenzie wrote: > Marcus Gnaß wrote: > > Robert Cummings wrote: > >> On Wed, 2009-05-06 at 12:56 +0200, Marcus Gnaß wrote: > >>> Tom Worster wrote: > there's a control structure i wish php had: a simple block that you can > break out of, e.g. > >>>

Re: [PHP] speaking of control structures...

2009-05-06 Thread Robert Cummings
On Wed, 2009-05-06 at 22:23 +0200, Marcus Gnaß wrote: > Robert Cummings wrote: > > On Wed, 2009-05-06 at 12:56 +0200, Marcus Gnaß wrote: > >> Tom Worster wrote: > >>> there's a control structure i wish php had: a simple block that you can > >>> break out of, e.g. > >> > >> As Maarten pointed out yo

Re: [PHP] speaking of control structures...

2009-05-06 Thread Shawn McKenzie
Marcus Gnaß wrote: > Robert Cummings wrote: >> On Wed, 2009-05-06 at 12:56 +0200, Marcus Gnaß wrote: >>> Tom Worster wrote: there's a control structure i wish php had: a simple block that you can break out of, e.g. >>> As Maarten pointed out you could use a function. Another alternative i

Re: [PHP] Re: SQL Injection - Solution

2009-05-06 Thread Shawn McKenzie
Andrew Ballard wrote: > On Wed, May 6, 2009 at 2:25 PM, Shawn McKenzie wrote: >> Igor Escobar wrote: >>> Yeah yeah, i understood that, but, the point is... i sad previously, my >>> function is not tied to any database. >>> >>> Is a generic function, i dont know who be use this, so i don't know, wh

Re: [PHP] speaking of control structures...

2009-05-06 Thread Marcus Gnaß
Robert Cummings wrote: > On Wed, 2009-05-06 at 12:56 +0200, Marcus Gnaß wrote: >> Tom Worster wrote: >>> there's a control structure i wish php had: a simple block that you can >>> break out of, e.g. >> >> As Maarten pointed out you could use a function. Another alternative is >> to use Exceptions

[PHP] Re: speaking of control structures...

2009-05-06 Thread Al
Tom Worster wrote: there's a control structure i wish php had: a simple block that you can break out of, e.g. block { if ( condition ) break; blah... blah... if ( another condition ) break; blah... blah... etc... } the block is just like a loop except that it is ex

Re: [PHP] Re: SQL Injection - Solution

2009-05-06 Thread Andrew Ballard
On Wed, May 6, 2009 at 2:25 PM, Shawn McKenzie wrote: > Igor Escobar wrote: >> Yeah yeah, i understood that, but, the point is... i sad previously, my >> function is not tied to any database. >> >> Is a generic function, i dont know who be use this, so i don't know, what is >> your data base so, i

Re: [PHP] Re: SQL Injection - Solution

2009-05-06 Thread Shawn McKenzie
Please reply all. > Do you test with associative arrays? > Yes. Array ( [test] => some stuff \"here\" [test_array] => Array ( [a] => a\"a [0] => b\'b [c] => Array ( [x] => x\"x [0] => y\'y

Re: [PHP] Re: SQL Injection - Solution

2009-05-06 Thread Shawn McKenzie
Igor Escobar wrote: > Yeah yeah, i understood that, but, the point is... i sad previously, my > function is not tied to any database. > > Is a generic function, i dont know who be use this, so i don't know, what is > your data base so, i can't use functions like mysql_real_scape_string etc... The

Re: [PHP] Re: SQL Injection - Solution

2009-05-06 Thread Shawn McKenzie
Igor Escobar wrote: > hun...by the way I forgot to mention, I am Brazilian and here in Brazil > these words are not common ... Yes, but you can reuse your function even if you start accepting english posts/comments, etc. You don't want this function to be specific to your app or data because

Re: [PHP] Re: SQL Injection - Solution

2009-05-06 Thread Igor Escobar
Yeah yeah, i understood that, but, the point is... i sad previously, my function is not tied to any database. Is a generic function, i dont know who be use this, so i don't know, what is your data base so, i can't use functions like mysql_real_scape_string etc... Regards, Igor Escobar Systems An

Re: [PHP] Re: SQL Injection - Solution

2009-05-06 Thread Bruno Fajardo
2009/5/6 Igor Escobar : > hun...by the way I forgot to mention, I am Brazilian and here in Brazil > these words are not common ... Igor, I'm brazilian too, but that is not the point. Deny the use of *any* word as input in your app is unnecessary. The problem that you're trying to solve, has b

Re: [PHP] Re: SQL Injection - Solution

2009-05-06 Thread Igor Escobar
Now i realize... i sent only to the Shawn the modified functions... here goes: function _antiSqlInjection($Target){ $sanitizeRules = array('OR','FROM','SELECT','INSERT','DELETE','WHERE','DROP TABLE','SHOW TABLES','*','--','='); foreach($Target as $key => $value): if(is_array($valu

Re: [PHP] Re: SQL Injection - Solution

2009-05-06 Thread Igor Escobar
hun...by the way I forgot to mention, I am Brazilian and here in Brazil these words are not common ... That is a recursive function and i can use array_map becouse i some cases we obtain arrays of arrays and that will generate a error. Regards, Igor Escobar Systems Analyst & Interface Design

Re: [PHP] Re: SQL Injection - Solution

2009-05-06 Thread Shawn McKenzie
Igor Escobar wrote: > Hunnn... > > So, what do you think now? > > function _antiSqlInjection($Target){ > $sanitizeRules = > array('OR','FROM','SELECT','INSERT','DELETE','WHERE','DROP > TABLE','SHOW TABLES','*','--','='); > foreach($Target as $key => $value): > if(is_array($value)):

Re: [PHP] SQL Injection - Solution

2009-05-06 Thread Michael Shadle
mysql_escape_string can be used instead. You just lose the ability to have it match coallation. I still think there should be the mysql_escape_string or real one and allow it to pass the coallation without a database handle -or- just make a unicode/utf8 one and be done with it. On May 6,

Re: [PHP] SQL Injection - Solution

2009-05-06 Thread Igor Escobar
I know that use the mysql_real_escape_string to do de job is better but you should consider that the this function don't have any access to the data base, to objective of this function is sanitize the string. And please, see my second answer, i make some updates in the function that possibly is re

Re: [PHP] SQL Injection - Solution

2009-05-06 Thread Andrew Ballard
On Wed, May 6, 2009 at 12:06 PM, Bruno Fajardo wrote: > Hi there! > > 2009/5/6 Igor Escobar >> >> Hi folks, >> Someone know how i can improve this function to protect my envairounment >> vars of sql injection attacks. >> >> that is the function i use to do this, but, some people think is not enou

Re: [PHP] SQL Injection - Solution

2009-05-06 Thread Bruno Fajardo
Hi there! 2009/5/6 Igor Escobar > > Hi folks, > Someone know how i can improve this function to protect my envairounment > vars of sql injection attacks. > > that is the function i use to do this, but, some people think is not enough: > >  * @uses $_REQUEST= _antiSqlInjection($_REQUEST); >  * @us

[PHP] Re: SQL Injection - Solution

2009-05-06 Thread Shawn McKenzie
Igor Escobar wrote: > Hi folks, > Someone know how i can improve this function to protect my envairounment > vars of sql injection attacks. > > that is the function i use to do this, but, some people think is not enough: > > * @uses $_REQUEST= _antiSqlInjection($_REQUEST); > * @uses $_POST = _a

[PHP] SQL Injection - Solution

2009-05-06 Thread Igor Escobar
Hi folks, Someone know how i can improve this function to protect my envairounment vars of sql injection attacks. that is the function i use to do this, but, some people think is not enough: * @uses $_REQUEST= _antiSqlInjection($_REQUEST); * @uses $_POST = _antiSqlInjection($_POST); * @uses $_

Re: [PHP] speaking of control structures...

2009-05-06 Thread Tom Worster
On 5/6/09 8:55 AM, "Per Jessen" wrote: > Shawn McKenzie already posted the right solution - did you miss it? no, per, i didn't. i like do {} while (0) very much. thanks, shawn! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] speaking of control structures...

2009-05-06 Thread Per Jessen
Tom Worster wrote: > On 5/6/09 6:56 AM, "Marcus Gnaß" wrote: > >> Tom Worster wrote: >>> there's a control structure i wish php had: a simple block that you >>> can break out of, e.g. >> >> As Maarten pointed out you could use a function. Another alternative >> is to use Exceptions which might

Re: [PHP] speaking of control structures...

2009-05-06 Thread Tom Worster
On 5/5/09 8:55 PM, "Clancy" wrote: > On Tue, 05 May 2009 14:13:23 -0400, rob...@interjinn.com (Robert Cummings) > wrote: > >> On Tue, 2009-05-05 at 13:56 -0400, Tom Worster wrote: >>> there's a control structure i wish php had: a simple block that you can >>> ... > >> But PHP 5.3 introd

Re: [PHP] speaking of control structures...

2009-05-06 Thread Robert Cummings
On Wed, 2009-05-06 at 08:43 -0400, Tom Worster wrote: > On 5/6/09 6:56 AM, "Marcus Gnaß" wrote: > > > Tom Worster wrote: > >> there's a control structure i wish php had: a simple block that you can > >> break out of, e.g. > > > > As Maarten pointed out you could use a function. Another alternati

Re: [PHP] speaking of control structures...

2009-05-06 Thread Robert Cummings
On Wed, 2009-05-06 at 08:41 -0400, Tom Worster wrote: > On 5/6/09 7:05 AM, "Robert Cummings" wrote: > > > That seems like an abuse of exceptions. But then we're already abusing > > loops. I just don't think one could say it's the proper way to do it :) > > i don't have a lot of interest in "the

Re: [PHP] speaking of control structures...

2009-05-06 Thread Tom Worster
On 5/6/09 6:56 AM, "Marcus Gnaß" wrote: > Tom Worster wrote: >> there's a control structure i wish php had: a simple block that you can >> break out of, e.g. > > As Maarten pointed out you could use a function. Another alternative is > to use Exceptions which might be the most proper way to do i

Re: [PHP] How to deal with identical fields in db

2009-05-06 Thread Peter Ford
tedd wrote: > At 3:14 AM -0700 5/6/09, Michael A. Peters wrote: >> Peter Ford wrote: >>> >>> tedd wrote: (and I added in some extra bits...) You need to normalize. Authors should have an unique id in an authors table. The authors table has all the specific information about auth

Re: [PHP] speaking of control structures...

2009-05-06 Thread Tom Worster
On 5/6/09 7:05 AM, "Robert Cummings" wrote: > That seems like an abuse of exceptions. But then we're already abusing > loops. I just don't think one could say it's the proper way to do it :) i don't have a lot of interest in "the proper way" to do things. i'm interested in how other programmers

Re: [PHP] How to deal with identical fields in db

2009-05-06 Thread tedd
At 3:14 AM -0700 5/6/09, Michael A. Peters wrote: Peter Ford wrote: tedd wrote: (and I added in some extra bits...) You need to normalize. Authors should have an unique id in an authors table. The authors table has all the specific information about authors, but not the books they have writte

Re: [PHP] elseif statements

2009-05-06 Thread Gary
>>He already found the problem and fixed it :)<< Correction: His problem was pointed out to him and he was able to follow instructions he he. I think I posted yesterday, but I had the double= in the script earlier, but it was givning inconsisitant answers, however when I changed the = for=

Re: [PHP] Re: elseif statements

2009-05-06 Thread Jan G.B.
Hi Gary, 2009/5/5 Gary : > Jan > > Thanks for your note. > > So your wrote: > > $x = (3)*(2) makes no sense. > $x = 3 * 2 works, as > $x = (3 * 2) does, too. > But this is not an error at all. ^^ > > In the first example($x = (3)*(2) makes no sense.), which is

Re: [PHP] speaking of control structures...

2009-05-06 Thread Robert Cummings
On Wed, 2009-05-06 at 12:56 +0200, Marcus Gnaß wrote: > Tom Worster wrote: > > there's a control structure i wish php had: a simple block that you can > > break out of, e.g. > > > As Maarten pointed out you could use a function. Another alternative is > to use Exceptions which might be the most p

Re: [PHP] speaking of control structures...

2009-05-06 Thread Marcus Gnaß
Tom Worster wrote: > there's a control structure i wish php had: a simple block that you can > break out of, e.g. As Maarten pointed out you could use a function. Another alternative is to use Exceptions which might be the most proper way to do it. -- PHP General Mailing List (http://www.php.ne

Re: [PHP] elseif statements

2009-05-06 Thread Robert Cummings
On Tue, 2009-05-05 at 22:31 -0700, Jim Lucas wrote: > Well, since nobody seems to want to answer your question, I will... :) > > It has to do with you using an assignment '=' instead of a comparison '==' > operator in your condition. He already found the problem and fixed it :) Cheers, Rob. --

Re: [PHP] How to deal with identical fields in db

2009-05-06 Thread Michael A. Peters
Peter Ford wrote: tedd wrote: (and I added in some extra bits...) You need to normalize. Authors should have an unique id in an authors table. The authors table has all the specific information about authors, but not the books they have written. Books should have an unique id in a books table

Re: [PHP] how to enable ttf support in php 5.2.9

2009-05-06 Thread Ashley Sheridan
On Tue, 2009-05-05 at 16:22 -0700, Michael A. Peters wrote: > Ashley Sheridan wrote: > > >> > > content coming from MS Office clipboard pastes generally contain > > characters that are encoded wrong, and do not display correctly in web > > pages unless they have very relaxed doctypes. The function

Re: [PHP] How to deal with identical fields in db

2009-05-06 Thread Peter Ford
tedd wrote: (and I added in some extra bits...) > You need to normalize. > > Authors should have an unique id in an authors table. The authors table > has all the specific information about authors, but not the books they > have written. > > Books should have an unique id in a books table. The

Re: [PHP] Avoid to open mysql querries then times in the page

2009-05-06 Thread Michael A. Peters
tedd wrote: On 5/4/09, Matthieu wrote: Hello, I'm a totally newbie to php/Mysql but I'd like to know if it is normal that I have to connect 3 times to the db in one page. For example, I have 1. A connection for the login / pass a $_SESSION['login'] before the HTML tags 2. I need