Re: [PHP] Regex in PHP

2008-06-05 Thread Robert Cummings
On Thu, 2008-06-05 at 00:24 -0400, Nathan Nobbe wrote: you really know how to rub it in there rob. but i was looking at the implementation in the php code, looks like somebody likes my idea (this code found in ext/standard/string.c). on the second line the haystack is converted to lower

Re: [PHP] Re: Quickly verifying single word.

2008-06-05 Thread Per Jessen
Shawn McKenzie wrote: if (preg_match('/[\s]*/', $string) === false) { echo 'No spaces!'; } -Shawn Second one doesn't work for some reason. No time now to test, will later. How about: if (preg_match('/\s/', $string) === false) { echo 'No spaces!'; } /Per Jessen, Zürich --

[PHP] Are there free http mysql tunneling writed in php ?

2008-06-05 Thread KLEIN Stéphane
Hi, do you know one free (open source) http mysql tunneling writed in php ? Thanks for your information, Stephane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Are there free http mysql tunneling writed in php ?

2008-06-05 Thread Per Jessen
KLEIN Stéphane wrote: Hi, do you know one free (open source) http mysql tunneling writed in php ? I don't know of any specific implementation, but surely you can write one in about 60 seconds. get http://domain/run-this-sql?db=databasetext=blahblahblah I'm sure you get the idea. /Per

[PHP] Re: Are there free http mysql tunneling writed in php ?

2008-06-05 Thread Colin Guthrie
KLEIN Stéphane wrote: do you know one free (open source) http mysql tunneling writed in php ? Do you mean tunnelling in the classic sense, e.g. have a webpage that spits reads in data and spits out data and to which you can effectively connect a standard mysql client to? Or do you just

[PHP] mail() error handling

2008-06-05 Thread Henrik Johansson
Hi. I have a piece of code that uses mail() to, well, send mail. It works, but not the error handling which is as follows: snip $send = @mail( $to, $subject, $body, $headers ); if($send) {header( Location: http://somewhere/thankyou.html; );} else {print Oops, couldn't deliver the message,

Re: [PHP] Re: Quickly verifying single word.

2008-06-05 Thread Usamah M. Ali
On Thu, Jun 5, 2008 at 9:19 AM, Per Jessen [EMAIL PROTECTED] wrote: Shawn McKenzie wrote: if (preg_match('/[\s]*/', $string) === false) { echo 'No spaces!'; } -Shawn Second one doesn't work for some reason. No time now to test, will later. How about: if (preg_match('/\s/',

Re: [PHP] Re: Quickly verifying single word.

2008-06-05 Thread Usamah M. Ali
On Thu, Jun 5, 2008 at 12:02 PM, Usamah M. Ali [EMAIL PROTECTED] wrote: Won't work either. The problem lies in using the === comparison operator. preg_match() returns 0 if no match is found, and FALSE if an error occurred. So using === will always echo 'No spaces' whether there were spaces or

Re: [PHP] Re: Quickly verifying single word.

2008-06-05 Thread Per Jessen
Usamah M. Ali wrote: According to your needs, it could be simply shortened to the first if: if (preg_match('/\s+/i', $string) === 0) { echo 'No white spaces'; } And you could even remove the '+'. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Regex in PHP

2008-06-05 Thread Richard Heyes
sorry to bother you richard. You didn't, I just wanted to make sure I wasn't losing it (more). -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP

[PHP] cancel of [EMAIL PROTECTED]

2008-06-05 Thread Henrik Johansson
cancel by original author -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] A problem with fgets()

2008-06-05 Thread Usamah M. Ali
Well, finally found an explanation and a solution: calling fgets() twice. Because if there's no length limit supplied (and it's not EOF) when calling the function, it continues reading until it finds the first newline character. So calling fgets() again will ensure that it will read from the

Re: [PHP] mail() error handling

