Re: [PHP] Possible foreach bug; seeking advice to isolate the problem

2010-10-19 Thread richard gray
On 20/10/2010 05:47, Jonathan Sachs wrote: I've got a script which originally contained the following piece of code: foreach ( $objs as $obj ) { do_some_stuff($obj); } When I tested it, I found that on every iteration of the loop the last element of $objs was assigned the value of the curr

RE: [PHP] Fiscal Years and Quarters

2010-10-19 Thread admin
Is there any way to get rid of, whatever wet behind the ears person whom has this spam return for every post. mytr...@mail.ua I get 3 and 4 of these for every reply, I am sure anyone who is posting to the list gets the same emails. -Original Message- From: Don Wieland [mailto:d...@p

[PHP] Possible foreach bug; seeking advice to isolate the problem

2010-10-19 Thread Jonathan Sachs
I've got a script which originally contained the following piece of code: foreach ( $objs as $obj ) { do_some_stuff($obj); } When I tested it, I found that on every iteration of the loop the last element of $objs was assigned the value of the current element. I was able to step through the loo

RE: [PHP] Fiscal Years and Quarters

2010-10-19 Thread admin
Don If you are looking for current quarter you can do this. $tm = date('Y-m-d H:i:s'); $Current_Fiscal_Quarter = ceil(date("m", $tm)/3); This will return the quarter you are currently in. Exmaple 1, 2, 3,or 4 I have a great quarterly dates function posted on php.net http://www.php.net/manual/en

RE: [PHP] simple class & constructor

2010-10-19 Thread David McGlone
On Tue, 2010-10-19 at 20:25 -0500, Jay Blanchard wrote: > [snip] > Ye! Ha! Just as I suspected! I can now say I have a very thorough > understanding of Classes, Objects and methods. :-) > [/snip] > > May I suggest Head First OOP? They don't do PHP in it but it is very > valuable for learning about

RE: [PHP] simple class & constructor

2010-10-19 Thread David McGlone
On Tue, 2010-10-19 at 20:25 -0500, Jay Blanchard wrote: > [snip] > Ye! Ha! Just as I suspected! I can now say I have a very thorough > understanding of Classes, Objects and methods. :-) > [/snip] > > May I suggest Head First OOP? They don't do PHP in it but it is very > valuable for learning about

RE: [PHP] simple class & constructor

2010-10-19 Thread Jay Blanchard
[snip] Ye! Ha! Just as I suspected! I can now say I have a very thorough understanding of Classes, Objects and methods. :-) [/snip] May I suggest Head First OOP? They don't do PHP in it but it is very valuable for learning about things like encapsulation and some other cool words. -- PHP General

Re: [PHP] simple class & constructor

2010-10-19 Thread David McGlone
On Tue, 2010-10-19 at 17:41 -0700, David Harkness wrote: > The "constructor" is the __construct() method, and it gets executed > automatically when you instantiate the class into an object. The class > defines the state (fields/properties) and behavior (methods/functions) that > its objects will ha

RE: [PHP] simple class & constructor

2010-10-19 Thread Tommy Pham
> -Original Message- > From: David McGlone [mailto:da...@dmcentral.net] > Sent: Tuesday, October 19, 2010 5:32 PM > To: php-general@lists.php.net > Subject: RE: [PHP] simple class & constructor > > On Tue, 2010-10-19 at 16:53 -0700, Tommy Pham wrote: > > > -Original Message- > > >

Re: [PHP] simple class & constructor

2010-10-19 Thread David Harkness
The "constructor" is the __construct() method, and it gets executed automatically when you instantiate the class into an object. The class defines the state (fields/properties) and behavior (methods/functions) that its objects will have. Instantiating the class is the fancy term for creating a new

Re: [PHP] simple class & constructor

2010-10-19 Thread David McGlone
On Tue, 2010-10-19 at 17:05 -0700, David Harkness wrote: > Note that you still have a typo, but maybe it's only in your email messages: > > class simpleConstructer { > >function __construct() { > echo "running the constructor"; >} > } > $test = new simpleCo

