php-general Digest 31 Mar 2006 16:48:25 -0000 Issue 4045

2006-03-31 Thread php-general-digest-help
reads: Warning: fopen(20060331.txt) [function.fopen]: failed to open stream: Permission denied in ... Caveat: I have found that if I explicitly destroy an instance of Log with unset(), then fopen() will work even when it is within the __destruct() method. However I don't like

Re: [PHP] Overloading Limitation- Can Someone Confirm?

2006-03-31 Thread Jochem Maas
Jasper Bryant-Greene wrote: Jochem Maas wrote: Jasper Bryant-Greene wrote: Jochem Maas wrote: I think its a misunderstanding on the one side and a limitation on the other, you can't use overloading directly on items of an overloaded array e.g: echo $tc-arr['a'] this is triggers a

Re: [PHP] HTTP status code

2006-03-31 Thread gustav
No, I'm creating remote service and it's returning codes according to passed parameters. I only wanted to test it using browsers... I do not care about the output actually, but the status code B. It seems to me, that this is more html-related. Maybe the tags in the html-document screws it

[PHP] Failing to write to a file when a class is being implicitly destroyed

2006-03-31 Thread John Wells
('log-file-name') call to within the __destruct() method. If I open a handle to the log file within the __construct() method, or any other class method, it works fine. But I receive a permissions error if it's called within __destruct(). Error reads: Warning: fopen(20060331.txt) [function.fopen

Re: [PHP] Failing to write to a file when a class is being implicitly destroyed

2006-03-31 Thread Jochem Maas
, it works fine. But I receive a permissions error if it's called within __destruct(). Error reads: Warning: fopen(20060331.txt) [function.fopen]: failed to open stream: Permission denied in ... Caveat: I have found that if I explicitly destroy an instance of Log with unset

Re: [PHP] Overloading Limitation- Can Someone Confirm?

2006-03-31 Thread Jim Lucas
Jasper Bryant-Greene wrote: Jochem Maas wrote: Jasper Bryant-Greene wrote: Jochem Maas wrote: I think its a misunderstanding on the one side and a limitation on the other, you can't use overloading directly on items of an overloaded array e.g: echo $tc-arr['a'] this is triggers a

[PHP] Going loopy with arrays.....

2006-03-31 Thread Jay Blanchard
Howdy all! Here is hoping that Friday is just another day in paradise for everyone. I have an array, a multi-dimensional array. I need to either a. loop through it and recognize when I have com upon a new sub-array so that I can do 'new' output 2. OR get each of the sub-arrays out as individual

Re: [PHP] Going loopy with arrays.....

2006-03-31 Thread Anthony Ettinger
foreach ($parent as $child) { print $parent; foreach ($child as $item) { print $child . = . $item; } } didn't test it, but this should work. On 3/31/06, Jay Blanchard [EMAIL PROTECTED] wrote: Howdy all! Here is hoping that Friday is just another day in paradise for

RE: [PHP] Going loopy with arrays.....

2006-03-31 Thread Jay Blanchard
[snip] foreach ($parent as $child) { print $parent; foreach ($child as $item) { print $child . = . $item; } } didn't test it, but this should work. [/snip] Didn't work, returns ArrayArray=ArrayArrayArray=ArrayArray=Array -- PHP General Mailing List

[PHP] Re: setting the same value to multiple variables

