php-general Digest 26 Oct 2005 17:00:35 -0000 Issue 3759

2005-10-26 Thread php-general-digest-help
php-general Digest 26 Oct 2005 17:00:35 - Issue 3759 Topics (messages 224659 through 224683): Re: Strange array access problem 224659 by: Robert Cummings 224661 by: Robert Cummings 224665 by: Robert Cummings 224666 by: Ken Tozier 224668 by: Ken Tozier

Re: [PHP] fopen

2005-10-26 Thread Jochem Maas
John Taylor-Johnston wrote: It does what I want, but I worry 4096 may not be big enough. Possible? 4096 is the number of bytes fgets() will get, but the fgets() call is inside a while loop which keeps running until the 'filepointer' (as denoted by the handle $dataFile) in question has reached

[PHP] zipped files

2005-10-26 Thread Clive
Hi 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. clive -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: fopen

2005-10-26 Thread Petr Smith
Hi, yes, there could be some problem with your code. But it depends on what are you trying to archieve. If you are trying to put whole file to database, there is no reason to use fgets function. Just use $buffer=file_get_contents($filename); and put the buffer into SQL. No reason to read it

[PHP] Perl style

2005-10-26 Thread Søren Schimkat
Hi guys I would like to convert this .. $tmparray = split(',', $csvstring); $element5 = $tmparray[5]; . to something like this: $element5 = (split(',', $csvstring))[5]; . but I just can't find the correct syntax. It is Perl style - i know, but I just love this syntax. :-) Does anyonw

[PHP] Re: zipped files

2005-10-26 Thread Rosty Kerei
Try something from here http://www.phpclasses.org/browse/class/42.html Sincerely, Rosty Kerei [EMAIL PROTECTED] Clive [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi does any one have code/examples for unzipping a file thats been uploaded to a server. I would prefer a class

RE: [PHP] GUID or any other unique IDs

2005-10-26 Thread Denis Gerasimov
Hello Ben, While not ideal, you could do a select on a db. MS SQL and MySQL both have functions to generate unique id's and I imagine the other databases do as well. While running a SELECT uuid() and hitting the database for each one of these things is annoying, it is one possible

RE: [PHP] Perl style

2005-10-26 Thread Jay Blanchard
[snip] $tmparray = split(',', $csvstring); $element5 = $tmparray[5]; . to something like this: $element5 = (split(',', $csvstring))[5]; [/snip] The syntax is correct in your first example, AFAIK the PERL syntax you describe cannot be done straight up in PHP unless you write a function to handle

Re: [PHP] Perl style

2005-10-26 Thread Jochem Maas
Søren Schimkat wrote: Hi guys I would like to convert this .. $tmparray = split(',', $csvstring); don't use split() here - there is no need for regexp. use explode() instead. $element5 = $tmparray[5]; . to something like this: $element5 = (split(',', $csvstring))[5]; $csvstring =

Re: [PHP] Perl style

2005-10-26 Thread rouvas
Simpler(?) approach: $element5 = current(array_splice(split(',',$csvstring),5,1)); This is fun! -Stathis On Wednesday 26 October 2005 17:08, Jochem Maas wrote: Sψren Schimkat wrote: Hi guys I would like to convert this .. $tmparray = split(',', $csvstring); don't use split()

Re: [PHP] zipped files

2005-10-26 Thread James Lobley
This is the class I use: http://www.phpconcept.net/pclzip/man/en/index.php On 10/26/05, Clive [EMAIL PROTECTED] wrote: Hi 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

[PHP] MySql connection error on win XP for script that works on Freebsd 5.3

2005-10-26 Thread Vizion
I have just installed MySql on Win XP and am attempting to run a php script to create some databases. The script works fine on FreeBSD 5.3 running mysql-client-5.0.11 and mysql-server-5.0.11. MySQL has been installed on windows XP using a download of mysql-5.0.13-rc-win32.zip. Test.php reports

RE: [PHP] MySql connection error on win XP for script that works on Freebsd 5.3

2005-10-26 Thread Jay Blanchard
[snip] I have searched the mysql website and located an article which shows reference to this error indicating that the client may need to be upgraded but as I am using the mysql-5.0.13-rc-win32.zip package I am cautious about assuming that that is the actual cause. [/snip]