RE: [PHP] simple class & constructor

2010-10-19 Thread David McGlone
On Tue, 2010-10-19 at 16:53 -0700, Tommy Pham wrote: > > -Original Message- > > From: David McGlone [mailto:da...@dmcentral.net] > > Sent: Tuesday, October 19, 2010 4:32 PM > > To: php-general@lists.php.net > > Subject: Re: [PHP] simple class & constructor > > > > On Tue, 2010-10-19 at 17:

Re: [PHP] simple class & constructor

2010-10-19 Thread David Harkness
Note that you still have a typo, but maybe it's only in your email messages: class simpleConstructer { function __construct() { echo "running the constructor"; } } $test = new simpleConstructor(); The class is misspelled; it should be simpleConstructor. As a

RE: [PHP] simple class & constructor

2010-10-19 Thread Tommy Pham
> -Original Message- > From: David McGlone [mailto:da...@dmcentral.net] > Sent: Tuesday, October 19, 2010 4:32 PM > To: php-general@lists.php.net > Subject: Re: [PHP] simple class & constructor > > On Tue, 2010-10-19 at 17:15 -0400, Paul M Foster wrote: > > On Tue, Oct 19, 2010 at 04:12:51

Re: [PHP] simple class & constructor

2010-10-19 Thread David McGlone
On Tue, 2010-10-19 at 17:15 -0400, Paul M Foster wrote: > On Tue, Oct 19, 2010 at 04:12:51PM -0400, David McGlone wrote: > You're trying to "instantiate the class". And the way you're doing it > here is correct. When you do this, $test becomes an object of this > class. If you had another functio

RE: [PHP] Formatting an ECHO statement.

2010-10-19 Thread Bob McConnell
From: Cris S > Someone needs to hire me now, to keep me busy and stop me > from taking this issue apart one piece at a time. Kee-rist. That's not likely to happen soon. You have demonstrated here that you are immature and have very little self-control or self-respect. There is no way you would be

[PHP] Fiscal Years and Quarters

2010-10-19 Thread Don Wieland
Hello, I have a preference field called "Fiscal_Year_Start_Month" which has the Month Names as options. Based on this value, I need to calculate the following date in UNIX: Current_1st_Quarter_Start_Date Current_1st_Quarter_End_Date Current_2nd_Quarter_Start_Date Current_2nd_Quarter_End_Date

Re: [PHP] simple class & constructor

2010-10-19 Thread Paul M Foster
On Tue, Oct 19, 2010 at 04:12:51PM -0400, David McGlone wrote: > Hi everyone, > > I've been really good at googling to find my answers, but this time my > method isn't working for me. > > I have created a very simple class and a constructor hoping to get a > much better understanding of how to w

Re: [PHP] simple class & constructor

