Re: [PHP] Regular Expression by Exception

2008-08-04 Thread Micah Gersten
I don't know how to use the POSIX classes, but if you use preg_replace: preg_replace("/[^$params]/", '', $string); I think this will work. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Alberto García Gómez wrote: > Fellows: > > If I use ereg_replace($param

Re: [PHP] RPM

2008-08-04 Thread Jim Lucas
VamVan wrote: Hello All, Does any body create installable RPM's for reinstalling their PHP based websites? Is it possible If yes could you please share your experience. Oh yes you could tar it but that's a primitive method. My quest is to make all my websites installable on any given s

[PHP] Variable number of parameters

2008-08-04 Thread Philip Thompson
Is it possible to grab a variable number of parameters and send the appropriate amount to another function? db->prepare("SELECT * FROM `table` WHERE (`id`=?)"); $this->db->bind('ii', $id1); $this->db->prepare("SELECT * FROM `table` WHERE (`id`=? AND `other_id`=?)"); $this->db->bind('ii', $i

[PHP] Regular Expression by Exception

2008-08-04 Thread Alberto García Gómez
Fellows: If I use ereg_replace($params, $string) I can replace the char that match with $params in the $string. BUT, how I can replace ALL chars EXCEPT the chars in $params. Something like !$params, I think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://w

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Larry Garfield
I'm building a multi-database system, although my main targets are MySQL, Postgres, and SQLite. How would those handle something like "a string that ends in 100%"? On Monday 04 August 2008 6:18:24 pm Asher Snyder wrote: > Depending on what database you're using you might be able to use LIKE >

Re: [PHP] [PHP Header] Right-Click Download in Firefox showing php filename

2008-08-04 Thread Will
Thanks everyone. I looked into the Firefox browser forums/support and found that the "Right-Click >> Save Link As" does not send the header response, as it will take the file as-is. So in this example, it sees the 'download.php' and then takes that as the default name. It then starts the download o

Re: [PHP] PHP querying mysql db for data limited to the last month

2008-08-04 Thread Micah Gersten
1. To get last months date, you can use strtotime("1 month ago") instead of mktime. 2. I don't see anywhere in the code where you are limiting by date. Try using > and <. Between is tricky on dates. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Vinny Gu

[PHP] PHP querying mysql db for data limited to the last month

2008-08-04 Thread Vinny Gullotta
So I have this code I'm working with (pasted below) that queries a mysql db table called timetracking. The goal of the page is to search the db for all data based on a certain engineer, sorted by product and it takes pre-defined values based on actions performed, sums them based on product and d

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Asher Snyder
Depending on what database you're using you might be able to use LIKE while maintaining security. For instance PostgreSQL has the functions quote_ident(), and quote_literal() which would allow you to use LIKE since these functions would automatically make the string suitable for comparison.

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Adam Richardson
Like I said, I'm not 'especially pleased' with any idea up until now. I'm certainly open to any other ideas. Adam On Mon, Aug 4, 2008 at 6:57 PM, Larry Garfield <[EMAIL PROTECTED]>wrote: > > Hm. So your solution is "don't use LIKE"? I can't say I'm wild about > that. :-/ > > --Larry Garfield

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Larry Garfield
Hm. So your solution is "don't use LIKE"? I can't say I'm wild about that. :-/ --Larry Garfield On Mon, 4 Aug 2008 15:49:52 -0400, "Adam Richardson" <[EMAIL PROTECTED]> wrote: > Larry, > > I agree that having to escape values in a stored procedure does run > counter > to expectations. It's l

Re: [PHP] PHP Memory Management

2008-08-04 Thread Waynn Lue
> > Waynn Lue wrote: > >> I've been running the script below: >> >> > $appIds = getLotsOfAppIds(); >> foreach ($appIds as $appId) { >>echo "$appId\n"; >>//echo memory_get_usage() . "\n"; >>try { >> $getBundles = getBundles($appId); >> $numBundles = count($registeredBundles);

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Adam Richardson
Larry, I agree that having to escape values in a stored procedure does run counter to expectations. It's likely other developers have the potential for short-circuiting their LIKE conditions without realizing it. I've dealt with this issue, too, and haven't been especially pleased with any of th

RE: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Boyd, Todd M.
> -Original Message- > From: Andrew Ballard [mailto:[EMAIL PROTECTED] > Sent: Monday, August 04, 2008 10:49 AM > To: PHP General list > Subject: Re: [PHP] PDO prepared statements and LIKE escaping > > On Mon, Aug 4, 2008 at 11:35 AM, Larry Garfield > <[EMAIL PROTECTED]> wrote: > > > > On M

Re: [PHP] Since APC is no longer supported on Windows, can anyone else make php_apc.dll for the newest 5.2.6 non-thread-safe?

2008-08-04 Thread steve
Yeah, back from January. They stopping shipping APC in the PHP downloads (specifically the PECL download for Windows). And since pecl4win.php.net does NOT have the nts versions, it is pretty useless. On Sat, Jul 26, 2008 at 12:22 AM, T Lensselink <[EMAIL PROTECTED]> wrote: > steve wrote: >> Since

Re: [PHP] Not found regex

2008-08-04 Thread Shawn McKenzie
Boyd, Todd M. wrote: -Original Message- From: Shawn McKenzie [mailto:[EMAIL PROTECTED] Sent: Monday, August 04, 2008 10:33 AM To: php-general@lists.php.net Subject: Re: [PHP] Not found regex Manoj Singh wrote: Hi All, Thanks for your replies. Actually i am placing this regex in .htacce

RE: [PHP] Not found regex

2008-08-04 Thread Boyd, Todd M.
> -Original Message- > From: Shawn McKenzie [mailto:[EMAIL PROTECTED] > Sent: Monday, August 04, 2008 10:33 AM > To: php-general@lists.php.net > Subject: Re: [PHP] Not found regex > > Manoj Singh wrote: > > Hi All, > > Thanks for your replies. > > > > Actually i am placing this regex in .h

Re: [PHP] E-Shop system

2008-08-04 Thread Micah Gersten
Alain Roger wrote: > Hi, > > i'm currently analyzing an e-shop system. > i understand how to display products and so on, however i still have some > question marks on the following topics: > > 1. what is the best way for showing product image ? > - to store them in DB or onto filesystem as simple

Re: [PHP] uploading big files with PHP

2008-08-04 Thread Daniel Brown
On Mon, Aug 4, 2008 at 12:55 AM, Catalin Zamfir Alexandru | KIT Software CAZ <[EMAIL PROTECTED]> wrote: > What are you talking about? I've been able to upload a 4GB file without > problem. Uploading doesn't depend on memory limit, and this has been a > subject of debate on the PHP.net Manual (upl

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Larry Garfield
On Mon, 4 Aug 2008 11:48:39 -0400, "Andrew Ballard" <[EMAIL PROTECTED]> wrote: > On Mon, Aug 4, 2008 at 11:35 AM, Larry Garfield <[EMAIL PROTECTED]> > wrote: >> >> On Mon, 04 Aug 2008 08:33:44 +0200, Per Jessen <[EMAIL PROTECTED]> wrote: >>> Larry Garfield wrote: >>> IIRC, the way in SQL to c

Re: [PHP] mail script not working

2008-08-04 Thread Per Jessen
Richard Kurth wrote: > I have been trying to get this mail script to send an html message and > it just sends the html in plain text with all the html code showing. > Could somebody tell my way this will not work. When it does send it > takes a long time to go through but when I send a plan text m

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Andrew Ballard
On Mon, Aug 4, 2008 at 11:35 AM, Larry Garfield <[EMAIL PROTECTED]> wrote: > > On Mon, 04 Aug 2008 08:33:44 +0200, Per Jessen <[EMAIL PROTECTED]> wrote: >> Larry Garfield wrote: >> >>> IIRC, the way in SQL to circumvent that is to convert "100%" into >>> "100%%". However, that does rather defeat th

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Per Jessen
Larry Garfield wrote: > Actually in most cases in PHP you don't get much performance. Exactly. > What you do get is added security, because prepared statements are > cleaner than cleaner and more reliable than string escaping. Of > course, then we run into the % problem above. I don't really

[PHP] mail script not working

2008-08-04 Thread Richard Kurth
I have been trying to get this mail script to send an html message and it just sends the html in plain text with all the html code showing. Could somebody tell my way this will not work. When it does send it takes a long time to go through but when I send a plan text message it goes through right

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Larry Garfield
On Mon, 04 Aug 2008 08:33:44 +0200, Per Jessen <[EMAIL PROTECTED]> wrote: > Larry Garfield wrote: > >> IIRC, the way in SQL to circumvent that is to convert "100%" into >> "100%%". However, that does rather defeat the purpose of a prepared >> statement if I have to do my own escaping anyway, does

Re: [PHP] Not found regex

2008-08-04 Thread Shawn McKenzie
Manoj Singh wrote: Hi All, Thanks for your replies. Actually i am placing this regex in .htaccess file. Here i have to redirect all the request to https if it is not for ogg file. The complete code is: RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} ^.+\.ogg$ //Need some tweaking here. I kn

Re: [PHP] Not found regex

2008-08-04 Thread Manoj Singh
Hi All, Thanks for your replies. Actually i am placing this regex in .htaccess file. Here i have to redirect all the request to https if it is not for ogg file. The complete code is: RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} ^.+\.ogg$ //Need some tweaking here. I know this code works ju

Re: [PHP] Not found regex

2008-08-04 Thread Yeti
On Mon, Aug 4, 2008 at 4:44 PM, Manoj Singh <[EMAIL PROTECTED]> wrote: > Hello All, > I have to create the regular expression to allow all the file extensions > except the specified extension. > > Suppose I want to allow extensions with php, so the regex is: ^.+\.php$ > > But here i need the regex

RE: [PHP] Not found regex

2008-08-04 Thread Wei, Alice J.
From: Manoj Singh [EMAIL PROTECTED] Sent: Monday, August 04, 2008 10:44 AM To: php-general@lists.php.net Subject: [PHP] Not found regex Hello All, I have to create the regular expression to allow all the file extensions except the specified extension. Suppose I want to allow exte

[PHP] Not found regex

2008-08-04 Thread Manoj Singh
Hello All, I have to create the regular expression to allow all the file extensions except the specified extension. Suppose I want to allow extensions with php, so the regex is: ^.+\.php$ But here i need the regex which allows all the extensions except php. I will appreciate any help. Best Reg

Re: [PHP] SoapClient and arrays

2008-08-04 Thread Aschwin Wesselius
Marten Lehmann wrote: Hello, I'm calling a webservice that is described by a WSDL-URL using the PHP-builtin Soap client. This works fine in general. But although the response is received correct, the variable type is wrong. According to the WSDL file, the response is defined like this:

[PHP] SoapClient and arrays

2008-08-04 Thread Marten Lehmann
Hello, I'm calling a webservice that is described by a WSDL-URL using the PHP-builtin Soap client. This works fine in general. But although the response is received correct, the variable type is wrong. According to the WSDL file, the response is defined like this: type="s:bool

Re: [PHP] Store database password outside of public_html folder

2008-08-04 Thread Jason Pruim
On Aug 4, 2008, at 7:54 AM, Don Don wrote: Hi All, I've been reading on the internet that is most secure to store your database details outside of the public accessible folder. I am a bit stuck on how to do this. I've got a folder "db_details" that contains the file "dbdetails" which co

[PHP] Store database password outside of public_html folder

2008-08-04 Thread Don Don
Hi All, I've been reading on the internet that is most secure to store your database details outside of the public accessible folder. I am a bit stuck on how to do this. I've got a folder "db_details" that contains the file "dbdetails" which contains the database login info. I normally includ

Re: [PHP] How to jump into and loop through XML element

2008-08-04 Thread Aschwin Wesselius
Ethan Whitt wrote: PHP newbie coming over from Perl. Been trying to convert some of my Perl scripts over to PHP5. I am making a request to Amazon and receiving the following response. How can I jump down to the element and loop through all the ones that exist. I have been trying to do this w

[PHP] How to jump into and loop through XML element

2008-08-04 Thread Ethan Whitt
PHP newbie coming over from Perl. Been trying to convert some of my Perl scripts over to PHP5. I am making a request to Amazon and receiving the following response. How can I jump down to the element and loop through all the ones that exist. I have been trying to do this with XML Simple, but w

Re: [PHP] [PHP Header] Right-Click Download in Firefox showing php filename

2008-08-04 Thread David Otton
2008/8/4 Will <[EMAIL PROTECTED]>: > I am trying to have users download a file named 'Setup.msi', however > under a PHP file with the sent header information, the default name to > $forcename = "ApplicationSetup_v1_0.msi"; > $filename = "Setup.msi"; > > header("Content-Type: application/force-dow

Re: [PHP] [PHP Header] Right-Click Download in Firefox showing php filename

2008-08-04 Thread mike
On 8/3/08, Will <[EMAIL PROTECTED]> wrote: > @readfile($filename); You should look into a webserver and instead of using readfile() which will keep the PHP engine open while it is spoonfeeding the browser, offload the file to the webserver. nginx has X-Accel-Redirect (nginx is the best anyway) L

Re: [PHP] uploading big files with PHP

2008-08-04 Thread mike
On 8/3/08, Catalin Zamfir Alexandru | KIT Software CAZ <[EMAIL PROTECTED]> wrote: > What are you talking about? I've been able to upload a 4GB file without > problem. Uploading doesn't depend on memory limit, and this has been a > subject of debate on the PHP.net Manual (uploading files section,