php-general Digest 11 Jan 2006 12:22:18 -0000 Issue 3899

2006-01-11 Thread php-general-digest-help
php-general Digest 11 Jan 2006 12:22:18 - Issue 3899 Topics (messages 228445 through 228465): Re: Floating numbers truncating to two digits without rounding 228445 by: Anas Mughal Re: Maps and plotting data 228446 by: Raj Shekhar Re: PHP and SOAP newbie questions

Re: [PHP] Case-Insensitive include on linux.

2006-01-11 Thread Marco Kaiser
Hi, this is very stupid because you can have files in a directory named: PleaSeINCLUDeMe.php pleaseincludeme.php and if you do a case insensitive include which one should be included? The include stuff works insensitive under windows great because the filesystem does not permit 2 file with the

Re: [PHP] Speed

2006-01-11 Thread Philip Hallstrom
Assume that I save data about an object and it has 10.000 observations of the object stored in a MySQL database. I want calculate the average value of a column, is it faster done by using PHP on the result array or using the MySQL function to do that? MySQL. You don't have to transfer all

RE: [PHP] Speed

2006-01-11 Thread Weber Sites LTD
Why not check it? Try to query for the AVG() and get the result or query for the data and do a loop in PHP to calculate the AVG. Check the time each Takes. My Money is that getting the value from SQL will be faster. Sincerely berber Visit the Weber Sites Today, To see where PHP might

RE: [PHP] Case-Insensitive include on linux.

2006-01-11 Thread George Pitcher
Mathijs wrote: Is there a way to have include() be case-insensitive? If you are know that all your file and directory names are lower case, but users may input mixed case responses that will be used to determine the include, you can set the case of the user input to lower case with

[PHP] Check how much/which variables there are in an class

2006-01-11 Thread Mathijs
Is there a way to check how much/which variables there are in an class? Thx in advanced. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Case-Insensitive include on linux.

2006-01-11 Thread Mathijs
George Pitcher wrote: Mathijs wrote: Is there a way to have include() be case-insensitive? If you are know that all your file and directory names are lower case, but users may input mixed case responses that will be used to determine the include, you can set the case of the user input to

[PHP] test variable value?

2006-01-11 Thread William Stokes
Hello What is the best way to determine if a variable has no value? if ($var= '') or if ($var= 'null') Can 'null' be used here? Thanks -Willa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] test variable value?

2006-01-11 Thread William Stokes
Hello What is the best way to determine if a variable has no value? if ($var== '') or if ($var== 'null') Can 'null' be used here? Thanks -Willa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] test variable value?

2006-01-11 Thread Jochem Maas
William Stokes wrote: Hello What is the best way to determine if a variable has no value? if ($var== '') or if ($var== 'null') Can 'null' be used here? yeah buts its a string which doesn't do what you want. if (empty($var)) { echo 'yes'; } or: if (is_null($var)) { echo 'yes'; }

Re: [PHP] test variable value?

2006-01-11 Thread Stut
William Stokes wrote: Hello What is the best way to determine if a variable has no value? if ($var== '') or if ($var== 'null') Can 'null' be used here? Depends what you mean by no value. I suggest you read http://php.net/is_null, http://php.net/empty and http://php.net/isset. -Stut

[PHP] Re: Check how much/which variables there are in an class

2006-01-11 Thread Stefan Reimers
Try array get_class_vars ( string class_name) This will return an array with at least the public variables. Mathijs wrote: Is there a way to check how much/which variables there are in an class? Thx in advanced. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] test variable value?

2006-01-11 Thread Rodolfo Andrade
How about... if (!$x){ echo x is empty; } Regards, Rodolfo Andradee - Original Message - From: Stut To: William Stokes Cc: php-general@lists.php.net Sent: Wednesday, January 11, 2006 8:08 AM Subject: Re: [PHP] test variable value? William Stokes wrote: Hello What is the

Re: [PHP] Speed

