Re: [PHP] Sessions seems to kill db connection

2009-10-24 Thread Kim Madsen
Hi Kranthi kranthi wrote on 2009-10-24 07:27: Db error: Access denied for user 'www-data'@'localhost' (using password: NO) WTF? I´m not using a user called www-data for MySQL connections, but apache runs as this user in the case where $test is true there is an open mysql connection, but wh

[PHP] using mysql_close() = best practice?

2009-10-24 Thread Kim Madsen
Hi PHP closes an open db connection when the script is done. I've read somewhere that in PHP6 this behaviour will dissapear, is this true? In that case using mysql_close() would definetly be best practice in all current scripts, to make it portable. A nice solution would probably be adding a

Re: [PHP] How to pronounce PHP code over the phone?

2009-10-24 Thread Kim Madsen
Dotan Cohen wrote on 2009-10-23 22:40: But I think for the OP's purposes, he could simply DEFINE any word he wanted at the beginning of the conversation: "Listen up duder. When I say 'de-ref' you make hyphen and a greater-than sign. Capiche?". He could just as easily say, "Listen up duder. When I

Re: [PHP] php mail() function

2009-10-24 Thread John Black
Paul M Foster wrote: > 4. All due respect to Kranthi, but I believe he's wrong about relaying mail from your webserver to the ISP's mailserver. I believe the ISP's mailserver doesn't care, as long as the mail comes from your "pipe". You could probably call yourself "pi...@pepperoni.com" and your

Re: [PHP] How to pronounce PHP code over the phone?

2009-10-24 Thread Dotan Cohen
> There is... It's called a Fax ;-) > Again, I am interested in knowing the proper terminology for PHP constructs and code. We have a name for a small sweer green fruit from the vine, and we have a name for the alcoholic beverage that is derived from it. Knowing these names helps one communicate v

[PHP] IDE with ftp and subversion?

2009-10-24 Thread Lars Nielsen
Hi there, Can anyone recommend an IDE with both subversion and ftp integration? I have played a little with eclipse but find the integrations a little dificult to manage. Idealy I want a local development server with LAMP+svn and then an easy opportunity to publish a site to a production server.

Re: [PHP] IDE with ftp and subversion?

2009-10-24 Thread John Black
Lars Nielsen wrote: Can anyone recommend an IDE with both subversion and ftp integration? I have played a little with eclipse but find the integrations a little dificult to manage. Idealy I want a local development server with LAMP+svn and then an easy opportunity to publish a site to a productio

Re: [PHP] IDE with ftp and subversion?

2009-10-24 Thread Lars Nielsen
Hi, No I have not tryed that yet. Giving it a shot now! :-) Thanks /Lars lør, 24 10 2009 kl. 12:15 +0200, skrev John Black: > Lars Nielsen wrote: > > Can anyone recommend an IDE with both subversion and ftp integration? > > I have played a little with eclipse but find the integrations a little >

Re: [PHP] IDE with ftp and subversion?

2009-10-24 Thread Lars Nielsen
lør, 24 10 2009 kl. 12:15 +0200, skrev John Black: > Lars Nielsen wrote: > > Can anyone recommend an IDE with both subversion and ftp integration? > > I have played a little with eclipse but find the integrations a little > > dificult to manage. > > Idealy I want a local development server with LAM

[PHP] Array

2009-10-24 Thread Ron Piggott
The following line gives me an error message when there aren't any values in the array --- how do I accommodate this? Warning: Invalid argument supplied for foreach() foreach ($_SESSION['order'] AS $key => $value ) { -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: htt

Re: [PHP] Array

2009-10-24 Thread Ashley Sheridan
On Sat, 2009-10-24 at 06:57 -0400, Ron Piggott wrote: > The following line gives me an error message when there aren't any > values in the array --- how do I accommodate this? > > Warning: Invalid argument supplied for foreach() > > foreach ($_SESSION['order'] AS $key => $value ) { > > Do a

[PHP] $_SESSION variables

2009-10-24 Thread Ron Piggott
Instead of doing: $_SESSION['order'][$reference]['quantity'] = 0; Is there a way to get remove that part of the array altogether? Ron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] $_SESSION variables

2009-10-24 Thread Ashley Sheridan
On Sat, 2009-10-24 at 07:52 -0400, Ron Piggott wrote: > Instead of doing: > > $_SESSION['order'][$reference]['quantity'] = 0; > > Is there a way to get remove that part of the array altogether? > > Ron > > I don't understand your question.. Thanks, Ash http://www.ashleysheridan.co.uk

Re: [PHP] $_SESSION variables

2009-10-24 Thread Ron Piggott
I am programming a shopping cart. So far I have used $_SESSION['order'][$reference]['quantity'] = 0; if the customer changed their mind about buying an item. Is there a way to remove the session variable altogether? Ron -Original Message- From: Ashley Sheridan Reply-to: a...@ashl

Re: [PHP] $_SESSION variables

2009-10-24 Thread Phpster
Unset($_SESSION['order'][$reference]['quantity']); will clear the entire session object Bastien Sent from my iPod On Oct 24, 2009, at 8:01 AM, Ron Piggott wrote: I am programming a shopping cart. So far I have used $_SESSION['order'][$reference]['quantity'] = 0; if the customer cha

Re: [PHP] $_SESSION variables

2009-10-24 Thread Lester Caine
Ron Piggott wrote: Instead of doing: $_SESSION['order'][$reference]['quantity'] = 0; Is there a way to get remove that part of the array altogether? unset? unset($_SESSION['order'][$reference]['quantity']); Can't seem to reach php.net to confirm, but I use it myself ;) -- Lester Caine - G8H