2008-06-05 Thread Stut
On 5 Jun 2008, at 09:48, Henrik Johansson wrote: I have a piece of code that uses mail() to, well, send mail. It works, but not the error handling which is as follows: snip $send = @mail( $to, $subject, $body, $headers ); if($send) {header( Location: http://somewhere/thankyou.html; );} else

[PHP] Dynamic form changes without refresh

2008-06-05 Thread Mayer, Jonathan
Hiya all, I have a PHP page with a form holding a large number of textarea boxes. These text boxes are individually set as enabled or disabled based on a flag held in a MySQL database. I want to be able to dynamically enable or disable a specific box without the page being recalled (potentially

Re: [PHP] Dynamic form changes without refresh

2008-06-05 Thread Per Jessen
Mayer, Jonathan wrote: Using some basic javascript/AJAX, I have set up a link next to each text box, which calls code that updates the database in the background without refreshing the page. If I manually refresh the page, the textarea box in question updates correctly, proving that the

RE: [PHP] Dynamic form changes without refresh

2008-06-05 Thread Mayer, Jonathan
I suppose that, as well as updating the database when I click the link, I could also update a CSS toggle, but I'd really like it to be deciding whether to toggle only based on the flag in the database. So: // check database if ($toggle == 1) { textarea.../textarea } else { textarea

Re: [PHP] Dynamic form changes without refresh

2008-06-05 Thread Wolf
BOTTOM POST Mayer, Jonathan wrote: I suppose that, as well as updating the database when I click the link, I could also update a CSS toggle, but I'd really like it to be deciding whether to toggle only based on the flag in the database. So: // check database if ($toggle == 1) {

RE: [PHP] Dynamic form changes without refresh

2008-06-05 Thread Per Jessen
Mayer, Jonathan wrote: I suppose that, as well as updating the database when I click the link, I could also update a CSS toggle, but I'd really like it to be deciding whether to toggle only based on the flag in the database. So: // check database if ($toggle == 1) {

RE: Re: [PHP] Are there free http mysql tunneling writed in php ?

2008-06-05 Thread Boyd, Todd M.
-Original Message- From: Per Jessen [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2008 3:06 AM To: php-general@lists.php.net Subject: Re: [PHP] Are there free http mysql tunneling writed in php ? KLEIN Stéphane wrote: Hi, do you know one free (open source) http mysql

RE: [PHP] Dynamic form changes without refresh

2008-06-05 Thread Boyd, Todd M.
-Original Message- From: Mayer, Jonathan [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2008 7:18 AM To: 'php-general@lists.php.net' Subject: [PHP] Dynamic form changes without refresh ---8--- snip Using some basic javascript/AJAX, I have set up a link next to each text box,

RE: Re: [PHP] Are there free http mysql tunneling writed in php ?

2008-06-05 Thread Wolf
Boyd wrote: -Original Message- From: Per Jessen [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2008 3:06 AM To: php-general@lists.php.net Subject: Re: [PHP] Are there free http mysql tunneling writed in php ? KLEIN Stéphane wrote: Hi, do you know one

RE: Re: [PHP] Are there free http mysql tunneling writed in php ?

2008-06-05 Thread Boyd, Todd M.
-Original Message- From: Wolf [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2008 10:33 AM To: Boyd, Todd M. Cc: Per Jessen; php-general@lists.php.net Subject: RE: Re: [PHP] Are there free http mysql tunneling writed in php ? I don't know of any specific implementation, but

RE: Re: [PHP] Are there free http mysql tunneling writed in php ?

2008-06-05 Thread Wolf
!-- Snip -- I seem to have hit a nerve. Sorry for explaining best practices when I feel they're applicable. If you read through the archives, this same type of thing comes up about every other month. That and the I want to know how to do this where there is no PHP involved and/or no PHP

[PHP] Caching and Optimization

2008-06-05 Thread VamVan
Hello All, Today my question is about the all important topic Web Optimization What kind of caching mechanisms can I use for Mysql Queries? I was wondering if you have some methods would you share some code? What kind of caching and optimization mechanisms can I use for frequent Web Service

RE: Re: [PHP] Are there free http mysql tunneling writed in php ?

2008-06-05 Thread Boyd, Todd M.
-Original Message- From: Wolf [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2008 10:49 AM To: Boyd, Todd M. Cc: php-general@lists.php.net Subject: RE: Re: [PHP] Are there free http mysql tunneling writed in php ? !-- Snip -- I seem to have hit a nerve. Sorry for explaining

[PHP] Re: Execute php commands that are in an array

2008-06-05 Thread Ryan S
Hey all! Disregard my last email as i solved it myself via eval()... Cheers! R Hey, its easier to start with code and then explain: $t_array[]='chr(rand(97,122))'; echo $t_array[0]; The above code outputs chr(rand(97,122)) How can i execute that above code from the array instead of

RE: Re: [PHP] Are there free http mysql tunneling writed in php ?

2008-06-05 Thread Wolf
!-- Snip -- I don't feel that this is violating any guidelines for this mailing list (or any programming-related mailing list, for that matter, without a specific security counterpart), and so your DUH was taken as offensive and unprovoked. If this was not the case, well, then let's let

RE: Re: [PHP] Are there free http mysql tunneling writed in php ?

2008-06-05 Thread Boyd, Todd M.
-Original Message- From: Wolf [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2008 11:51 AM To: Boyd, Todd M. Cc: php-general@lists.php.net Subject: RE: Re: [PHP] Are there free http mysql tunneling writed in php ? ---8--- snip I'm all for securing your PHP stuff, but at the

Re: [PHP] Re: Execute php commands that are in an array

2008-06-05 Thread Gabriel Sosa
you can use eval http://ar2.php.net/manual/es/function.eval.php but remember escape all wildcard caracters try eval(\$a = 3; \$b = 2; \$c = \$a + \$b;); echo $c // should show 5 saludos On Thu, Jun 5, 2008 at 1:46 PM, Ryan S [EMAIL PROTECTED] wrote: Hey all! Disregard my last email as i

[PHP] Execute php commands that are in an array

2008-06-05 Thread Ryan S
Hey, its easier to start with code and then explain: $t_array[]='chr(rand(97,122))'; echo $t_array[0]; The above code outputs chr(rand(97,122)) How can i execute that above code from the array instead of displaying it? Thanks! Ryan -- - The faulty interface lies between the chair and

Re: [PHP] Execute php commands that are in an array

2008-06-05 Thread Daniel Brown
On Thu, Jun 5, 2008 at 12:34 PM, Ryan S [EMAIL PROTECTED] wrote: Hey, its easier to start with code and then explain: $t_array[]='chr(rand(97,122))'; echo $t_array[0]; The above code outputs chr(rand(97,122)) How can i execute that above code from the array instead of displaying it?

Re: [PHP] Caching and Optimization

2008-06-05 Thread Nathan Nobbe
On Thu, Jun 5, 2008 at 10:16 AM, VamVan [EMAIL PROTECTED] wrote: Hello All, Today my question is about the all important topic Web Optimization What kind of caching mechanisms can I use for Mysql Queries? mysql has its own caching support, worth looking into. you can also cache query

RES: [PHP] Execute php commands that are in an array

2008-06-05 Thread Thiago Pojda
I'm not sure I understand what you're trying to accomplish, but wouldn't array_walk() help you out? Atenciosamente, www.softpartech.com.br Thiago Henrique Pojda Desenvolvimento Web +55 41 3033-7676 [EMAIL PROTECTED] Excelência em Softwares Financeiros -Mensagem original- De: Daniel

[PHP] Updating inherited attributes without __construct()

2008-06-05 Thread Tyson Vanover
I have a class that has a list of valid keys, and an array of values. When a value is added to the array it's key is first checked against the list of valid keys (this is to prevent injection issues we have been having later on in the project). class parent{ private $validkeys =

[PHP] Search like php.net's URL thingy

2008-06-05 Thread Ryan S
Hey, one of the things that make the php.net site so cool is how easy it is to find info for a function or a list of topics.. eg: http://php.net/arrays http://php.net/count I'm sure nearly all of you reading this have done it more times than you would care to count, i'm trying to get something

RE: Re: [PHP] Are there free http mysql tunneling writed in php ?

2008-06-05 Thread Per Jessen
Boyd, Todd M. wrote: Well DUH, but then you should already know that we on this list don't CODE everything for some and that the general consensus is secure your own code. I seem to have hit a nerve. Sorry for explaining best practices when I feel they're applicable. Todd, the thing is -

Re: [PHP] Search like php.net's URL thingy

2008-06-05 Thread Daniel Brown
On Thu, Jun 5, 2008 at 3:07 PM, Ryan S [EMAIL PROTECTED] wrote: Hey, one of the things that make the php.net site so cool is how easy it is to find info for a function or a list of topics.. eg: http://php.net/arrays http://php.net/count [snip!] since i couldnt find the answer via

Re: [PHP] Search like php.net's URL thingy

2008-06-05 Thread Ryan S
Hey! Thanks for replying. Digging a bit more i found IfModule mod_rewrite.c RewriteEngine On RewriteRule ^([a-z][0-9][A-Z][aA0-zZ0])$ jj.php?show=$1 /IfModule But it does not work :( do you see any fault with the above? Thanks! R -- - The faulty interface lies between the chair and

[PHP] Re: Search like php.net's URL thingy

2008-06-05 Thread Shawn McKenzie
Ryan S wrote: Hey, one of the things that make the php.net site so cool is how easy it is to find info for a function or a list of topics.. eg: http://php.net/arrays http://php.net/count I'm sure nearly all of you reading this have done it more times than you would care to count, i'm trying

Re: [PHP] Re: Search like php.net's URL thingy

2008-06-05 Thread Nate Tallman
Why not just set: ErrorDocument 404 /path/to/some/script.php Then check $SERVER['REDIRECT_URL'] for the failed request. On Thu, Jun 5, 2008 at 2:41 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: Ryan S wrote: Hey, one of the things that make the php.net site so cool is how easy it is to find

Re: [PHP] Re: Search like php.net's URL thingy

2008-06-05 Thread Nate Tallman
ErrorDocument 404 /path/to/some/script.php * $_SERVER['REDIRECT_URL'] (somehow misplaced underscore) On Thu, Jun 5, 2008 at 2:50 PM, Nate Tallman [EMAIL PROTECTED] wrote: Why not just set: ErrorDocument 404 /path/to/some/script.php Then check $SERVER['REDIRECT_URL'] for the failed request.

Re: [PHP] Re: Search like php.net's URL thingy

2008-06-05 Thread Shawn McKenzie
As far as I remember, errordocument still send the code, in this case 404 to the client. In the case of IE, this will display IEs built-in error doc if the server supplied one is 512 Bytes. Maybe other implications for spiders also. I might be wrong, but this is from some old memory.

[PHP] fsockopen Fread and fget issue

2008-06-05 Thread Ross King II
When I do the following it grabs the response (And using a packet sniffer I can see the server responds quick). If I only call fread one time it will read and return the page to the server. If I read a second batch after the eof it hangs for 30 seconds. All I want to do is send a raw POST

Re: [PHP] Re: Search like php.net's URL thingy

2008-06-05 Thread Nate Tallman
Not true, Apache does return a 404, but IE will use the custom 404 page if it is available. Nate On Thu, Jun 5, 2008 at 2:57 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: As far as I remember, errordocument still send the code, in this case 404 to the client. In the case of IE, this will

Re: [PHP] Re: Search like php.net's URL thingy

2008-06-05 Thread Shawn McKenzie
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807 Also, why would you want Google let's say, to receive a 404 Not Found header for http://php.net/arrays??? -Shawn Nate Tallman wrote: Not true, Apache does return a 404, but IE will use the custom 404 page if it is available.

Re: [PHP] Re: Search like php.net's URL thingy

2008-06-05 Thread Nate Tallman
Correction for my statement: As long as the content length is greater than 512 bytes, IE will display the content from the 404. Less than that and it will display it's own pretty message. http://www.404-error-page.com/404-error-page-too-short-problem-microsoft-ie.shtml

Re: [PHP] Re: Search like php.net's URL thingy

2008-06-05 Thread Ryan S
clip As far as I remember, errordocument still send the code, in this case 404 to the client. In the case of IE, this will display IEs built-in error doc if the server supplied one is 512 Bytes. Maybe other implications for spiders also. I might be wrong, but this is from some old memory.

Re: [PHP] Re: Search like php.net's URL thingy

2008-06-05 Thread Nate Tallman
Why is an ErrorDocument insufficient or not the elegant way? It accomplishes the goal in a clean way, no? Nate On Thu, Jun 5, 2008 at 3:25 PM, Yeti [EMAIL PROTECTED] wrote: still telling Ryan to produce errors is insufficient or at least not the elegant way On 6/5/08, Nate Tallman [EMAIL

Re: [PHP] Re: Search like php.net's URL thingy [0.T]

2008-06-05 Thread Ryan S
Hey again, First of all please note that i added a [0.T] (= off topic ) to the subject so if you dont want to continue with something OT, now's the time... Ok... for anyone thats curious as to why i wanted this.. just completed my version of tinyURL... except, its even more tiny!! Have

Re: [PHP] Re: Search like php.net's URL thingy [0.T]

2008-06-05 Thread Daniel Brown
On Thu, Jun 5, 2008 at 4:52 PM, Ryan S [EMAIL PROTECTED] wrote: Hey again, First of all please note that i added a [0.T] (= off topic ) to the subject so if you dont want to continue with something OT, now's the time... Ok... for anyone thats curious as to why i wanted this.. just

[PHP] Sr. PHP Engineer job opportunity / Denver

2008-06-05 Thread Nick Gasparro
Hello Group, I have an immediate opportunity available for a Senior Software Engineer in Denver, CO (relocation assistance is available). This is a great opportunity to join a dynamic and growing Internet-based company. The individual will be responsible for the development, implementation,

Re: [PHP] Re: Search like php.net's URL thingy [0.T]

2008-06-05 Thread Philip Olson
Hello, php.net uses a 404 error handler for this, and most mirrors store url data in an sqlite database. A simple $_SERVER dump in your 404 page will show you which variables are available. Regards, Philip