[PHP] Re: MySql connection error on win XP for script that works on Freebsd 5.3

2005-10-26 Thread Holografix
Hi See this http://dev.mysql.com/doc/refman/5.0/en/old-client.html Best regards Vizion [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] I have just installed MySql on Win XP and am attempting to run a php script to create some databases. The script works fine on FreeBSD 5.3

[PHP] Decompress a zlib'd string in PHP

2005-10-26 Thread Graham Anderson
How do you decompress a zlib'd string located in a file with php ? I need to dynamically write a password string into a movie file. It appears that in QuickTime movie API, all sprite variables/values are zlib'd inside the movie file So I need to: find the string decompress a zlib'd

Re: [PHP] Decompress a zlib'd string in PHP

2005-10-26 Thread Richard Lynch
On Wed, October 26, 2005 11:07 am, Graham Anderson wrote: How do you decompress a zlib'd string located in a file with php ? http://www.php.net/zlib I need to dynamically write a password string into a movie file. It appears that in QuickTime movie API, all sprite variables/values are

[PHP] Re: Decompress a zlib'd string in PHP

2005-10-26 Thread Ben
Graham Anderson said the following on 10/26/2005 09:07 AM: I'm sure if I can decompress the string, then it will not be too hard to do the rest :) To decompress the string you'll want gzuncompress. More on zlib php: http://ca.php.net/manual/en/ref.zlib.php The on-line manual is your

Re: [PHP] zipped files

2005-10-26 Thread Richard Lynch
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/uploaded/file.zip;

[PHP] regex and global vars problem