[PHP] curl spider and being a good citizen

2009-10-24 Thread Michael A. Peters
I'm writing a custom search engine for my site, it seemed easier than modifying sphyder (what I currently use) to do what I want especially since sphyder has a lot of stuff that isn't personally of use to me. One of the things I want to do when I index is list external links and check them.

Re: [PHP] Array

2009-10-24 Thread Martin Scotta
On Sat, Oct 24, 2009 at 7:59 AM, Ashley Sheridan wrote: > On Sat, 2009-10-24 at 06:57 -0400, Ron Piggott wrote: > > > The following line gives me an error message when there aren't any > > values in the array --- how do I accommodate this? > > > > Warning: Invalid argument supplied for foreach() >

Re: [PHP] Array

2009-10-24 Thread Ron Piggott
The code I have so far for orders is below. When a product hasn't been added it does what I want it to --- in giving the message "Your shopping cart is empty". When a product is added, but then the user changes their mind I use the following lines of code to remove the selection: UNSET($_SESSION

Re: [PHP] Array

2009-10-24 Thread Ron Piggott
AHH. The count() command does the trick. Ron -Original Message- From: Ron Piggott Reply-to: ron.pigg...@actsministries.org To: Martin Scotta , phps...@gmail.com Cc: a...@ashleysheridan.co.uk, PHP General Subject: Re: [PHP] Array Date: Sat, 24 Oct 2009 11:43:12 -0400 The code I have s

Re: [PHP] Array

2009-10-24 Thread Shawn McKenzie
Ron Piggott wrote: > The code I have so far for orders is below. When a product hasn't been > added it does what I want it to --- in giving the message "Your shopping > cart is empty". When a product is added, but then the user changes > their mind I use the following lines of code to remove the

Re: [PHP] Array

2009-10-24 Thread Jim Lucas
Ron Piggott wrote: The code I have so far for orders is below. When a product hasn't been added it does what I want it to --- in giving the message "Your shopping cart is empty". When a product is added, but then the user changes their mind I use the following lines of code to remove the select

Re: [PHP] php mail() function

2009-10-24 Thread James Prentice
Thanks, John. I set up the sasl_passwd file as per your instructions but am still getting status=bounced. I'm wondering, what should the values in main.cf be for 'myhostname' and 'mydestination'? These pages give some info on the Shaw mail servers, but I'm not certain which I should be using: htt

Re: [PHP] php mail() function

2009-10-24 Thread John Black
James Prentice wrote: > Also, I notice that in the mail.log file, the 'from:' value is 'www-d...@homemade'. The actual 'from:' value is provided to the php mail() function via a web form, so should be somebody's email address (e.g. my own in this case). I think PHP will use the apache user and

Re: [PHP] php mail() function

2009-10-24 Thread James Prentice
It sends the bounced message to /var/mail/www-data and I get this: --19BE8A70109.1256417846/homemade Content-Description: Delivery report Content-Type: message/delivery-status Reporting-MTA: dns; homemade X-Postfix-Queue-ID: 19BE8A70109 X-Postfix-Sender: rfc822; www-d...@homemade Arrival-Date: Sa

Re: [PHP] php mail() function

2009-10-24 Thread Per olof Ljungmark
James Prentice wrote: It sends the bounced message to /var/mail/www-data and I get this: --19BE8A70109.1256417846/homemade Content-Description: Delivery report Content-Type: message/delivery-status Reporting-MTA: dns; homemade X-Postfix-Queue-ID: 19BE8A70109 X-Postfix-Sender: rfc822; www-d...@h

[PHP] cannot compile PHP 5.2.11 on Mac OS X 10.6.1

2009-10-24 Thread Mari Masuda
Hi, I am setting up my Mac Book Pro running Mac OS X 10.6.1 as a development environment for Drupal. I already successfully have MySQL 5.1.40 and Apache 2.2.11 up and running. I tried to compile PHP 5.2.11 in the following manner and keep getting an error. Any help would be great! 1.

[PHP] Ubuntu and Apache

2009-10-24 Thread Brian Hazelton
I know this is not quite on topic but I do not know where else to turn. I needed to reinstall ubuntu and now I cannot change myself to be the owner of var www. I had been able to change myself to the owner of it and create, delete and modify any files I wanted before I had to reinstall. Now it

Re: [PHP] Ubuntu and Apache

2009-10-24 Thread Miles Thompson
Brian, You're not doing anything wrong. Apache runs as www-data in Ubuntu, so any file created by Apache will belong to that owner:group. Add yourself to the www-data group and life will become easier. Cheers - Miles On Sat, Oct 24, 2009 at 7:42 PM, Brian Hazelton wrote: > I know this is not q

[PHP] How to Get the Sub Classes of a Parent Class

2009-10-24 Thread Raymond Irving
Hello, Does any know of an optimized solution to get all the subclasses for a parent class? __ Raymond Irving

Re: [PHP] php mail() function

2009-10-24 Thread James Prentice
I also suspect that the problem is due to the sender address, but I have tried using the shaw email address for the From: address that's given to the mail() function and it still gets bounced. It seems like the ISP should consider that address valid. On Sat, Oct 24, 2009 at 2:20 PM, Per olof Lju

Re: [PHP] php mail() function

2009-10-24 Thread James Prentice
But it seems like the 'From:' address being given to the PHP mail() function is maybe being ignored, because the error log lists 'www-d...@homemade' as being the sender, rather than listing the shaw address. The snippet from the PHP code: $email = $_POST['email']; ... mail($to, $subject, $msg, 'F