2006-03-31 Thread Eduardo Raúl Galván Sánchez
You could use variable variables with an array, like this: $arr = array('readingGoalsEnjoymentLabelClass','readingGoalsInformationLabelClass', 'readingGoalsAlphabeticLabelClass','readingGoalsPrintLabelClass', 'readingGoalsPhonologicalLabelClass','readingGoalsPhoneticLabelClass',

Re: [PHP] Going loopy with arrays.....

2006-03-31 Thread Anthony Ettinger
can you paste the array you're using? On 3/31/06, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] foreach ($parent as $child) { print $parent; foreach ($child as $item) { print $child . = . $item; } } didn't test it, but this should work. [/snip] Didn't work,

Re: [PHP] Re: setting the same value to multiple variables

2006-03-31 Thread Anthony Ettinger
($a, $b) = $c; On 3/31/06, Eduardo Raúl Galván Sánchez [EMAIL PROTECTED] wrote: You could use variable variables with an array, like this: $arr = array('readingGoalsEnjoymentLabelClass','readingGoalsInformationLabelClass',

Re: [PHP] XML-RPC or SOAP

2006-03-31 Thread Benjamin Adams
I want to take a mysql database that I have and turn it into a wsdl page where I can make a client program connect to. I have read how to do it in Tomcat. but looking for help in using PHP. On Mar 30, 2006, at 9:45 PM, Anthony Ettinger wrote: what about WSDL? On 3/30/06, Russell Jones

Re: [PHP] Re: setting the same value to multiple variables

2006-03-31 Thread Eduardo Raúl Galván Sánchez
Anthony Ettinger wrote: ($a, $b) = $c; ^^ I don't get the meaning of this... On 3/31/06, Eduardo Raúl Galván Sánchez [EMAIL PROTECTED] wrote: You could use variable variables with an array, like this: $arr = array('readingGoalsEnjoymentLabelClass','readingGoalsInformationLabelClass',

RE: [PHP] Going loopy with arrays.....

2006-03-31 Thread Jay Blanchard
[snip] can you paste the array you're using? [/snip] It was in the original post. Array ( [H7] = Array ( [0] = Array ( [lon] = -99.2588 [lat] = 29.1918 ) [1] = Array (

Re: [PHP] Going loopy with arrays.....

2006-03-31 Thread Anthony Ettinger
that's a dump of the arraycan you paste the source? On 3/31/06, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] can you paste the array you're using? [/snip] It was in the original post. Array ( [H7] = Array ( [0] = Array (

Re: [PHP] Re: setting the same value to multiple variables

2006-03-31 Thread Anthony Ettinger
nevermind, that doesn't work...after testing it :*( i've seen it in perlregex. On 3/31/06, Eduardo Raúl Galván Sánchez [EMAIL PROTECTED] wrote: Anthony Ettinger wrote: ($a, $b) = $c; ^^ I don't get the meaning of this... On 3/31/06, Eduardo Raúl Galván Sánchez [EMAIL PROTECTED] wrote:

RE: [PHP] Going loopy with arrays.....

2006-03-31 Thread Jay Blanchard
[snip] that's a dump of the arraycan you paste the source? [/snip] Not really. The original array was manipulated to get the point (H) groups together for the new array so that I could break the points back out together (they are not together in the original file). Here is how I got there

Re: [PHP] Going loopy with arrays.....

2006-03-31 Thread Chris Boget
a. loop through it and recognize when I have com upon a new sub-array so that I can do 'new' output 2. OR get each of the sub-arrays out as individual arrays. This might help get you going in the right direction... script language=php function print_elements( $var ) { if( is_array(

RE: [PHP] Going loopy with arrays.....

2006-03-31 Thread Jay Blanchard
[snip] a. loop through it and recognize when I have com upon a new sub-array so that I can do 'new' output 2. OR get each of the sub-arrays out as individual arrays. This might help get you going in the right direction... script language=php   function print_elements( $var ) {     if(

RE: [PHP] Going loopy with arrays.....

2006-03-31 Thread tg-php
Yeah, that foreach is outright printing the arrays (foreach $parent... print $parent?) I'm guessing you wouldn't ask this, Jay, unless there was an issue with not knowing the depth of the data. I saw something once with doing recursive function calls to dig down into an array or something.

[PHP] File Types for Upload

2006-03-31 Thread Kevin Murphy
For an expression such as this. $HTTP_POST_FILES['userfile']['type']==image/gif I'm looking for an up to date list of all the other media formats (non-images), such as Video and Audio. Does anyone have a list handy they could direct me to. -- Kevin Murphy Webmaster: Information and

RE: [PHP] Going loopy with arrays.....

2006-03-31 Thread Jay Blanchard
[snip] I'm guessing you wouldn't ask this, Jay, unless there was an issue with not knowing the depth of the data. [/snip] Exactly. I have another department that sends the data as text files and I knew that I could send them to a database and all would be well, or relatively so. But that adds a

[PHP] Re: File Types for Upload

2006-03-31 Thread Eduardo Raúl Galván Sánchez
IANA has the most updated oficial MIME types: http://www.iana.org/assignments/media-types/ Kevin Murphy escribió: For an expression such as this. $HTTP_POST_FILES['userfile']['type']==image/gif I'm looking for an up to date list of all the other media formats (non-images), such as Video

Re: [PHP] Going loopy with arrays.....

2006-03-31 Thread tg-php
Yeah.. or something like this! (Chris' looks better than mine.. maybe his brain's working at 70% today :) -TG = = = Original message = = = a. loop through it and recognize when I have com upon a new sub-array so that I can do 'new' output 2. OR get each of the sub-arrays out as individual

RE: [PHP] Going loopy with arrays.....

2006-03-31 Thread tg-php
If you need to backtrack from the lat/long to the H key, why not build a reverse lookup array? $arr[$lat . : . $long] = $hvalue; ? -TG = = = Original message = = = [snip] a. loop through it and recognize when I have com upon a new sub-array so that I can do 'new' output 2. OR get each of

[PHP] Image resizing problems

2006-03-31 Thread John Nichel
I'm pulling my hair out with this gd resizing of an image, and can't figure out where it's screwing up. I've been trying to batch process about 500 images to resize them to a standard size, and for some reason, instead of resizing the image, it's just taking a corner of the original image...

[PHP] Re: Image resizing problems

2006-03-31 Thread Eduardo Raúl Galván Sánchez
Have you tried imagecopy resized()? John Nichel escribió: I'm pulling my hair out with this gd resizing of an image, and can't figure out where it's screwing up. I've been trying to batch process about 500 images to resize them to a standard size, and for some reason, instead of resizing the

Re: [PHP] Image resizing problems

2006-03-31 Thread deKeijzer
on http://nl2.php.net/manual/en/function.imagecopyresampled.php is an example how to use it when you are resizing images, I think you are putting some numbers on the wrong place On 3/31/06, John Nichel [EMAIL PROTECTED] wrote: I'm pulling my hair out with this gd resizing of an image, and can't

Re: [PHP] Re: Image resizing problems

2006-03-31 Thread John Nichel
Eduardo Raúl Galván Sánchez wrote: Have you tried imagecopy resized()? Same results with that. I'm using imagecopyresampled to keep the quality as high as possible. John Nichel escribió: I'm pulling my hair out with this gd resizing of an image, and can't figure out where it's screwing

Re: [PHP] Image resizing problems [SOLVED]

2006-03-31 Thread John Nichel
John Nichel wrote: I'm pulling my hair out with this gd resizing of an image, and can't figure out where it's screwing up. I've been trying to batch process about 500 images to resize them to a standard size, and for some reason, instead of resizing the image, it's just taking a corner of the

[PHP] Database Connections (cont..)

2006-03-31 Thread Ryan A
Hey all, Ok, spoke to the boss and he has agreed for me to give you the following info; Heres what the app does: - Clients add their sites in their client control panel which we give them at our site - Client installs our script on his server, every time someone logs in their username is sent to

[PHP] MySQL close connection, what's the purpose?

2006-03-31 Thread Martin Zvarík
Hi, I was wondering why is it necessary to use mysql_close() at the end of your script. If you don't do it, it works anyways, doesn't it? MZ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MySQL close connection, what's the purpose?

2006-03-31 Thread Richard Lynch
On Fri, March 31, 2006 2:30 pm, Martin Zvarík wrote: I was wondering why is it necessary to use mysql_close() at the end of your script. If you don't do it, it works anyways, doesn't it? Yes, but... Suppose you write a script to read data from one MySQL server, and then insert it into

Re: [PHP] MySQL close connection, what's the purpose?

2006-03-31 Thread Martin Zvarík
Richard Lynch wrote: On Fri, March 31, 2006 2:30 pm, Martin Zvarík wrote: I was wondering why is it necessary to use mysql_close() at the end of your script. If you don't do it, it works anyways, doesn't it? Yes, but... Suppose you write a script to read data from one MySQL

Re: [PHP] MySQL close connection, what's the purpose?

2006-03-31 Thread Anthony Ettinger
On 3/31/06, Martin Zvarík [EMAIL PROTECTED] wrote: Richard Lynch wrote: On Fri, March 31, 2006 2:30 pm, Martin Zvarík wrote: I was wondering why is it necessary to use mysql_close() at the end of your script. If you don't do it, it works anyways, doesn't it? Yes, but...

[PHP] Re: Database Connections (cont..)

2006-03-31 Thread Eduardo Raúl Galván Sánchez
I don't see a problem with that. My only suggestion is to have one table for each site, in order to avoid usernames of one site to colide with usernames from another site. Ryan A escribió: Hey all, Ok, spoke to the boss and he has agreed for me to give you the following info; Heres what the

Re: [PHP] MySQL close connection, what's the purpose?

2006-03-31 Thread tedd
At 10:30 PM +0200 3/31/06, Martin Zvarík wrote: Hi, I was wondering why is it necessary to use mysql_close() at the end of your script. If you don't do it, it works anyways, doesn't it? MZ MZ: I always close the connection right after my query -- force of habit. It's like leaving the

Re: [PHP] Overloading Limitation- Can Someone Confirm?

2006-03-31 Thread Jasper Bryant-Greene
Jim Lucas wrote: Jasper Bryant-Greene wrote: Jochem Maas wrote: [snip] you guess wrong :-) .. I couldn't resist testing it: php -r ' class T { private $var = array(); function __set($k, $v) { $this-var[$k] = $v; } function __get($k) { var_dump($k); } } $t = new T; $t-arr = array();

Re: [PHP] MySQL close connection, what's the purpose?

2006-03-31 Thread chris smith
On 4/1/06, tedd [EMAIL PROTECTED] wrote: At 10:30 PM +0200 3/31/06, Martin Zvarík wrote: Hi, I was wondering why is it necessary to use mysql_close() at the end of your script. If you don't do it, it works anyways, doesn't it? MZ MZ: I always close the connection right after my

Re: [PHP] MySQL close connection, what's the purpose?

2006-03-31 Thread Anthony Ettinger
On 3/31/06, chris smith [EMAIL PROTECTED] wrote: On 4/1/06, tedd [EMAIL PROTECTED] wrote: At 10:30 PM +0200 3/31/06, Martin Zvarík wrote: Hi, I was wondering why is it necessary to use mysql_close() at the end of your script. If you don't do it, it works anyways, doesn't it? MZ

[PHP] Re: Database Connections (cont..)

2006-03-31 Thread chris smith
On 4/1/06, Ryan A [EMAIL PROTECTED] wrote: Hey all, Ok, spoke to the boss and he has agreed for me to give you the following info; Heres what the app does: - Clients add their sites in their client control panel which we give them at our site - Client installs our script on his server,

Re: [PHP] MySQL close connection, what's the purpose?

2006-03-31 Thread chris smith
On 4/1/06, Anthony Ettinger [EMAIL PROTECTED] wrote: On 3/31/06, chris smith [EMAIL PROTECTED] wrote: On 4/1/06, tedd [EMAIL PROTECTED] wrote: At 10:30 PM +0200 3/31/06, Martin Zvarík wrote: Hi, I was wondering why is it necessary to use mysql_close() at the end of your script.

Re: [PHP] Database connections

2006-03-31 Thread Jim Lucas
Chris wrote: Jasper Bryant-Greene wrote: Chris wrote: If they're accessing the same database you don't need to disconnect/reconnect. Different db's - well, yeh you don't have a choice. Of course you do. mysql_select_db() or whatever it's called. Or just issue a USE [databasename] query.

Re: [PHP] Database connections

2006-03-31 Thread chris smith
On 4/1/06, Jim Lucas [EMAIL PROTECTED] wrote: Chris wrote: Jasper Bryant-Greene wrote: Chris wrote: If they're accessing the same database you don't need to disconnect/reconnect. Different db's - well, yeh you don't have a choice. Of course you do. mysql_select_db() or whatever

Re: [PHP] Overloading Limitation- Can Someone Confirm?

2006-03-31 Thread Jochem Maas
could you both take a look at this (I posted it already btw) - notice that the second 'set' action ($t-insideArray[test] = testing!;) is not going via __set() at all, it uses __get() BUT/AND then an item is set in the returned array ... and also in the [sub] array stored inside the object (even

Re: [PHP] Going loopy with arrays.....

2006-03-31 Thread Jim Lucas
Jay Blanchard wrote: Howdy all! Here is hoping that Friday is just another day in paradise for everyone. I have an array, a multi-dimensional array. I need to either a. loop through it and recognize when I have com upon a new sub-array so that I can do 'new' output 2. OR get each of the

[PHP] CakePHP Undefined variable

2006-03-31 Thread Pham Huu Le Quoc Phuc
Hi everyone! I use CakePHP. I found an error. Could you help me to deal this error. Notice: Undefined variable: missing in c:\Inetpub\wwwroot\Cake\app\views\errors\missing_controller.php on line 18 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] How to debug in CakePHP.

2006-03-31 Thread Pham Huu Le Quoc Phuc
Hi everybody! I use cake, I have an error, but I can't find where the error occurs. Have any tools for debug? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] CakePHP Undefined variable

2006-03-31 Thread chris smith
On 4/1/06, Pham Huu Le Quoc Phuc [EMAIL PROTECTED] wrote: Hi everyone! I use CakePHP. I found an error. Could you help me to deal this error. Notice: Undefined variable: missing in c:\Inetpub\wwwroot\Cake\app\views\errors\missing_controller.php on line 18 You're trying to use a variable that

Re: [PHP] How to debug in CakePHP.

2006-03-31 Thread chris smith
Hi everybody! I use cake, I have an error, but I can't find where the error occurs. Have any tools for debug? Set up an error log. Edit your php.ini file and set: log_errors = On error_log = /path/to/logfile.log then errors will get put in the logfile and you'll be able to track them down.

[PHP] preg_match

2006-03-31 Thread Benjamin D Adams
I'm trying to check a string for ../ ?php if(preg_match(/..//i, $string)){ echo string has ../; } ? Can't get it to work can anyone help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] preg_match

2006-03-31 Thread Jasper Bryant-Greene
Benjamin D Adams wrote: I'm trying to check a string for ../ ?php if(preg_match(/..//i, $string)){ echo string has ../; } ? Can't get it to work can anyone help? That's terrible overkill. Regex is not designed for simple substring matching. You want: if(

Re: [PHP] How to debug in CakePHP.

2006-03-31 Thread John Nichel
chris smith wrote: Hi everybody! I use cake, I have an error, but I can't find where the error occurs. Have any tools for debug? Set up an error log. Edit your php.ini file and set: log_errors = On error_log = /path/to/logfile.log then errors will get put in the logfile and you'll be able

Re: [PHP] preg_match

2006-03-31 Thread chris smith
On 4/1/06, Benjamin D Adams [EMAIL PROTECTED] wrote: I'm trying to check a string for ../ ?php if(preg_match(/..//i, $string)){ echo string has ../; } ? Can't get it to work can anyone help? Since / is your delimiter you need to escape it. Also '.' means

Re: [PHP] Overloading Limitation- Can Someone Confirm?

2006-03-31 Thread Jochem Maas
Chr is wrote: You're right, it's not going through the __Set() method a second time. If you REALLY want to get confused by overloading behavior try the following code using your T class: $t = new T; $t-insideArray = array('a' = 'A', 'b' = 'B', 'c' = 'C'); foreach ($t-insideArray as $k