Re: [PHP] cookies and carts

2009-12-07 Thread Paul M Foster
On Mon, Dec 07, 2009 at 02:39:28PM -0800, Allen McCabe wrote: > I have a shopping cart type system set up which keeps track of the cart > contents using a SESSION variable, where $_SESSION['cart'][$item_id'] is > equal to the quantity, so the name/value pair is all the information I need. > > But

Re: [PHP] Passing HTML array index to JS?

2009-12-07 Thread Philip Thompson
On Dec 7, 2009, at 6:32 PM, Skip Evans wrote: > Hey Philip, > > But will that ID value identify the right member of each array? I thought > about that but just assumed that it would not. > > Skip > > Philip Thompson wrote: >> On Dec 7, 2009, at 5:02 PM, Skip Evans wrote: >>> Hey all, >>> >>>

Re: [PHP] Live PHP Code Templates for NetBeans - accelerate your php development.

2009-12-07 Thread Raymond Irving
You can import the templates by going to Tools > Options > Code Templates then click on the "Import" button at the bottom of the window. To use the templates: 1. Create or open an HTML page 2. Enter the name name of the template then press the "Tab" key on the keyboard. Best regards, __ Raymo

Re: [PHP] Passing HTML array index to JS?

2009-12-07 Thread Skip Evans
Hey Philip, But will that ID value identify the right member of each array? I thought about that but just assumed that it would not. Skip Philip Thompson wrote: On Dec 7, 2009, at 5:02 PM, Skip Evans wrote: Hey all, I have an HTML field like this ... and what I need to do is pass to th

Re: [PHP] Passing HTML array index to JS?

2009-12-07 Thread Philip Thompson
On Dec 7, 2009, at 5:02 PM, Skip Evans wrote: > Hey all, > > I have an HTML field like this > > style="text-align: right;" onblur="calculateBidUnit();"> > > ... and what I need to do is pass to the calculateBidUnit function the value > of quantity, do a calculation on it and plug into this fi

[PHP] Passing HTML array index to JS?

2009-12-07 Thread Skip Evans
Hey all, I have an HTML field like this style="text-align: right;" onblur="calculateBidUnit();"> ... and what I need to do is pass to the calculateBidUnit function the value of quantity, do a calculation on it and plug into this field. Which of course I know how to do for non-array value

Re: [PHP] cookies and carts

2009-12-07 Thread Ashley Sheridan
On Mon, 2009-12-07 at 16:53 -0600, Philip Thompson wrote: > On Dec 7, 2009, at 4:46 PM, Ashley Sheridan wrote: > > > On Mon, 2009-12-07 at 16:48 -0600, Philip Thompson wrote: > >> > >> On Dec 7, 2009, at 4:40 PM, Ashley Sheridan wrote: > >> > >> > On Mon, 2009-12-07 at 14:39 -0800, Allen McCabe

Re: [PHP] cookies and carts

2009-12-07 Thread Philip Thompson
On Dec 7, 2009, at 4:46 PM, Ashley Sheridan wrote: > On Mon, 2009-12-07 at 16:48 -0600, Philip Thompson wrote: >> >> On Dec 7, 2009, at 4:40 PM, Ashley Sheridan wrote: >> >> > On Mon, 2009-12-07 at 14:39 -0800, Allen McCabe wrote: >> > >> >> I have a shopping cart type system set up which keeps

Re: [PHP] cookies and carts

2009-12-07 Thread Ashley Sheridan
On Mon, 2009-12-07 at 16:48 -0600, Philip Thompson wrote: > On Dec 7, 2009, at 4:40 PM, Ashley Sheridan wrote: > > > On Mon, 2009-12-07 at 14:39 -0800, Allen McCabe wrote: > > > >> I have a shopping cart type system set up which keeps track of the cart > >> contents using a SESSION variable, whe

Re: [PHP] cookies and carts

2009-12-07 Thread Philip Thompson
On Dec 7, 2009, at 4:40 PM, Ashley Sheridan wrote: > On Mon, 2009-12-07 at 14:39 -0800, Allen McCabe wrote: > >> I have a shopping cart type system set up which keeps track of the cart >> contents using a SESSION variable, where $_SESSION['cart'][$item_id'] is >> equal to the quantity, so the nam

Re: [PHP] cookies and carts

2009-12-07 Thread Philip Thompson
On Dec 7, 2009, at 4:39 PM, Allen McCabe wrote: > I have a shopping cart type system set up which keeps track of the cart > contents using a SESSION variable, where $_SESSION['cart'][$item_id'] is > equal to the quantity, so the name/value pair is all the information I need. > > But sessions are

Re: [PHP] cookies and carts

2009-12-07 Thread Ashley Sheridan
On Mon, 2009-12-07 at 14:39 -0800, Allen McCabe wrote: > I have a shopping cart type system set up which keeps track of the cart > contents using a SESSION variable, where $_SESSION['cart'][$item_id'] is > equal to the quantity, so the name/value pair is all the information I need. > > But sessio

[PHP] cookies and carts

2009-12-07 Thread Allen McCabe
I have a shopping cart type system set up which keeps track of the cart contents using a SESSION variable, where $_SESSION['cart'][$item_id'] is equal to the quantity, so the name/value pair is all the information I need. But sessions are unreliable on the free server I am currently using for this

Re: [PHP] Live PHP Code Templates for NetBeans - accelerate your php development.

2009-12-07 Thread German Geek
Hi, I would like to check this out. How do you enable these code templates in NetBeans? 2009/12/8 Raymond Irving > Hello Everyone, > > I've made a few code templates (HTML, PHP) available for everyone to > download and use with NetBeans 6.7 or higher. It will greatly > accelerate your php devel

Re: [PHP] mysterious include problem

2009-12-07 Thread LinuxManMikeC
Instead of hard coding cases you can validate and constrain the input with a regex. Much more flexible when adding content. I would also add code to make sure the file exists, otherwise fall through to the default. On Mon, Dec 7, 2009 at 1:14 PM, Kim Madsen wrote: > Hi Allen > > Allen McCabe wr

Re: [PHP] mysterious include problem

2009-12-07 Thread Ashley Sheridan
On Mon, 2009-12-07 at 21:14 +0100, Kim Madsen wrote: > Hi Allen > > Allen McCabe wrote on 2009-12-07 21:03: > > I have been using includes for my content for a while now with no problems. > > Suddenly it has stopped working, and it may or may not be from some changes > > I made in my code structu

Re: [PHP] mysterious include problem

2009-12-07 Thread Kim Madsen
Hi Allen Allen McCabe wrote on 2009-12-07 21:03: I have been using includes for my content for a while now with no problems. Suddenly it has stopped working, and it may or may not be from some changes I made in my code structure. I use default.php for most or all of my pages within a given dire

[PHP] mysterious include problem

2009-12-07 Thread Allen McCabe
I have been using includes for my content for a while now with no problems. Suddenly it has stopped working, and it may or may not be from some changes I made in my code structure. I use default.php for most or all of my pages within a given directory, changing the content via page numbers in the

Re: [PHP] logic operands problem

2009-12-07 Thread Merlin Morgenstern
Hi everybody, thank you for all the help and thoughts. I have solved it, but I guess it is not an elegant solution. What I do now, is simply check again for the second case. There are 2 cases. Either first page OR all pages, second case: following pages OR all pages. My booking checking look

Re: [PHP] logic operands problem

2009-12-07 Thread tedd
At 11:52 AM +0100 12/7/09, Merlin Morgenstern wrote: Hello everybody, I am having trouble finding a logic for following problem: Should be true if: page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 The result should never contain 1 AND 2 in the same time. This obviously

Re: [PHP] logic operands problem

2009-12-07 Thread Kim Madsen
Hey Merlin Merlin Morgenstern wrote on 2009-12-07 11:52: Hello everybody, I am having trouble finding a logic for following problem: Should be true if: page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 The result should never contain 1 AND 2 in the same time. This obvi

RE: [PHP] Re: logic operands problem

2009-12-07 Thread Ford, Mike
Um, yes, probably need to update my Oracle reference manuals – I think the big fat paper one on my shelf may even refer to ANSI SQL89, which I suspect is pretty much what my head content is based on also. In any case, XOR doesn’t appear to be in the latest ANSI/ISO SQL standards I have access to

[PHP] Live PHP Code Templates for NetBeans - accelerate your php development.

2009-12-07 Thread Raymond Irving
Hello Everyone, I've made a few code templates (HTML, PHP) available for everyone to download and use with NetBeans 6.7 or higher. It will greatly accelerate your php development. http://code.google.com/p/raxan/downloads/detail?name=code-templates.zip&can=2&q= And if your interested in further

RE: [PHP] Re: logic operands problem

2009-12-07 Thread Ashley Sheridan
On Mon, 2009-12-07 at 12:26 +, Ford, Mike wrote: > This is pretty much why SQL does not offer you the XOR operator! Someone better tell the MySQL developers then... http://dev.mysql.com/doc/refman/5.0/en/logical-operators.html Thanks, Ash http://www.ashleysheridan.co.uk

RE: [PHP] Re: logic operands problem

2009-12-07 Thread Ford, Mike
> -Original Message- > From: Merlin Morgenstern [mailto:merli...@fastmail.fm] > Sent: 07 December 2009 11:52 > To: "Sándor Tamás (HostWare Kft.)" > Cc: Merlin Morgenstern; php-general@lists.php.net > Subject: Re: [PHP] Re: logic operands problem > > > > Sándor Tamás (HostWare Kft.) wrote

Re: [PHP] logic operands problem

2009-12-07 Thread Lester Caine
Merlin Morgenstern wrote: You have described the problem very well. This is exactly where I can not find a solution. the page number translates to the following: 1= first page 2= following pages 3= all pages This are the options a user has while booking a product on my site. Now if ther is

Re: [PHP] logic operands problem

2009-12-07 Thread Ashley Sheridan
On Mon, 2009-12-07 at 12:49 +0100, Merlin Morgenstern wrote: > > Ashley Sheridan wrote: > > On Mon, 2009-12-07 at 11:52 +0100, Merlin Morgenstern wrote: > >> Hello everybody, > >> > >> I am having trouble finding a logic for following problem: > >> > >> Should be true if: > >> page = 1 OR page =

Re: [PHP] Re: logic operands problem

2009-12-07 Thread Merlin Morgenstern
Sándor Tamás (HostWare Kft.) wrote: I don't really get it. This is a select statement working with the datas of one table. A field of a record (namely "page" here) can only take one value, so it is totally nonsense to give XOR for that field. I think you want to select two different recordse

Re: [PHP] Re: logic operands problem

2009-12-07 Thread Merlin Morgenstern
Ashley Sheridan wrote: On Mon, 2009-12-07 at 12:37 +0100, Merlin Morgenstern wrote: Peter Ford wrote: > Merlin Morgenstern wrote: >> Hello everybody, >> >> I am having trouble finding a logic for following problem: >> >> Should be true if: >> page = 1 OR page = 3, but it should also be true if

Re: [PHP] logic operands problem

2009-12-07 Thread Merlin Morgenstern
Ashley Sheridan wrote: On Mon, 2009-12-07 at 11:52 +0100, Merlin Morgenstern wrote: Hello everybody, I am having trouble finding a logic for following problem: Should be true if: page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 The result should never contain 1 AND 2

Re: [PHP] Re: logic operands problem

2009-12-07 Thread HostWare Kft.
I don't really get it. This is a select statement working with the datas of one table. A field of a record (namely "page" here) can only take one value, so it is totally nonsense to give XOR for that field. I think you want to select two different recordsets: one with page 1 and 3, and another

Re: [PHP] Re: logic operands problem

2009-12-07 Thread Ashley Sheridan
On Mon, 2009-12-07 at 12:37 +0100, Merlin Morgenstern wrote: > Peter Ford wrote: > > Merlin Morgenstern wrote: > >> Hello everybody, > >> > >> I am having trouble finding a logic for following problem: > >> > >> Should be true if: > >> page = 1 OR page = 3, but it should also be true if page = 2 O

[PHP] Re: logic operands problem

2009-12-07 Thread Merlin Morgenstern
Peter Ford wrote: Merlin Morgenstern wrote: Hello everybody, I am having trouble finding a logic for following problem: Should be true if: page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 The result should never contain 1 AND 2 in the same time. This obviously does n

Re: [PHP] logic operands problem

2009-12-07 Thread Ashley Sheridan
On Mon, 2009-12-07 at 11:52 +0100, Merlin Morgenstern wrote: > Hello everybody, > > I am having trouble finding a logic for following problem: > > Should be true if: > page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 > > The result should never contain 1 AND 2 in the sam

[PHP] Re: logic operands problem

2009-12-07 Thread Peter Ford
Merlin Morgenstern wrote: > Hello everybody, > > I am having trouble finding a logic for following problem: > > Should be true if: > page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 > > The result should never contain 1 AND 2 in the same time. > > This obviously does not

[PHP] Re: logic operands problem

2009-12-07 Thread Thales Jacobi
I think you could use another braket on the second example: ((page== 1 OR page== 3) AND page!= 2) OR ((page== 2 OR page== 3) AND page != 1) Other than that I don't think I can help. How come the page can be 1 or 3, but not 2? I think you could change the logic, but I don't have enough info ab

Re: [PHP] logic operands problem

2009-12-07 Thread Merlin Morgenstern
Devendra Jadhav wrote: what do you think about this? if( ! (page == 1 && page == 2)){ //here } Well a simple && (and) does not help. I want to have all results that contain either page = 1 OR page = 3, AND in the same time I want to have the results that contain page=2 OR page= 3 , B

Re: [PHP] logic operands problem

2009-12-07 Thread Devendra Jadhav
what do you think about this? if( ! (page == 1 && page == 2)){ //here } On Mon, Dec 7, 2009 at 4:22 PM, Merlin Morgenstern wrote: > Hello everybody, > > I am having trouble finding a logic for following problem: > > Should be true if: > page = 1 OR page = 3, but it should also be true if pa

[PHP] logic operands problem

2009-12-07 Thread Merlin Morgenstern
Hello everybody, I am having trouble finding a logic for following problem: Should be true if: page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3 The result should never contain 1 AND 2 in the same time. This obviously does not work: (page = 1 OR page = 3) OR (page = 2 OR