2010-10-19 Thread chris h
Also wanted to point out that you can check the error reporting level and log file location (really all of the php's settings) by calling phpinfo(); in your code. Chris. On Tue, Oct 19, 2010 at 4:54 PM, chris h wrote: > > Can you paste the index page's code here? If the page is going b

Re: [PHP] simple class & constructor

2010-10-19 Thread chris h
Can you paste the index page's code here? If the page is going blank there's probably an error (syntax, bad file path, etc). If you have access you can turn error reporting on so you can actually see the error - or better yet check the php error log file. Settings for both of these are in the ph

[PHP] simple class & constructor

2010-10-19 Thread David McGlone
Hi everyone, I've been really good at googling to find my answers, but this time my method isn't working for me. I have created a very simple class and a constructor hoping to get a much better understanding of how to work with them. The code works, but because it's very simple, I'm not sure that

RE: [PHP] Questions from a Newbie - Please Help

2010-10-19 Thread Tommy Pham
> -Original Message- > From: Steve Staples [mailto:sstap...@mnsi.net] > Sent: Tuesday, October 19, 2010 11:51 AM > To: php-general > Subject: RE: [PHP] Questions from a Newbie - Please Help > > On Tue, 2010-10-19 at 11:18 -0700, Tommy Pham wrote: > > > -Original Message- > > > From

Re: [PHP] Sessions only work in SSL

2010-10-19 Thread Daniel Houle
On 10/19/2010 09:41 AM, Andrew Ballard wrote: On Mon, Oct 18, 2010 at 8:46 PM, Daniel Houle wrote: I have a strange issue here. I am running a CentOS machine, with apache 2.2.3 php 5.1.6 kernel 2.6.18-194.8.1.el5xen My sessions will work using https, but not using simple http. I've compared

RE: [PHP] Questions from a Newbie - Please Help

2010-10-19 Thread Steve Staples
On Tue, 2010-10-19 at 11:18 -0700, Tommy Pham wrote: > > -Original Message- > > From: Steve Staples [mailto:sstap...@mnsi.net] > > Sent: Tuesday, October 19, 2010 11:07 AM > > To: Ethan Rosenberg > > Cc: php-general@lists.php.net > > Subject: RE: [PHP] Questions from a Newbie - Please Help

Re: [PHP] PHP stream_socket_client OpenSSL error (unknown ca)

2010-10-19 Thread Richard
No I didn't have a passphrase on the local cert when I created it. I noticed that I only sent it to you and then sent the same message to the list. Thank you, Richard Le 19/10/10 20:28, Tommy Pham a écrit : -Original Message- From: Richard [mailto:php_l...@ghz.fr] Sent: Tuesday, Oc

RE: [PHP] PHP stream_socket_client OpenSSL error (unknown ca)

2010-10-19 Thread Tommy Pham
> -Original Message- > From: Richard [mailto:php_l...@ghz.fr] > Sent: Tuesday, October 19, 2010 11:22 AM > To: Tommy Pham > Subject: Re: [PHP] PHP stream_socket_client OpenSSL error (unknown ca) > > I left the pasphrase blank, I've just tried with a blank passphrase but it > doesn't help

RE: [PHP] Questions from a Newbie - Please Help

2010-10-19 Thread Tommy Pham
> -Original Message- > From: Steve Staples [mailto:sstap...@mnsi.net] > Sent: Tuesday, October 19, 2010 11:07 AM > To: Ethan Rosenberg > Cc: php-general@lists.php.net > Subject: RE: [PHP] Questions from a Newbie - Please Help > > > > i am pretty sure i read it on here already... but you

RE: [PHP] PHP stream_socket_client OpenSSL error (unknown ca)

2010-10-19 Thread Tommy Pham
> -Original Message- > From: Richard [mailto:php_l...@ghz.fr] > Sent: Tuesday, October 19, 2010 10:50 AM > To: php-general@lists.php.net > Subject: [PHP] PHP stream_socket_client OpenSSL error (unknown ca) > > Hello, > > I'm having some problems connecting to a server using the followi

RE: [PHP] Questions from a Newbie - Please Help

2010-10-19 Thread Steve Staples
i am pretty sure i read it on here already... but your PHP code looks wrong. ORIGNAL CODE: /* * Create Database test22 */ FIXED CODE: END FIXX firstly... you are missing your ending ; AFTER the " on most of your lines... and i've seen this before, where it wont throw the err

[PHP] PHP stream_socket_client OpenSSL error (unknown ca)

2010-10-19 Thread Richard
Hello, I'm having some problems connecting to a server using the following php script : stream_context_set_option($context, 'ssl', 'local_cert', './cert.pem'); stream_context_set_option($context, 'ssl', 'allow_self_signed', TRUE); stream_context_set_option($context, 'ssl', 'veri

RE: [PHP] Questions from a Newbie

2010-10-19 Thread Tommy Pham
> -Original Message- > From: Ethan Rosenberg [mailto:eth...@earthlink.net] > Sent: Tuesday, October 19, 2010 9:19 AM > To: Tommy Pham; php-general@lists.php.net > Subject: RE: [PHP] Questions from a Newbie > > Dear List - > > The error log only exists if he configures it properly and the

RE: [PHP] Questions from a Newbie - Please Help

2010-10-19 Thread Ethan Rosenberg
Dear List - I've checked the php.ini file [again] and cannot find any errors. I wrote a PHP script to open a non-existent data base, and receive no error. At this point, I am out of options. Let's all look at the code, and tell me 1]where the error is and 2]any corrections or additions to the

