Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-23 Thread steve
Chris Shiflett wrote: >> Maybe a daft question but why would you like to check for a >> specific value? >> >> Can you give an example when this is a good thing to do? > > You might have two submit buttons, where you want to take a different > action depending upon which one the user clicks. You

Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-23 Thread Chris Shiflett
> Maybe a daft question but why would you like to check for a > specific value? > > Can you give an example when this is a good thing to do? You might have two submit buttons, where you want to take a different action depending upon which one the user clicks. Chris = Chris Shiflett - http:/

Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Dennis Seavers
were to do anything, could they not be reset easily? > [Original Message] > From: Angelo Zanetti <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Date: 11/23/2004 12:17:37 AM > Subject: Re: [PHP] $_POST['xxx'] = "blabla" ? >

Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Angelo Zanetti
I speak under correction but the reason could be that if someone tries to hack your site, for example I post to your HTML page, you want to check it your $_POST contains a certain variable (which may be hidden) Not really sure besides that >>> Perry Jönsson <[EMAIL PROTECTED]> 11/22/2004 10:5

Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Gerhard Meier
On Mon, Nov 22, 2004 at 09:55:35PM +0100, Perry Jönsson wrote: > Gerhard Meier wrote: > If you only have one form on a page, why would you like to check the > value/name of the submit button? > > Is there a security aspect to this? That was not your question. You asked what the difference is. An

Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Robin Vickery
On Mon, 22 Nov 2004 21:57:23 +0100, Perry Jönsson <[EMAIL PROTECTED]> wrote: > > Maybe a daft question but why would you like to check for a specific value? > > Can you give an example when this is a good thing to do? A forum. You have two submit buttons, one labeled 'draft' and one labeled 'final

RE: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Jay Blanchard
[snip] > One is checking if $_POST contains a specific value, the other just checks to > see if it contains a value. If $_POST['submit'] contains 'foo' is ISSET. Make > sense? Maybe a daft question but why would you like to check for a specific value? Can you give an example when this is a good

RE: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Vail, Warren
Because you can have more than one submit button per form? Warren Vail > -Original Message- > From: Perry Jönsson [mailto:[EMAIL PROTECTED] > Sent: Monday, November 22, 2004 12:56 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] $_POST['xxx'] = "blabla&

Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Perry Jönsson
Jay Blanchard wrote: [snip] What is the difference between these two examples? Both works fine for me. 1. if ($_POST['submit'] == 'Login') { ... ... } 2. if (isset($_POST['submit']) { ... ... } [/snip] One is checking if $_POST contains a specific value, the other j

Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Perry Jönsson
Gerhard Meier wrote: On Mon, Nov 22, 2004 at 09:38:00PM +0100, Perry Jönsson wrote: 1. if ($_POST['submit'] == 'Login') { ... } This one is true if $_POST['submit'] is equal to 'Login'. 2. if (isset($_POST['submit']) { ... } This one is true if $_POST['submit'] is set, it doesn't matter which va

Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Gerhard Meier
On Mon, Nov 22, 2004 at 09:38:00PM +0100, Perry Jönsson wrote: > 1. if ($_POST['submit'] == 'Login') { ... } This one is true if $_POST['submit'] is equal to 'Login'. > 2. if (isset($_POST['submit']) { ... } This one is true if $_POST['submit'] is set, it doesn't matter which value it has. /GM

Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Greg Donald
On Mon, 22 Nov 2004 21:38:00 +0100, Perry Jönsson <[EMAIL PROTECTED]> wrote: > What is the difference between these two examples? > diff 1.txt 2.txt 1c1 < 1. if ($_POST['submit'] == 'Login') { --- > 2. if (isset($_POST['submit']) { -- Greg Donald Zend Certified Engineer http://gdconsultants.com

Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread ankur_os
Dear u r correct, Both r same... but in first case ur variable with a constant string value And in second case u r checking that your variable is set or not but one limitation with the function is that.. "isset() only works with variables as passing anything else will result in a parse error."

RE: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Jay Blanchard
[snip] What is the difference between these two examples? Both works fine for me. 1. if ($_POST['submit'] == 'Login') { ... ... } 2. if (isset($_POST['submit']) { ... ... } [/snip] One is checking if $_POST contains a specific value, the other just checks to se

Re: [PHP] $_POST['xxx'] = "blabla" ?

2004-11-22 Thread Afan Pasalic
in case $_POST['submit'] == 'Yes' only 2nd example works. Right? -a|fan Perry Jönsson wrote: Hello, What is the difference between these two examples? Both works fine for me. 1. if ($_POST['submit'] == 'Login') { ... ... } 2. if (isset($_POST['submit']) { ... ... } -- PHP General M