2006-01-11 Thread Rodolfo Andrade
I think calculating directly in MySQL will be faster, since less data will be travelling from MySQL to PHP. Just my 2¢. Regards, Rodolfo Andrade - Original Message - From: Weber Sites LTD To: 'Peter Lauri' ; php-general@lists.php.net Sent: Wednesday, January 11, 2006 6:07 AM Subject:

[PHP] Re: Check how much/which variables there are in an class

2006-01-11 Thread Mathijs
Stefan Reimers wrote: Try array get_class_vars ( string class_name) This will return an array with at least the public variables. Mathijs wrote: Is there a way to check how much/which variables there are in an class? Thx in advanced. It works, but only for the public indeed. Is there

[PHP] Image size?

2006-01-11 Thread William Stokes
Hello, Can I get pixel sizes from a uploaded web applicable image with PHP? I mean width and height as pixels. If so How? Thanks -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Image size?

2006-01-11 Thread Dan Parry
I would say this is what you need http://uk2.php.net/manual/en/function.getimagesize.php Dan -Original Message- From: William Stokes [mailto:[EMAIL PROTECTED] Sent: 11 January 2006 12:22 To: php-general@lists.php.net Subject: [PHP] Image size? Hello, Can I get pixel sizes from a

Re: [PHP] Image size?

2006-01-11 Thread David Grant
Will, William Stokes wrote: Can I get pixel sizes from a uploaded web applicable image with PHP? I mean width and height as pixels. If so How? http://www.php.net/getimagesize David -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

RE: [PHP] Image size?

2006-01-11 Thread Albert
William Stokes wrote: Can I get pixel sizes from a uploaded web applicable image with PHP? I mean width and height as pixels. If so How? http://www.php.net/manual/en/function.getimagesize.php HTH Albert -- No virus found in this outgoing message. Checked by AVG Free Edition. Version:

Re: [PHP] test variable value?

2006-01-11 Thread Stut
Rodolfo Andrade wrote: How about... if (!$x){ echo x is empty; } Because $x could be an empty string, 0, false, null or undefined. If that's what you need to check for then knock yourself out. -Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Image size?

2006-01-11 Thread William Stokes
Cheers! :) Albert [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED] William Stokes wrote: Can I get pixel sizes from a uploaded web applicable image with PHP? I mean width and height as pixels. If so How? http://www.php.net/manual/en/function.getimagesize.php HTH Albert --

[PHP] php .htaccess

2006-01-11 Thread enediel gonzalez
Hello I've a site with a .htaccess defined, the users have to enter the login and password to get in, Is it possible on php to ask the apache server wich user is using the current session? I'd like to give the users the oportunity to change their password but without ask again who are you.

[PHP] Re: Image size?

2006-01-11 Thread zerof
William Stokes escreveu: Hello, Can I get pixel sizes from a uploaded web applicable image with PHP? I mean width and height as pixels. If so How? Thanks -Will -- http://www.educar.pro.br/abc/mathgd/index.php?xyz=30 zerof -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] test variable value?

2006-01-11 Thread Rodolfo Andrade
I do use if(!$var) for simple application. Only _IF_ I need to know if the $var is defined but empty or so I would use especific functions. - Original Message - From: Stut To: Rodolfo Andrade Cc: William Stokes ; php-general@lists.php.net Sent: Wednesday, January 11, 2006 11:49 AM

Re: [PHP] php .htaccess

2006-01-11 Thread Robin Vickery
On 1/11/06, enediel gonzalez [EMAIL PROTECTED] wrote: Hello I've a site with a .htaccess defined, the users have to enter the login and password to get in, Is it possible on php to ask the apache server wich user is using the current session? $_SERVER['REMOTE_USER'] -robin

Re: [PHP] test variable value?

2006-01-11 Thread M. Sokolewicz
remember though that if(!$x) { echo 'nothing here'; } will also output 'nothing here' when provided with the string '0'! - tul Rodolfo Andrade wrote: I do use if(!$var) for simple application. Only _IF_ I need to know if the $var is defined but empty or so I would use especific functions.

