Re: [PHP] PHP version check

2005-10-27 Thread Richard Davey
Hi Andrew, Friday, October 28, 2005, 7:41:21 AM, you wrote: > How can I query for PHP version? phpversion() ! Cheers, Rich -- Zend Certified Engineer http://www.launchcode.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP5 class constants

2005-10-27 Thread Chris
Dragan Stanojevic - Nevidljivi wrote: Jasper Bryant-Greene wrote: On Fri, 2005-10-28 at 01:02 +0200, Dragan Stanojevic - Nevidljivi wrote: [snip] and it works fine, I cannot define a constant by expression, like: class Foo { const AAA = 1 << 0; const BBB = 1 << 1; const CCC = 1 <

Re: [PHP] PHP5 class constants

2005-10-27 Thread Dragan Stanojevic - Nevidljivi
Jasper Bryant-Greene wrote: On Fri, 2005-10-28 at 01:02 +0200, Dragan Stanojevic - Nevidljivi wrote: [snip] and it works fine, I cannot define a constant by expression, like: class Foo { const AAA = 1 << 0; const BBB = 1 << 1; const CCC = 1 << 2; const DDD = 1 << 3; } Well now,

Re: [PHP] PHP5 class constants

2005-10-27 Thread Jasper Bryant-Greene
On Fri, 2005-10-28 at 01:02 +0200, Dragan Stanojevic - Nevidljivi wrote: [snip] > and it works fine, I cannot define a constant by expression, like: > > class Foo { > const AAA = 1 << 0; > const BBB = 1 << 1; > const CCC = 1 << 2; > const DDD =1 << 3; > } > > Well now, is this a b

Re: [PHP] regex and global vars problem

2005-10-27 Thread Tom Rogers
Hi, Thursday, October 27, 2005, 3:15:30 AM, you wrote: JG> I am having a problem with a couple of function I have written to check JG> for a type of string, attempt to fix it and pass it back to the main JG> function. Any help is appreciated. I would do it with a small class like this: is_valid

Re: [PHP] Using PHP for accsess control, preventing access to staticfiles

2005-10-27 Thread Jeffrey Sambells
I ran into a similar problem and came up with a slightly different solution... As an alternative to passing the file directly through PHP, if you are running apache, you could DENY access to all files in a directory and then use PHP to dynamically update a local .htaccess file with valid

Re: [PHP] foreach / unset

2005-10-27 Thread Niels Ganser
Why should this be "unsafe" (whatever the heck that means) in any way? Of course you can do it. Regards, Niels. [sorry for mailing to your private address. wrong button :)] > Anyway, can you do *this* safely as a DOCUMENTED FEATURE: > > foreach($array as $k => $v){ >   if (...) unset($array[$k]

[PHP] PHP5 class constants

2005-10-27 Thread Dragan Stanojevic - Nevidljivi
Hi guys, I think I've found a bug. I have a bunch of constants, and I'd like to present them as flags. While I can do class Foo { const AAA = 1; const BBB = 2; const CCC = 4; const DDD = 8; } and it works fine, I cannot define a constant by expression, like: class Foo { const

[PHP] Decompressing a string with zlib problems

2005-10-27 Thread Graham Anderson
I am having problems decompressing a zlib'd string located in a file. In the file headers, the compression says that it is zlib. But, when I 'gzinflate' the string, I get the error: gzinflate(): data error in Is the below NOT a zlib or some strange variant ? anyone know ? g $hex="C0636D766

[PHP] foreach / unset

2005-10-27 Thread Richard Lynch
Somewhere in the manual (damned if I can find it now) it says (or used to say) that you can or can't safely do this: while (list($k, $v) = each($array)){ if (...) unset($array[$k]); } I don't even remember if it's safe or not, but I swear I saw it not that long ago... Anyway, can you do *this*

Re: [PHP] Using PHP for accsess control, preventing access to staticfiles

2005-10-27 Thread Dan Trainor
Ben wrote: > Dan Trainor said the following on 10/27/2005 01:34 PM: > >> Ben wrote: >> >>> Move the files outside the document root so that they aren't available >>> via a direct URL, then create a 'file access page' in php that will >>> check for the session variable and either send or not send t

[PHP] Re: Trouble using DOM component with PHP 4.4.0

2005-10-27 Thread James Benson
The best solution is not to change your host at all but to change your local version of PHP to 4, PHP4 DOM - http://php.net/manual/en/ref.domxml.php PHP5 DOM - http://php.net/manual/en/ref.dom.php The PHP5 and PHP4 extensions are not compatible with each other. ~James Andrew Kachalo w

Re: [PHP] Trouble using DOM component with PHP 4.4.0

2005-10-27 Thread Andrew Kachalo
And what DOM library, which is compatible with PHP 5.0 and PHP 4.4 can I use to avoid the conflict I currently have? On жовт 27, 2005, at 23:32, Alessandro Rossini wrote: Please guide me what can I do to make my code work without changing it? DOM implementation in PHP5 is completely new, and

Re: [PHP] Using PHP for accsess control, preventing access to staticfiles

2005-10-27 Thread Ben
Dan Trainor said the following on 10/27/2005 01:34 PM: Ben wrote: Move the files outside the document root so that they aren't available via a direct URL, then create a 'file access page' in php that will check for the session variable and either send or not send the file based on whether the us

Re: [PHP] Using PHP for accsess control, preventing access to staticfiles

2005-10-27 Thread Dan Trainor
Ben wrote: > Dan Trainor said the following on 10/27/2005 10:39 AM: > >> Jason Motes wrote: > > However, how do people protect against the downloading of real files, ones which are not parsed by PHP? .WMV, .MOV, .ZIP, .EXE and so on? I want to protect access to these as well, an

Re: [PHP] Trouble using DOM component with PHP 4.4.0

2005-10-27 Thread Alessandro Rossini
> Please guide me what can I do to make my code work without changing it? DOM implementation in PHP5 is completely new, and you can't have the same in PHP4. I think that the most reasonable solution will be change the hosting to another with PHP5 support... Best regards. -- Alessandro 'Aronnax

[PHP] Re: regex and global vars problem

2005-10-27 Thread Al
Jason Gerfen wrote: I am having a problem with a couple of function I have written to check for a type of string, attempt to fix it and pass it back to the main function. Any help is appreciated. if( ( eregi( "^[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[

[PHP] Re: Strange array access problem

2005-10-27 Thread Al
Ken Tozier wrote: I'm having a major problem with what seems, on it's face, to be a really basic array function. What happens is on the browser end, I've written some javascript code that packages up javascript variables in native PHP format and sends the packed variables to a PHP script o

[PHP] Re: How to account for misspellings and alternatives in searching?

2005-10-27 Thread James Benson
Not sure about the numbers but soundex could be useful http://php.net/soundex James Chris W. Parker wrote: Hello, On my site right now if someone searches for "511" (a misspelling of the manufacturer 5.11) they are not presented with the right products because 511 is not found anywhere in

[PHP] How to account for misspellings and alternatives in searching?

2005-10-27 Thread Chris W. Parker
Hello, On my site right now if someone searches for "511" (a misspelling of the manufacturer 5.11) they are not presented with the right products because 511 is not found anywhere in the database. I've got a few ideas on how to solve this but I want to find one that requires as little administrat

Re: [PHP] Using PHP for accsess control, preventing access to staticfiles

2005-10-27 Thread Ben
Dan Trainor said the following on 10/27/2005 10:39 AM: Jason Motes wrote: However, how do people protect against the downloading of real files, ones which are not parsed by PHP? .WMV, .MOV, .ZIP, .EXE and so on? I want to protect access to these as well, and if a visitor just types in a URL

Re: [PHP] Using PHP for accsess control, preventing access to static files

2005-10-27 Thread Dan Trainor
Jason Motes wrote: >> >> I'm designing a controlled access system in PHP, and it's coming along >> quite well. It's very simple, and just sets a session varibale, such as >> $_SESSION['authenticated'] = 1, not a whole lot. >> >> Now I run a small sniplet of code on the top of each HTML and PHP fil

Re: [PHP] Using PHP for accsess control, preventing access to static files

2005-10-27 Thread Jason Motes
I'm designing a controlled access system in PHP, and it's coming along quite well. It's very simple, and just sets a session varibale, such as $_SESSION['authenticated'] = 1, not a whole lot. Now I run a small sniplet of code on the top of each HTML and PHP file, which checks for this variable,

[PHP] Using PHP for accsess control, preventing access to static files

2005-10-27 Thread Dan Trainor
Hello, all - I'm designing a controlled access system in PHP, and it's coming along quite well. It's very simple, and just sets a session varibale, such as $_SESSION['authenticated'] = 1, not a whole lot. Now I run a small sniplet of code on the top of each HTML and PHP file, which checks for th

Re: [PHP] php / openLdap

2005-10-27 Thread Björn Bartels
Hello ! ldap_add is expecting an ARRAY OF STRINGS (according to LDAP-specs) as third parameter. but your $info["objectclass"] is an array itself... maybe you try to implode it into one string... cheers, hope that helps... bb >Hello all, > >I have a problem with ldap function :/ > >Here is my ld

Re: [PHP] zipped files

2005-10-27 Thread Clive
Thanks its working clive James Lobley wrote: These are the relevant sections from my code: include("e:/bin/pclzip.php"); $provpath_dec = 'E:/Prov/Processed_Files/'; $provpath_unzip = 'E:/data/prov/'; $filename = '20051026202333.zip'; $archive = new PclZip($provpath_dec . $filename); $arch

[PHP] php / openLdap

2005-10-27 Thread Poil
Hello all, I have a problem with ldap function :/ Here is my ldap : -dc=arzur,dc=local - ou=Annuaire + cn=Benjamin DUPUIS + cn=Emeric GIRARD + cn=Fabrice DEPIL + cn=Fabrice GAUSSEN + cn=Jérôme LE MANSEC + cn=Olivier MAT

Re: [PHP] zipped files

2005-10-27 Thread Clive
Thanks Im going to give it a try. clive James Lobley wrote: These are the relevant sections from my code: include("e:/bin/pclzip.php"); $provpath_dec = 'E:/Prov/Processed_Files/'; $provpath_unzip = 'E:/data/prov/'; $filename = '20051026202333.zip'; $archive = new PclZip($provpath_dec . $fil

[PHP] Re: php session variables limited to 1 character -- please help

2005-10-27 Thread Oliver Grätz
Zac Smith schrieb: > http://www.triptrivia.com/step2-debug.php?State=abc 404 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] zipped files

2005-10-27 Thread James Lobley
These are the relevant sections from my code: include("e:/bin/pclzip.php"); $provpath_dec = 'E:/Prov/Processed_Files/'; $provpath_unzip = 'E:/data/prov/'; $filename = '20051026202333.zip'; $archive = new PclZip($provpath_dec . $filename); $archive->extract(PCLZIP_OPT_PATH, $provpath_unzip); As

[PHP] compiling php5 on winxp

2005-10-27 Thread Luka
I'm using VC6++ and the VC2003 Toolkit I downloaded a dev tree from: http://ftp.emini.dk/pub/php/win32/dev/php_build/ the compile keeps failing with: Creating library Release_TS\php5ts.lib and object Release_TS\php5ts.exp sunfuncs.obj : error LNK2001: unresolved external symbol __ftol2 uuen

[PHP] Sending E-Mail - Setting O/S User

2005-10-27 Thread Cabbar Duzayak
Hi, When someone sends an e-mail using php, exim sets the following 2 headers (along with others of course): Received:from x.x.x.x (EHLO host.mydomain.com) (x.x.x.x) by mta151.mail.dcn.yahoo.com with SMTP; Wed, 24 Sep 2005 10:29:04 -0700 Received: from by host.mydomain.com with lo

Re: [PHP] Detailed Report

2005-10-27 Thread Danny
Thank you very much I think it will work, because my problem seems to be with "if" operators and order... Thanks again On 10/27/05, Adrian Bruce <[EMAIL PROTECTED]> wrote: > > ok, so i assume that customers is a grouping of some sort and that in > some cases you may come accross a row like "Staf

Re: [PHP] Detailed Report

2005-10-27 Thread tomasz abramowicz
if your db is built correctly you could use UNION or JOIN(S) to build the correct query. otherwise look into DISTINCT(ROW) and/or creating temporary tables. formatting the info later is, as adrian illustrated, up to you. t. ps. all the above depends on your mysql server version and configuration

Re: [PHP] Detailed Report

2005-10-27 Thread Adrian Bruce
ok, so i assume that customers is a grouping of some sort and that in some cases you may come accross a row like "Staff | John | A36 |LA ". It may not be a perfect way of doinig it but this is what i would generally try: while ($row = mysql_fetch_array($resultset, MYSQL_NUM)){ if($ro

Re: [PHP] Detailed Report

2005-10-27 Thread Danny
Thanks for your help Adrian, but the problem is that I need to show row[0] once (Customers text are repeated), and below the details of the records Your solution shows: Customers | John | A36 | New York Customers | Jason | B45 | Los Angeles (...) And I need Customers John | A36 | New York Jason |

Re: [PHP] Detailed Report

2005-10-27 Thread Adrian Bruce
load each row of the resultset into an array $row using mysql_fetch_array(), each field in the result set row will be held in the corresponding array element. while ($row = mysql_fetch_array($resultset, MYSQL_NUM)){ echo"$row[0] | $row[1] | $row[2]"; } Hope this helps, Ade Danny wrote:

[PHP] Detailed Report

2005-10-27 Thread Danny
Hi All, I´ve got a connection, to a MySQL db, and get the following ResultSet(Category | Name | Code | City) Customers | John | A36 | New York Customers | Jason | B45 | Los Angeles Customers | Max | A36 | Paris Providers | John | A36 | London Providers | Mark | B67 | Madrid And I need the report

[PHP] Problem upgrading from 5.0.2 and 5.05

2005-10-27 Thread Karlos Zafra
My system was runig apache 2.0.52+php5.0.2 under Windows Xp without any problem. Today i've decided to upgrade to 5.0.5 but after unzipping the files in the C:\php folder where it was installed de .0.2 version Apache complained about not finding "php5apache2.dll". The message from the command line

Re: [PHP] regex and global vars problem

2005-10-27 Thread Jasper Bryant-Greene
On Thu, 2005-10-27 at 00:00 +0200, Jochem Maas wrote: > gonna jump on your thread there Jasper, I would > like to comment on your function and ask you a question: > > which is 'better' (for what), preg_*() or ereg[i]*()? I prefer preg_*(), but I used eregi() because I couldn't be bothered figurin

Re: [PHP] regex and global vars problem

2005-10-27 Thread Richard Heyes
Jochem Maas wrote: Richard Heyes wrote: Jochem Maas wrote: > gonna jump on your thread there Jasper, I would > like to comment on your function and ask you a question: > > which is 'better' (for what), preg_*() or ereg[i]*()? preg_*, for anything. They're faster, and more versatile. coo

Re: [PHP] regex and global vars problem

2005-10-27 Thread Jochem Maas
Richard Heyes wrote: Jochem Maas wrote: > gonna jump on your thread there Jasper, I would > like to comment on your function and ask you a question: > > which is 'better' (for what), preg_*() or ereg[i]*()? preg_*, for anything. They're faster, and more versatile. cool cheers. I guess you

Re: [PHP] regex and global vars problem

2005-10-27 Thread Richard Heyes
Jochem Maas wrote: > gonna jump on your thread there Jasper, I would > like to comment on your function and ask you a question: > > which is 'better' (for what), preg_*() or ereg[i]*()? preg_*, for anything. They're faster, and more versatile. -- Richard Heyes http://www.phpguru.org -- PHP Gene

Re: [PHP] zipped files

2005-10-27 Thread Clive
Richard Lynch wrote: On Wed, October 26, 2005 5:44 am, Clive wrote: does any one have code/examples for unzipping a file thats been uploaded to a server. I would prefer a class rather than something that uses zip.lib as it may not be configured on the server. $path = "/full/path/to/uploade

Re: [PHP] Perl style

2005-10-27 Thread Søren Schimkat
Quoting rouvas <[EMAIL PROTECTED]>: > Simpler(?) approach: > > $element5 = current(array_splice(split(',',$csvstring),5,1)); > > This is fun! Indeed... and this looks just fine. A great solution. Thanks. :-) -Søren > > -Stathis > > On Wednesday 26 October 2005 17:08, Jochem Maas wrote: > > S

Re: [PHP] zipped files

2005-10-27 Thread Clive
Hi, I found that class but could not get it to work. Well it seem to work, as I could view the files information, but the extract() didn't do anything. I checked the writes for the directory the zip file was in and it did have wright rights. Maybe you can post a code snippet. thanks clive