Re: [PHP] If... Else.. I'm not getting it!

2003-01-25 Thread Jason Wong
On Saturday 25 January 2003 18:27, Frank Keessen wrote:

 But when i'm using IF Else.. Nothing is happening. I'm only seeing the form
 but when i submit that form: The $vname doen't display..

 Here is the code that doesn't work:

 ?php
 $vname=$_POST['vname'];
 if($submit) {

Try some basic debugging techniques like echo ($submit). You'll see nothing, 
hence that IF clause fails.

If register_globals is not enabled then you need to use $_POST['submit'] (just 
as you had to use $_POST['vname']).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Confidence is simply that quiet, assured feeling you have before you
fall flat on your face.
-- Dr. L. Binder
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If... Else.. I'm not getting it!

2003-01-25 Thread Frank Keessen
Hi,

The register_globals = Off. Dit the basic echo ($submit) but it displays
nothing..

Any thoughts somebody??

Thanks for helping me out on this cloudy saturday (in Amsterdam!)

Regards,

Frank

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 25, 2003 11:36 AM
Subject: Re: [PHP] If... Else.. I'm not getting it!


 On Saturday 25 January 2003 18:27, Frank Keessen wrote:

  But when i'm using IF Else.. Nothing is happening. I'm only seeing the
form
  but when i submit that form: The $vname doen't display..
 
  Here is the code that doesn't work:
 
  ?php
  $vname=$_POST['vname'];
  if($submit) {

 Try some basic debugging techniques like echo ($submit). You'll see
nothing,
 hence that IF clause fails.

 If register_globals is not enabled then you need to use $_POST['submit']
(just
 as you had to use $_POST['vname']).

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 Confidence is simply that quiet, assured feeling you have before you
 fall flat on your face.
 -- Dr. L. Binder
 */


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If... Else.. I'm not getting it!

2003-01-25 Thread Johannes Schlueter
Hi,

On Saturday 25 January 2003 12:18, Frank Keessen wrote:
 The register_globals = Off. Dit the basic echo ($submit) but it displays
 nothing..

 Any thoughts somebody??

Switch on register_globals or (better!) use $_GET['submit'], $_POST['submit'] 
or $_REQUEST['submit'].

 Thanks for helping me out on this cloudy saturday (in Amsterdam!)

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If... Else.. I'm not getting it!

2003-01-25 Thread Frank Keessen
Hi,

Thanks, but i'm a kind of a newbie in PHP and what i've read it's better to
have the register_globals = Off!!! If you look at my code you see that i'm
using the $_GET variable.. This works fine!! It's the IF.. ELSE what gives
me a lot of trouble!

Frank

- Original Message -
From: Johannes Schlueter [EMAIL PROTECTED]
To: Frank Keessen [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, January 25, 2003 12:25 PM
Subject: Re: [PHP] If... Else.. I'm not getting it!


Hi,

On Saturday 25 January 2003 12:18, Frank Keessen wrote:
 The register_globals = Off. Dit the basic echo ($submit) but it displays
 nothing..

 Any thoughts somebody??

Switch on register_globals or (better!) use $_GET['submit'],
$_POST['submit']
or $_REQUEST['submit'].

 Thanks for helping me out on this cloudy saturday (in Amsterdam!)

johannes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] If... Else.. I'm not getting it!

2003-01-25 Thread Rich Gray
You are using the post method not get so $_GET[] should be empty.

Does this version of your code work?

?php
if(isset($_POST['submit'])) {
$vname=$_POST['vname'];
echo hello $vname;
} else {
?
form action=? echo ($_SERVER['PHP_SELF']); ? method=post
table
trtdInput yourname/tdtdinput type=text name=vname/td/tr
trtd colspan=2input type=submit name=submit/td/tr
/table
/form
?php
}
?

Rich
-Original Message-
From: Frank Keessen [mailto:[EMAIL PROTECTED]]
Sent: 25 January 2003 11:33
To: Johannes Schlueter; [EMAIL PROTECTED]
Subject: Re: [PHP] If... Else.. I'm not getting it!


Hi,

Thanks, but i'm a kind of a newbie in PHP and what i've read it's better to
have the register_globals = Off!!! If you look at my code you see that i'm
using the $_GET variable.. This works fine!! It's the IF.. ELSE what gives
me a lot of trouble!

Frank


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If... Else.. I'm not getting it!

2003-01-25 Thread Frank Keessen
Wow!! It worked... Sorry for the confusion about the get!!

Thanks guys, i can go further!!! Have a nice weekend!

Regards,

Frank
- Original Message -
From: Rich Gray [EMAIL PROTECTED]
To: Frank Keessen [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, January 25, 2003 12:42 PM
Subject: RE: [PHP] If... Else.. I'm not getting it!


 You are using the post method not get so $_GET[] should be empty.

 Does this version of your code work?

 ?php
 if(isset($_POST['submit'])) {
 $vname=$_POST['vname'];
 echo hello $vname;
 } else {
 ?
 form action=? echo ($_SERVER['PHP_SELF']); ? method=post
 table
 trtdInput yourname/tdtdinput type=text name=vname/td/tr
 trtd colspan=2input type=submit name=submit/td/tr
 /table
 /form
 ?php
 }
 ?

 Rich
 -Original Message-
 From: Frank Keessen [mailto:[EMAIL PROTECTED]]
 Sent: 25 January 2003 11:33
 To: Johannes Schlueter; [EMAIL PROTECTED]
 Subject: Re: [PHP] If... Else.. I'm not getting it!


 Hi,

 Thanks, but i'm a kind of a newbie in PHP and what i've read it's better
to
 have the register_globals = Off!!! If you look at my code you see that i'm
 using the $_GET variable.. This works fine!! It's the IF.. ELSE what gives
 me a lot of trouble!

 Frank


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If... Else.. I'm not getting it!

2003-01-25 Thread Jason Wong
On Saturday 25 January 2003 19:18, Frank Keessen wrote:
 Hi,

 The register_globals = Off. Dit the basic echo ($submit) but it displays
 nothing..

 Any thoughts somebody??

  If register_globals is not enabled then you need to use $_POST['submit']

 (just

  as you had to use $_POST['vname']).

!!??!!

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
In matters of principle, stand like a rock;
in matters of taste, swim with the current.
-- Thomas Jefferson
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php