Re: [PHP] Sending mail with php-

2006-01-11 Thread Jochem Maas
Dotan Cohen wrote: On 1/10/06, Sameer N Ingole [EMAIL PROTECTED] wrote: Dear Dotan, You know cross-posting is bad..? ... actually I don't mind it - especially as I'm not on the apache or fedora lists ;-) and with regard to sending out emails I find using a connection with an SMTP server

Re: [PHP] Sending mail with php-

2006-01-11 Thread Richard Heyes
and phpmailer - thats also be known to help me from myself (when it comes to make a pig's ear of using the mail() function) - 3 cheers for Richard Heyes (you just know a class rocks when you can actually name the author by heart! :-). Actually it's HTMLMimeMail - phpmailer is someone elses.

[PHP] Re: Image size?

2006-01-11 Thread M. Sokolewicz
zerof wrote: William Stokes escreveu: Hello, Can I get pixel sizes from a uploaded web applicable image with PHP? I mean width and height as pixels. If so How? Thanks -Will -- http://www.educar.pro.br/abc/mathgd/index.php?xyz=30 zerof what would the chance be that the OP

[PHP] Capturing the current URL when mod_rewrite is used

2006-01-11 Thread Brian Dunning
How do I capture the current displayed URL when it has been changed by mod_rewrite? Example: original (ugly) URL is http://domain.com?id=12345 displayed (friendly) URL is http://domain.com/California When I use 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'] that only gives me the

Re: [PHP] Re: Image size?

2006-01-11 Thread Warren Vail
Try; http://www.php.net/manual/en/function.getimagesize.php Warren At 09:16 AM 1/11/2006, M. Sokolewicz wrote: zerof wrote: William Stokes escreveu: Hello, Can I get pixel sizes from a uploaded web applicable image with PHP? I mean width and height as pixels. If so How? Thanks -Will

Re: [PHP] Capturing the current URL when mod_rewrite is used

2006-01-11 Thread Richard Lynch
On Wed, January 11, 2006 11:33 am, Brian Dunning wrote: How do I capture the current displayed URL when it has been changed by mod_rewrite? Example: original (ugly) URL is http://domain.com?id=12345 displayed (friendly) URL is http://domain.com/California When I use

Re: [PHP] Capturing the current URL when mod_rewrite is used

2006-01-11 Thread Brian Dunning
I think I answered my own question. The following works even when mod_rewrite has changed the URL: 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] test

2006-01-11 Thread ron
test -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] php .htaccess

2006-01-11 Thread Weber Sites LTD
You may want to check this list of Authentication related code examples : http://www.weberdev.com/search.php3?searchtype=categorycategory=Authenticat ionsecondary=IsSub=1 Sincerely berber Visit the Weber Sites Today, To see where PHP might take you tomorrow. PHP code examples :

[PHP] Reading large files via PHP?

2006-01-11 Thread Jay Paulson \(CE CEN\)
I'm reading in a 66MB file into php so I can parse it and load it into a database. However, it is taking a long time for php to read the file. So long that the script times out. I know about the ini_set(max_execution_time, 120) or whatever length I want to set the time out for the script,

[PHP] Re: Sending mail with php-

2006-01-11 Thread James Benson
You need a domain name pointing to your IP address for a start, then you either need to configure php.ini to use the correct email or you should pass the additional param to sendmail, as shown below. Taken from php.net: The additional_parameters parameter can be used to pass an additional

Re: [PHP] Reading large files via PHP?

2006-01-11 Thread Philip Hallstrom
I'm reading in a 66MB file into php so I can parse it and load it into a database. However, it is taking a long time for php to read the file. So long that the script times out. I know about the ini_set(max_execution_time, 120) or whatever length I want to set the time out for the script,

[PHP] array of checkbox values