RE: [PHP] Questions from a Newbie

2010-10-19 Thread Ethan Rosenberg
Dear List - The error log only exists if he configures it properly and the script has error. IE: log_errors & error_log. I already had done that prior to the post. That came from the manual, the necessary section thereof which had been read. Now what? Ethan ++ At 08:31 AM 10/19

Re: [PHP] Firs Day Of Week UNIX

2010-10-19 Thread Paul M Foster
On Tue, Oct 19, 2010 at 08:14:47AM -0700, Tommy Pham wrote: > > -Original Message- > > From: Paul M Foster [mailto:pa...@quillandmouse.com] > > Sent: Tuesday, October 19, 2010 7:37 AM > > To: php-general@lists.php.net > > Subject: Re: [PHP] Firs Day Of Week UNIX > > > > On Tue, Oct 19, 201

RE: [PHP] Firs Day Of Week UNIX

2010-10-19 Thread Tommy Pham
> -Original Message- > From: Paul M Foster [mailto:pa...@quillandmouse.com] > Sent: Tuesday, October 19, 2010 7:37 AM > To: php-general@lists.php.net > Subject: Re: [PHP] Firs Day Of Week UNIX > > On Tue, Oct 19, 2010 at 07:00:55AM -0700, Don Wieland wrote: > > > Hi gang, > > > > I need a

RE: [PHP] Execute a php page and don't wait for it to finish

2010-10-19 Thread Tommy Pham
> -Original Message- > From: Sebastian Detert [mailto:php-maill...@elygor.de] > Sent: Tuesday, October 19, 2010 6:51 AM > To: Ferdi; PHP General > Subject: Re: [PHP] Execute a php page and don't wait for it to finish > > Ferdi schrieb: > > Hi List, > > > > I have a php page that updates da

Re: [PHP] Formatting an ECHO statement.

2010-10-19 Thread tedd
At 12:39 AM -0400 10/19/10, Paul M Foster wrote: On Mon, Oct 18, 2010 at 10:46:41PM -0400, Cris S wrote: -snip- (of no importance) Please go back to lurking. We'd all appreciate it, and you'll be happier. Paul -- Paul M. Foster I agree with Paul on this one. Chris S has no idea of what we

Re: [PHP] require_once

2010-10-19 Thread chris h
I see! Yes using an autoloader typically requires following a naming convention for your classes (though you can get around it by defining your own naming rules). I didn't care for it much at first, but it's nice that class names are explicit (less confusion when you have several) and not worryin

Re: [PHP] Firs Day Of Week UNIX

2010-10-19 Thread Paul M Foster
On Tue, Oct 19, 2010 at 07:00:55AM -0700, Don Wieland wrote: > Hi gang, > > I need a bailout. > > I have a fields called "sys_first_day_of_week" and the user can select > one value which will be from a menu with these options: > > Monday > Tuesday > Wednesday > Thursday > Friday > Saturday > Su

Re: [PHP] Firs Day Of Week UNIX

2010-10-19 Thread Sebastian Detert
Don Wieland schrieb: Hi gang, I need a bailout. I have a fields called "sys_first_day_of_week" and the user can select one value which will be from a menu with these options: Monday Tuesday Wednesday Thursday Friday Saturday Sunday Based on this "Preference" and TODAYS DATE, I want to calcu

[PHP] Firs Day Of Week UNIX

2010-10-19 Thread Don Wieland
Hi gang, I need a bailout. I have a fields called "sys_first_day_of_week" and the user can select one value which will be from a menu with these options: Monday Tuesday Wednesday Thursday Friday Saturday Sunday Based on this "Preference" and TODAYS DATE, I want to calculate the first day

Re: [PHP] require_once

