[PHP] value passing from html form to php variable.

2002-06-01 Thread Wei Wang
I am not sure if this is the right place to ask this naive question. I got a simple form addform.html and add.php look like the following. But everytime I got empty value from firstname and lastname. It seems like the input value in the html page was not passed on to the php variable $firstname

Re: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 4:51:20 PM, you wrote: I got a simple form addform.html and add.php look like the following. But everytime I got empty value from firstname and lastname. It seems like the input value in the html page was not passed on to the php variable $firstname in add.php.

Re: [PHP] value passing from html form to php variable.

2002-06-01 Thread Wei Wang
Do you mind telling me where this php.ini is? And I tried the second attempt like this: $query = INSERT INTO friends (id, firstname, surname) values (nextval('friends_id_seq'), $_POST['firstname'], $_POST['surname']); which returns error: Parse error: parse error, unexpected

Re: [PHP] value passing from html form to php variable.

2002-06-01 Thread Philip Olson
Some thoughts: a) Why is $firstname empty? It's empty because the PHP directive register_globals = off. So, PHP will not create $firstname automatically. This is most likely the cause. b) How do I access $firstname with register_globals = off then? Many ways. Regardless of

Re: [PHP] value passing from html form to php variable.

2002-06-01 Thread Philip Olson
$query = INSERT INTO friends (id, firstname, surname) values (nextval('friends_id_seq'), $_POST['firstname'], $_POST['surname']); which returns error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in

Re[2]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 5:00:18 PM, you wrote: Do you mind telling me where this php.ini is? Create a php script containing just ?php phpinfo(); ?. That page will tell you where your php.ini is (or should be). And I tried the second attempt like this: $query = INSERT INTO friends (id,

Re: Re[2]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Wei Wang
Create a php script containing just ?php phpinfo(); ?. That page will tell you where your php.ini is (or should be). it told me it's in php/lib, but it's not there. Try this... $query = INSERT INTO friends (id, firstname, surname) values (nextval('friends_id_seq'),

Re: Re[2]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Wei Wang
Sorry. When I input Andras as firstname in the form, ... On Sat, 1 Jun 2002 17:22:02 +0100 [EMAIL PROTECTED] (Wei Wang) wrote: Create a php script containing just ?php phpinfo(); ?. That page will tell you where your php.ini is (or should be). it told me it's in php/lib, but it's

Re[4]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 5:22:02 PM, you wrote: Create a php script containing just ?php phpinfo(); ?. That page will tell you where your php.ini is (or should be). it told me it's in php/lib, but it's not there. The default php.ini is called php.ini-recommended and will be in the

Re: Re[2]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Wei Wang
Is there anything I should do to make the php.ini come into effect? I did put the register_global = On but still got empty values. And my $_POST version is like this: ?php $db = pg_connect(dbname=friends); $query = INSERT INTO friends (id, firstname, surname) values

Re: Re[4]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Wei Wang
Sorry. I restared apache and php.ini came into effect. On Sat, 1 Jun 2002 17:29:13 +0100 [EMAIL PROTECTED] (Stuart Dallas) wrote: On Saturday, June 1, 2002 at 5:22:02 PM, you wrote: Create a php script containing just ?php phpinfo(); ?. That page will tell you where your php.ini is (or

Re[4]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 5:35:03 PM, you wrote: Is there anything I should do to make the php.ini come into effect? I did put the register_global = On but still got empty values. you may not need to do anything or you may need to restart your http server. Have a look at your phpinfo()

Re[6]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 5:37:37 PM, you wrote: Sorry. I restared apache and php.ini came into effect. If you're going to run with register_globals on you should make sure you understand the implications: http://www.php.net/manual/en/security.registerglobals.php. -- Stuart -- PHP

Re: Re[4]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Wei Wang
Changed the query and get this error when input dave as firstname: ERRORERROR: Attribute 'dave' not found add2.php is: html body ?php $db = pg_connect(dbname=friends); $query = INSERT INTO friends (id, firstname, surname) values (nextval('friends_id_seq'), .$_POST['firstname'].,

Re[6]: [PHP] value passing from html form to php variable.

2002-06-01 Thread Stuart Dallas
On Saturday, June 1, 2002 at 6:00:22 PM, you wrote: $query = INSERT INTO friends (id, firstname, surname) values (nextval('friends_id_seq'), .$_POST['firstname']., .$_POST['surname'].); It's so obvious you're gonna kick yourself (I did!). You need to enclose the two values in quotes, like