2006-01-11 Thread Sjef Janssen
Hallo, I have a form with a number of checkboxes grouped together. The value of these boxes is stored in an array: $used[]. Now I found that the value of checked boxes (value = 'Y') are stored in the array while non checked boxes are not stored at all. This makes the array incomplete as I want to

RE: [PHP] Reading large files via PHP?

2006-01-11 Thread Jay Paulson \(CE CEN\)
I'm reading in a 66MB file into php so I can parse it and load it into a database. However, it is taking a long time for php to read the file. So long that the script times out. I know about the ini_set(max_execution_time, 120) or whatever length I want to set the time out for the

RE: [PHP] array of checkbox values

2006-01-11 Thread Jim Moseby
Hallo, I have a form with a number of checkboxes grouped together. The value of these boxes is stored in an array: $used[]. Now I found that the value of checked boxes (value = 'Y') are stored in the array while non checked boxes are not stored at all. This makes the array incomplete as

[PHP] Re: Image size?

2006-01-11 Thread zerof
what would the chance be that the OP actually knows Portuguese and could read that? --- I don't know what is the chance, but the example in this page doesn't requires to know portuguese. Sorry if you don't speak portuguese. Sorry for my poor english. zerof -- PHP General Mailing

Re: [PHP] Sending mail with php-

2006-01-11 Thread Dotan Cohen
On 1/10/06, Sameer N Ingole [EMAIL PROTECTED] wrote: Dear Dotan, Dotan Cohen wrote: On my home Fedora Core 4 box I run Apache 2.0. Sometimes when sending mail with php no mail is delivered, and I find this in the logs: 550-Verification failed for [EMAIL PROTECTED] 550-unrouteable mail

RE: [PHP] Reading large files via PHP?

2006-01-11 Thread Philip Hallstrom
I'm reading in a 66MB file into php so I can parse it and load it into a database. However, it is taking a long time for php to read the file. So long that the script times out. I know about the ini_set(max_execution_time, 120) or whatever length I want to set the time out for the script, but

Re: [PHP] Sending mail with php-