2005-10-26 Thread Jason Gerfen
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. ?php /* * ex. 00:AA:11:BB:22:CC */ function chk_mac( $mac ) { if( ( eregi(

Re: [PHP] Decompress a zlib'd string in PHP

2005-10-26 Thread Graham Anderson
Just to show I am not a total leech, I did consult the manual before I posted the question :) The compressor in the file data says: dcomzlib I tried the below with gzinflate and with gzuncompress. Both give errors: gzinflate(): data error gzuncompress(): data error The below is the

Re: [PHP] Decompress a zlib'd string in PHP

2005-10-26 Thread Jochem Maas
Graham Anderson wrote: How do you decompress a zlib'd string located in a file with php ? I need to dynamically write a password string into a movie file. It appears that in QuickTime movie API, all sprite variables/values are zlib'd inside the movie file So I need to: find the string

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jasper Bryant-Greene
On Wed, 2005-10-26 at 11:15 -0600, 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. [snip] Would you mind telling us what the problem was? --

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jason Gerfen
Um I did actually, but I will re-interate the problem with more detail. the vars $mac1, $mac2, $mac3 are to get passed to the chk_mac() function which determines if it is a valid hex representation of a h/w address, if it does not meet the criteria of having a : separating every two

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jasper Bryant-Greene
On Wed, 2005-10-26 at 12:07 -0600, Jason Gerfen wrote: Um I did actually, but I will re-interate the problem with more detail. the vars $mac1, $mac2, $mac3 are to get passed to the chk_mac() function which determines if it is a valid hex representation of a h/w address, if it does not

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jason Gerfen
The code I just showed you is supposed to do the following, the chk_mac() returns a true or false on the vars $mac1, $mac2 and $mac3. $mac3 is the only var that should not be thrown into the fix_mac() function which is working correctly. The problem is when $mac1 and $mac2 get put into the

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jasper Bryant-Greene
On Wed, 2005-10-26 at 12:24 -0600, Jason Gerfen wrote: The code I just showed you is supposed to do the following, the chk_mac() returns a true or false on the vars $mac1, $mac2 and $mac3. $mac3 is the only var that should not be thrown into the fix_mac() function which is working

[PHP] str_split() and errors?

2005-10-26 Thread Jason Gerfen
I am recieving this error in the logs when attempting to split strings with str_split(). I am not sure but isn't this a default function for PHP, as in there aren't any dependant packages involved during the ./confgure time? Errors: PHP Fatal error: Call to undefined function: str_split()

Re: [PHP] Decompress a zlib'd string in PHP

2005-10-26 Thread Jochem Maas
Graham Anderson wrote: Just to show I am not a total leech, I did consult the manual before I posted the question :) ack. The compressor in the file data says: dcomzlib I tried the below with gzinflate and with gzuncompress. Both give errors: gzinflate(): data error gzuncompress(): data

[PHP] Re: str_split() and errors?

2005-10-26 Thread Ben
Jason Gerfen said the following on 10/26/2005 12:12 PM: I am recieving this error in the logs when attempting to split strings with str_split(). I am not sure but isn't this a default function for PHP, as in there aren't any dependant packages involved during the ./confgure time? Errors:

Re: [PHP] Decompress a zlib'd string in PHP

2005-10-26 Thread Graham Anderson
If I remove pack, I get the error: gzuncompress(): data error $uncompressed = gzuncompress($the_string); echo $uncompressed; in my hex editor, the movie header contains: ftypqt qt PmoovHcmov dcomzlib4cmvd From the Quicktime Docs, 'dcomzlib' is supposed to be

Re: [PHP] regex and global vars problem

2005-10-26 Thread Jochem Maas
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]*()? Jasper Bryant-Greene wrote: On Wed, 2005-10-26 at 12:24 -0600, Jason Gerfen wrote: The code I just showed you is supposed to do the

Re: [PHP] Re: str_split() and errors?

2005-10-26 Thread James Richardson
If you want to use this function in PHP4, you can use the PEAR package PHP_Compat from http://pear.php.net/ On Wed, 2005-10-26 at 12:19 -0700, Ben wrote: Jason Gerfen said the following on 10/26/2005 12:12 PM: I am recieving this error in the logs when attempting to split strings with

[PHP] Windows XP installation confusion.

2005-10-26 Thread Vizion
Hi In Install.text for php 5.0.5 on Page 3: Heading Manual Installation Steps Previous editions of the manual suggest moving various ini and DLL files into your SYSTEM folder..we advise remove all these files (like php.ini and PHP related DLLs from the Windows System folder... While

Re: [PHP] MySql connection error on win XP for script that works on Freebsd 5.3

2005-10-26 Thread Vizion
On Wednesday 26 October 2005 08:35, the author Jay Blanchard contributed to the dialogue on- RE: [PHP] MySql connection error on win XP for script that works on Freebsd 5.3: [snip] I have searched the mysql website and located an article which shows reference to this error indicating that

Re: [PHP] Windows XP installation confusion.

2005-10-26 Thread Richard Lynch
On Wed, October 26, 2005 6:42 pm, Vizion wrote: your SYSTEM folder..we advise remove all these files (like php.ini and PHP related DLLs from the Windows System folder... I wonder if someone has a list of the files that should be deleted bearing in mind I have just removed an

Re: [PHP] str_split() and errors?

2005-10-26 Thread Richard Lynch
On Wed, October 26, 2005 2:12 pm, Jason Gerfen wrote: I am recieving this error in the logs when attempting to split strings with str_split(). I am not sure but isn't this a default function for PHP, as in there aren't any dependant packages involved during the ./confgure time? Errors: PHP

Re: [PHP] Decompress a zlib'd string in PHP

2005-10-26 Thread Richard Lynch
On Wed, October 26, 2005 12:34 pm, Graham Anderson wrote: The compressor in the file data says: dcomzlib Okay, now we are getting somewhere. dcomzlib is, most likely, not the same as zlib. I tried the below with gzinflate and with gzuncompress. Both give errors: gzinflate(): data error

[PHP] Re: moving website from windows to linux hosting

2005-10-26 Thread Oliver Grätz
pedro mpa schrieb: (Like changing directory paths from \ to / ). Ahem... shouldn't you havee used / on the Windows machine, too? The \ comes from the DOS era of the Windows OS, but the / is the world standard and Windows Servers perfectly work with /. Even the Windows explorer is able to

Re: [PHP] Decompress a zlib'd string in PHP

2005-10-26 Thread Graham Anderson
Hi Richard :) Looks like all he did was change a couple of atoms names...BEFORE the compressed movie header stuff :( All in all is all pretty basic stuff. I am more interested in what comes AFTER dcomzlib. Quicktime automatically decompressed the movie header when it plays a file, so