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, 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 
/local/scratch-1/ww220/Apache1.3/htdocs/test/add2.php on line 5

Try this...

$query = INSERT INTO friends (id, firstname, surname) values
(nextval('friends_id_seq'), .$_POST['firstname']., .$_POST['surname'].);

-- 
Stuart


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




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'), .$_POST['firstname']., .$_POST['surname'].);

When I input Wei for firstname and Wang for surname in the form and submit,
I got error:

Warning: pg_exec() query failed: ERROR: Attribute 'andras' not found in 
/local/scratch-1/ww220/Apache1.3/htdocs/test/add2.php on line 6
ERRORERROR: Attribute 'andras' not found


ps. Philip, Great thanks for your detailed help. I still couldn't figure out how
to access $firstname. And I couldn't find php.ini, which should be the most
straightforward way to solve this.

 
 -- 
 Stuart
 

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




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 not there.
  
  Try this...
  
  $query = INSERT INTO friends (id, firstname, surname) values
  (nextval('friends_id_seq'), .$_POST['firstname']., .$_POST['surname'].);
 
 When I input Wei for firstname and Wang for surname in the form and submit,
 I got error:
 
 Warning: pg_exec() query failed: ERROR: Attribute 'andras' not found in 
/local/scratch-1/ww220/Apache1.3/htdocs/test/add2.php on line 6
 ERRORERROR: Attribute 'andras' not found
 
 
 ps. Philip, Great thanks for your detailed help. I still couldn't figure out how
 to access $firstname. And I couldn't find php.ini, which should be the most
 straightforward way to solve this.
 
  
  -- 
  Stuart
  

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




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 
(nextval('friends_id_seq'), $_POST['firstname'], $_POST['surname']);
$result = pg_exec($db, $query);
if (!$result) {
printf (ERROR);
$errormessage = pg_errormessage($db);
echo $errormessage;
exit;
}
printf (These values were inserted into the database - %s %s, $firstname, $surname);
pg_close();
?
/body
/html

On Sat, 1 Jun 2002 17:08:11 +0100
[EMAIL PROTECTED] (Stuart Dallas) wrote:

 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, 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 
/local/scratch-1/ww220/Apache1.3/htdocs/test/add2.php on line 5
 
 Try this...
 
 $query = INSERT INTO friends (id, firstname, surname) values
 (nextval('friends_id_seq'), .$_POST['firstname']., .$_POST['surname'].);
 
 -- 
 Stuart
 

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