2006-01-11 Thread Dotan Cohen
On 1/11/06, Jochem Maas [EMAIL PROTECTED] wrote: actually I don't mind it - especially as I'm not on the apache or fedora lists ;-) and with regard to sending out emails I find using a connection with an SMTP server (local or not) is alot less hassle with regard to bounces and stuff (like

Re: [PHP] test variable value?

2006-01-11 Thread M. Sokolewicz
Gerry Danen wrote: On 1/11/06, M. Sokolewicz [EMAIL PROTECTED] wrote: remember though that if(!$x) { echo 'nothing here'; } will also output 'nothing here' when provided with the string '0'! That's because (!$x) means ($x == false) and '0' is false... Gerry I know that, and you know

[PHP] Re: array of checkbox values

2006-01-11 Thread David Dorward
Sjef Janssen wrote: I have a form with a number of checkboxes grouped together. The value of these boxes is stored in an array: $used[]. Now I found that the value of checked boxes (value = 'Y') are stored in the array while non checked boxes are not stored at all. This makes the array

Re: [PHP] test variable value?

2006-01-11 Thread Gerry Danen
On 1/11/06, M. Sokolewicz [EMAIL PROTECTED] wrote: remember though that if(!$x) { echo 'nothing here'; } will also output 'nothing here' when provided with the string '0'! That's because (!$x) means ($x == false) and '0' is false... Gerry

RE: [PHP] Sending mail with php-

2006-01-11 Thread Duffy, Scott E
This is what I use to send email via php. I have sent hundreds at once. $fromname=Cohen, Dotan; $fromaddress=[EMAIL PROTECTED]; $subject =Subject; $message=message body; $from= [EMAIL PROTECTED]; $headers = MIME-Version: 1.0\n; $headers .=

[PHP] Re: array of checkbox values

2006-01-11 Thread Sjef
Would it be enough to set a key for each checkbox, for example explicitly say: checkbox[1] checkbox[2] checkbox[3] then a non checked box will have an empty string as a value, whereas the checked ones will have a value of 'Y'. Sjef David Dorward [EMAIL PROTECTED] schreef in bericht

Re: [PHP] Sending mail with php-

2006-01-11 Thread Dotan Cohen
On 1/11/06, Duffy, Scott E [EMAIL PROTECTED] wrote: This is what I use to send email via php. I have sent hundreds at once. $fromname=Cohen, Dotan; $fromaddress=[EMAIL PROTECTED]; $subject =Subject; $message=message body; $from= [EMAIL PROTECTED]; $headers =

Re: [PHP] Re: array of checkbox values

2006-01-11 Thread Philip Hallstrom
Would it be enough to set a key for each checkbox, for example explicitly say: checkbox[1] checkbox[2] checkbox[3] then a non checked box will have an empty string as a value, whereas the checked ones will have a value of 'Y'. Nope. That's the problem. If a checkbox is unchecked the browser

[PHP] Re: array of checkbox values

2006-01-11 Thread James Benson
Do something like: $checkboxes = array('food','drink','smoking'); // display the checkboxes foreach($checkboxes as $checkbox) { echo $checkbox: input type=checkbox name=\$checkbox\ /; } Then when processing the form input check if each of the $checkboxes array values are present, if

[PHP] Re: Sending mail with php-

2006-01-11 Thread James Benson
alter the sendmail configuration file: /etc/mail/local-host-names If that dont work you need to setup DNS for your machine. James Benson wrote: You need a domain name pointing to your IP address for a start, then you either need to configure php.ini to use the correct email or you should

[PHP] Re: test variable value?

2006-01-11 Thread James Benson
If your talking values in submitted form data I would use: if(isset($var) trim($var) == '') { echo Please give a value; } James William Stokes wrote: Hello What is the best way to determine if a variable has no value? if ($var= '') or if ($var= 'null') Can 'null' be used

[PHP] Re: test variable value?

2006-01-11 Thread David Robley
William Stokes wrote: Hello What is the best way to determine if a variable has no value? if ($var= '') or if ($var= 'null') Can 'null' be used here? Look at isset() and empty() Cheers -- David Robley You cannot achieve the impossible without attempting the absurd. -- PHP

[PHP] Re: problem with large arrays in php 4.3.2

2006-01-11 Thread James Benson
Their should be no problem with what your trying to do, try the following function, should act pretty much like array_diff(); if(!function_exists('array_diff')) { function array_diff($array1, $array2) { $difference = array(); foreach($array1 as $key = $value)

[PHP] Re: array of checkbox values

2006-01-11 Thread Al
Sjef Janssen wrote: Hallo, I have a form with a number of checkboxes grouped together. The value of these boxes is stored in an array: $used[]. Now I found that the value of checked boxes (value = 'Y') are stored in the array while non checked boxes are not stored at all. This makes the array

[PHP] Apache2 PHP Downloadin Code

2006-01-11 Thread Ray Hauge
Hello everyone, I'm having some problems with one of our servers. Recently Plesk overwrote our configuration file, and I'm trying to get the thing back online. To make a long story short, I've got PHP working with http, but now that I've got the https virtual host set up, php doesn't work

[PHP] javascript in php page to use window.open()

2006-01-11 Thread Olga Urban
Hi everyone, I am trying to open a new window after a successful function call (I don't want to use a href. and onclick). Here's what I have, but for some reason, in IE the new window does not open (I have popup blockers disabled). It opens in Mozilla, but with the wrong size. What am I doing

[PHP] private, public, protected in 4.3.11

2006-01-11 Thread Peter Lauri
Hi, Example code that I try to run in version 4.3.11: Class Page { private $myID; function Page() { $this-myID=1; } function getID() { return $this-myID; } } But I get error

[PHP] Re: private, public, protected in 4.3.11

2006-01-11 Thread David Robley
Peter Lauri wrote: Hi, Example code that I try to run in version 4.3.11: Class Page { private $myID; function Page() { $this-myID=1; } function getID() { return $this-myID; } } But I get