Re: [PHP] sorting in array

2006-07-31 Thread weetat
Hi , Doesn't work . Any ideas ? Thanks Peter Lauri wrote: function cmpcountry($a, $b) { $country1 = $a['country']; $country2 = $b['country']; if($country1=='') return 1; else return ($country1 $country2) ? -1 : 1; } -Original

Re: [PHP] sorting in array

2006-07-31 Thread Paul Novitski
At 10:31 PM 7/30/2006, weetat wrote: I have problem when doing usort() when 'country' = '', i would like to display records where country = '' last. Any ideas how to do that ? ... $arraytest= array( array ( 'country' = '', ) , array (

RE: [PHP] sorting in array

2006-07-31 Thread Paul Novitski
At 05:40 PM 7/30/2006, Peter Lauri wrote: function cmpcountry($a, $b) { $country1 = $a['country']; $country2 = $b['country']; if($country1=='') return 1; else return ($country1 $country2) ? -1 : 1; } Good call, Peter; my suggestion was

RE: [PHP] sorting in array

2006-07-31 Thread Paul Novitski
At 12:22 AM 7/31/2006, Paul Novitski wrote: I could make that last statement just a bit simpler: function cmpcountry($a, $b) { $country1 = ($a['country'] == '') ? zzz : $a['country']; $country2 = ($b['country'] == '') ? zzz : $b['country']; return ($country1

Re: [PHP] sorting in array

2006-07-31 Thread weetat
Thanks Paul, Very weird tried Peter's option, it doesn't work. Btw , how to sort by ascending ? Thanks Paul Novitski wrote: At 12:22 AM 7/31/2006, Paul Novitski wrote: I could make that last statement just a bit simpler: function cmpcountry($a, $b) { $country1 =

Re: [PHP] sorting in array

2006-07-31 Thread Paul Novitski
At 01:14 AM 7/31/2006, weetat wrote: Thanks Paul, Very weird tried Peter's option, it doesn't work. Btw , how to sort by ascending ? Please explain what you mean. The current script DOES sort ascending by country (except for the blank country fields which are placed at the end):

RE: [PHP] sorting in array

2006-07-31 Thread Peter Lauri
And this for DESCending function cmpcountry($a, $b) { $country1 = $a['country']; $country2 = $b['country']; if($country1=='' OR $country2=='') { if($country1==$country2) return 0; elseif($country1=='') return

RE: [PHP] sorting in array

2006-07-31 Thread Peter Lauri
Sorry, I just woke up and just posted an reply without thinking, use this: function cmpcountry($a, $b) { $country1 = $a['country']; $country2 = $b['country']; if($country1=='' OR $country2=='') { if($country1==$country2) return 0;

[PHP] Nested foreach statement

2006-07-31 Thread Chris Grigor
Have been wondering if this is possible Basically I have 3 posted arrays, $_POST['reporton_company'] (this can be various company id's. ie 3,6,7) $_POST['report_period'] (this can be various periods but a max of 4 submitted. ie 3,4,5) $_POST['questions_groups'] (this can be various -

Re: [PHP] sorting in array

2006-07-31 Thread David Tulloh
weetat wrote: Hi all , I have array value as shown below, i have paste my test php code below: I have problem when doing usort() when 'country' = '', i would like to display records where country = '' last. Any ideas how to do that ? ... You might try searching the list's archive's.

[PHP] memory leak - how to find it?

2006-07-31 Thread Robin Getz
I am trying to debug a php script that I downloaded, which has a memory leak in it. I was looking for a way to find what variables were in php's memory, and what size, they were, but I couldn't find anything? The script is a off-line wiki conversion tool (walks through a wiki to create a

[PHP] AES client side

2006-07-31 Thread Andrew Senyshyn
Hi all, I need to implement AES decryption algorythm on client side (in browser). I tried javascript but it is too slow. Does anybody have others ideas how to decrypt data transfered by from server to client in browser? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] memory leak - how to find it?

2006-07-31 Thread David Tulloh
Robin Getz wrote: I am trying to debug a php script that I downloaded, which has a memory leak in it. I was looking for a way to find what variables were in php's memory, and what size, they were, but I couldn't find anything? The script is a off-line wiki conversion tool (walks through a

Re: [PHP] AES client side

2006-07-31 Thread Andrei
Encrypting/decriptying data at client side (in javascript or whatever script which sends the code to the client) is useless. It's like having the data in clear at client side. I use JavaScript only to make the interface interactive. Andy Andrew Senyshyn wrote: Hi all, I need

RE: [PHP] AES client side

2006-07-31 Thread Jay Blanchard
[snip] I need to implement AES decryption algorythm on client side (in browser). I tried javascript but it is too slow. Does anybody have others ideas how to decrypt data transfered by from server to client in browser? [/snip] You need to employ a Secure Sockets Layer. -- PHP General Mailing

Re: [PHP] AES client side

2006-07-31 Thread Thomas Munz
What do you need exaclty? Do you wanna encrypt the datas, that will be transfered to the client Or do you wanna encrypt the source code, that will be displayed on the client? For reason 1 you can use SSL connection to encrypt the transfered datas. For reason 2: forget it. The Browser needs to

Re: [PHP] AES client side

2006-07-31 Thread tedd
At 2:59 PM +0300 7/31/06, Andrew Senyshyn wrote: I need to implement AES decryption algorythm on client side (in browser). I tried javascript but it is too slow. Does anybody have others ideas how to decrypt data transfered by from server to client in browser? Excuse my ignorance, but if you

Re: [PHP] AES client side

2006-07-31 Thread Andrei
Then get a SSL certificate and let the browser do the job. If you do it with JavaScript or open-code language why shouldn't I just take your code and sniff the data you/the browser sends and decrypt it. Andy Andrew Senyshyn wrote: Andrei wrote: Encrypting/decriptying data

Re: [PHP] memory leak - how to find it?

2006-07-31 Thread chris smith
On 7/31/06, Robin Getz [EMAIL PROTECTED] wrote: I am trying to debug a php script that I downloaded, which has a memory leak in it. I was looking for a way to find what variables were in php's memory, and what size, they were, but I couldn't find anything? The script is a off-line wiki

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Andrei wrote: Then get a SSL certificate and let the browser do the job. If you do it with JavaScript or open-code language why shouldn't I just take your code and sniff the data you/the browser sends and decrypt it. Just playing devil's advocate here...But I believe that if implemented

[PHP] Error Loading php module

2006-07-31 Thread Brad Bonkoski
Any insights or tips into this? httpd: Syntax error on line 232 of /home/www/conf/httpd.conf: Cannot load /home/www/modules/libphp5.so into server: /home/www/modules/libphp5.so: undefined symbol: _pcre_ucp_findprop TIA. -Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

RE: [PHP] AES client side

2006-07-31 Thread Jay Blanchard
[snip] Just playing devil's advocate here...But I believe that if implemented properly, encryption/decryption on the client could be secure, for example a diffie-hellman key exchange with AJAX, followed by encryption. [/snip] Doesn't matter the key, you must use SSL to encrypt from client to

Re: [PHP] Nested foreach statement

2006-07-31 Thread chris smith
foreach($_POST['reporton_company'] as $cmp_ind =$arrayd_cmp_id) { foreach($_POST['report_period'] as $rep_ind =$arrayd_per_id) { foreach($_POST['questions_groups'] as $group_ind = $arrayd_group_no) { mysql_select_db($database_name, $dname); Why

[PHP] Re: mb_substr()

2006-07-31 Thread Al
Utedd wrote: Hi gang: From another list, a person posted: I want to use PHP's mb_substr() function to grab the first letter of a UTF-8 encoded word (in Czech) being pulled out of MySQL. If I use the plain substr() the data gets garbled and I get a ? symbol in the browser. My host says that

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Jay Blanchard wrote: [snip] Just playing devil's advocate here...But I believe that if implemented properly, encryption/decryption on the client could be secure, for example a diffie-hellman key exchange with AJAX, followed by encryption. [/snip] Doesn't matter the key, you must use SSL to

RE: [PHP] AES client side

2006-07-31 Thread Jay Blanchard
[snip] Why *must* you use SSL? Again, devil's advocate here (SSL is probably much better) but that doesn't mean that you can't use some crazy JS and PHP to implement some alternative encryption technique. (Say a symmetric algorithm that isn't implemented in any standard SSL implementations, or

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Jay Blanchard wrote: This still leaves any Javascript exposed, doesn't it? Yes, but that shouldn't matter. The algorithms for RSA, AES, etc, etc are all publicly available, why bother hiding their JavaScript implementations? Only the data would be encrypted. jon -- PHP General Mailing

RE: [PHP] AES client side

2006-07-31 Thread Jay Blanchard
[snip] Jay Blanchard wrote: This still leaves any Javascript exposed, doesn't it? Yes, but that shouldn't matter. The algorithms for RSA, AES, etc, etc are all publicly available, why bother hiding their JavaScript implementations? Only the data would be encrypted. [/snip] So, you're

[PHP] Re: AES client side

2006-07-31 Thread Colin Guthrie
Jay Blanchard wrote: This still leaves any Javascript exposed, doesn't it? And OpenSSL is an open source security library. does that make it insecure? The fact the source is available is irrelevent if the proper key generation exchange/negotiation practices are adhered too. I have to

RE: [PHP] AES client side

2006-07-31 Thread Kilbride, James P.
-Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Monday, July 31, 2006 10:38 AM To: Jon Anderson; [php] PHP General List Subject: RE: [PHP] AES client side [snip] Why *must* you use SSL? Again, devil's advocate here (SSL is probably much better) but

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Jay Blanchard wrote: Yes, but that shouldn't matter. The algorithms for RSA, AES, etc, etc are all publicly available, why bother hiding their JavaScript implementations? Only the data would be encrypted. [/snip] So, you're suggesting that you can use Ajax or some other mechanism to hide the

RE: [PHP] AES client side

2006-07-31 Thread Jay Blanchard
[snip] There's no hiding. You could use a secure key exchange mechanism, such as Diffie-Hellman. Diffie-Hellman is used to generate a shared key between two hosts (say A and B) such that each host knows the key, but any third party listening in on the information is unable to trivially

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Jay Blanchard wrote: I am quite familiar with diffie-helman and have used it extensively with PGP and can see how it would be used like this, but isn't this a munged fix as opposed to using SSL? Yep. :-) There are cases (testing new algorithms, proof of concept, something I haven't thought

Re: [PHP] AES client side

2006-07-31 Thread Robin Vickery
On 31/07/06, Jon Anderson [EMAIL PROTECTED] wrote: Jay Blanchard wrote: Yes, but that shouldn't matter. The algorithms for RSA, AES, etc, etc are all publicly available, why bother hiding their JavaScript implementations? Only the data would be encrypted. [/snip] So, you're suggesting that

Re: [PHP] AES client side

2006-07-31 Thread Jon Anderson
Robin Vickery wrote: How about if the third party can control one side of the transaction by altering the javascript that implements it while in transit - for instance by adding a couple of lines that transmit the key to the third party after the key exchange? If the algorithm written in

[PHP] Issues with PHP 5.1.4 / GD FreeType / Linux

2006-07-31 Thread Vedanta Barooah
hello all, i am trying to compile freetype support for php 5.1.4, on linux ... looks like i have set all the compile options correct ... but some how freetype support does not get included. any pointers will be of great help! thanks, vedanta ## configure options # './configure'

[PHP] Re: Issues with PHP 5.1.4 / GD FreeType / Linux

2006-07-31 Thread Vedanta Barooah
*solved* you will need to run a make clean, and then rebuild the whole src tree On 7/31/06, Vedanta Barooah [EMAIL PROTECTED] wrote: hello all, i am trying to compile freetype support for php 5.1.4, on linux ... looks like i have set all the compile options correct ... but some how

[PHP] link problem

2006-07-31 Thread Ross
I have lots of folders and files some are in the main public_html folder and some are in their own foder. I need to find a way to make all the links relative to the public_html folder For example if I am in the 'gallery' folder, the main index file is located at ../index, however if I om in

[PHP] dynamically generated rotating gif

2006-07-31 Thread Paul Nowosielski
Dear All, I'm trying to create a dynamically generated rotating gif. I want to add layers of text from a database to the image. Is this possible? If so , can someone give me some pointers or a link to a good class or tutorial please? Thank you, -- Paul Nowosielski Webmaster -- PHP General

[PHP] Retrieving response headers from an off-site page

2006-07-31 Thread John Gunther
I'm trying to programatically retrieve a sales tax lookup page using file_get_contents() but the page doesn't return data unless a session id is first retrieved and then supplied. You can see how it works as follows: The first time I send the following request:

Re: [PHP] Retrieving response headers from an off-site page

2006-07-31 Thread Ray Hauge
On Monday 31 July 2006 17:36, John Gunther wrote: I'm trying to programatically retrieve a sales tax lookup page using file_get_contents() but the page doesn't return data unless a session id is first retrieved and then supplied. You can see how it works as follows: The first time I send

Re: [PHP] link problem

2006-07-31 Thread Drew Butler
Try something like realpath( dirname(__FILE__).../ ); __FILE__ should give you the full path of the file being run, dirname() will break the directory path from it and ../ will drop it down one dir ... real path will give you a solid final path. ~Drew On 7/31/06, Ross [EMAIL PROTECTED] wrote:

Re: [PHP] Retrieving response headers from an off-site page

2006-07-31 Thread Andrew Kreps
On 7/31/06, Ray Hauge [EMAIL PROTECTED] wrote: On Monday 31 July 2006 17:36, John Gunther wrote: I'm trying to programatically retrieve a sales tax lookup page using file_get_contents() but the page doesn't return data unless a session id is first retrieved and then supplied. I deal with

Re: [PHP] dynamically generated rotating gif

2006-07-31 Thread Chris
Paul Nowosielski wrote: Dear All, I'm trying to create a dynamically generated rotating gif. I want to add layers of text from a database to the image. Please clarify.. do you want the image to be randomly rotated? http://www.php.net/imagerotate or do you want it to be an animated gif

Re: [PHP] Error Loading php module

2006-07-31 Thread Chris
Brad Bonkoski wrote: Any insights or tips into this? httpd: Syntax error on line 232 of /home/www/conf/httpd.conf: Cannot load /home/www/modules/libphp5.so into server: /home/www/modules/libphp5.so: undefined symbol: _pcre_ucp_findprop The pcre reference would point to this:

Re: [PHP] link problem

2006-07-31 Thread Jochem Maas
Ross wrote: I have lots of folders and files some are in the main public_html folder and some are in their own foder. I need to find a way to make all the links relative to the public_html folder For example if I am in the 'gallery' folder, the main index file is located at ../index,

[PHP] LDAP function to add objectClass

2006-07-31 Thread Roger Thomas
I have an already working LDAP server. One of my user's ldif looks like: ... ... sn: Roger Thomas givenName: Roger Thomas objectClass: top objectClass: person objectClass: inetOrgPerson objectClass: organizationalPerson objectClass: qmailUser objectClass: hordePerson o: example.com ou: people ...