2010-10-19 Thread jim
I am following an example. Also, doesn't that require the class name to be something like models_members? Jim On 10/19/2010 09:40 AM, chris h wrote: I'm having a problem including files using Zend Framework. I have in a controller file this Jim why not use the Zend autoloader? C

[PHP] Firs Day Of Week UNIX

2010-10-19 Thread Don Wieland
Hi gang, I need a bailout. I have a fields called "sys_first_day_of_week" and the user can select one value which will be from a menu with these options: Monday Tuesday Wednesday Thursday Friday Saturday Sunday Based on this "Preference" and TODAYS DATE, I want to calculate the first day

Re: [PHP] Execute a php page and don't wait for it to finish

2010-10-19 Thread Sebastian Detert
Ferdi schrieb: Hi List, I have a php page that updates data from one database to another when it is run. My query is, how can I trigger the execution of this update page from another php / javascript without the calling page having to wait for the update page to finish? Basically, I think the up

Re: [PHP] Execute a php page and don't wait for it to finish

2010-10-19 Thread Marc Guay
A simple AJAX script would do the trick, no? Or does the script which was triggered by JS get aborted if that page is unloaded? If javascript is unavailable you could trigger it through the tag like so: Again, not sure if it will keep running if the caller is unloaded. -- PHP General Mailin

Re: [PHP] Sessions only work in SSL

2010-10-19 Thread Andrew Ballard
On Mon, Oct 18, 2010 at 8:46 PM, Daniel Houle wrote: > I have a strange issue here.  I am running a CentOS machine, with > > apache 2.2.3 > php 5.1.6 > kernel 2.6.18-194.8.1.el5xen > > My sessions will work using https, but not using simple http.  I've compared > my configs with another identical

Re: [PHP] require_once

2010-10-19 Thread chris h
> > I'm having a problem including files using Zend Framework. I have in a > controller file this > > Jim why not use the Zend autoloader? Chris.

Re: [PHP] Execute a php page and don't wait for it to finish

2010-10-19 Thread chris h
What about simply having the script trip a flag that another background script checks every 60 seconds or so? Once a minutes a background script checks to see if it needs to preform any tasks. When a user hits a certain page it does an ajax request to trip this flag and immediately returns. The ne

Re: [PHP] Execute a php page and don't wait for it to finish

2010-10-19 Thread Steve Staples
On Tue, 2010-10-19 at 18:50 +0530, Ferdi wrote: > Hi List, > > I have a php page that updates data from one database to another when it is > run. > My query is, how can I trigger the execution of this update page from > another php / javascript without the calling page having to wait for the > upd

[PHP] Execute a php page and don't wait for it to finish

2010-10-19 Thread Ferdi
Hi List, I have a php page that updates data from one database to another when it is run. My query is, how can I trigger the execution of this update page from another php / javascript without the calling page having to wait for the update page to finish? Basically, I think the update page needs t

RE: [PHP] Questions from a Newbie

2010-10-19 Thread Tommy Pham
> -Original Message- > From: Ethan Rosenberg [mailto:eth...@earthlink.net] > Sent: Tuesday, October 19, 2010 12:05 AM > To: php-general@lists.php.net > Subject: Re: [PHP] Questions from a Newbie > > Tamara - > > Thanks. > > No error_log. > The error log only exists if he configures it

[PHP] Sessions only work in SSL

2010-10-19 Thread Daniel Houle
I have a strange issue here. I am running a CentOS machine, with apache 2.2.3 php 5.1.6 kernel 2.6.18-194.8.1.el5xen My sessions will work using https, but not using simple http. I've compared my configs with another identical machine which works with both, and I can't figure out why. Anyon

Re: [PHP] Questions from a Newbie

2010-10-19 Thread Ethan Rosenberg
Tamara - Thanks. No error_log. This works ... Ethan ++ At 02:23 AM 10/19/2010, Tamara Temple wrote: On Oct 18, 2010, at 11:01 PM, Ethan Rosenberg wrote: I've added the code you suggest, and I still get a blank screen. Should I be explicitly be using mysqli functions; eg mysqli_