[PHP3] form information into variables From: Erik Boles (erik <email protected>)
Date: 02/29/00

I didn't see this post to the group the first time so I will try again.

If I understand the PHP3 manual correctly, you can make the action of an HTML form your PHP3 script, and in your PHP3 script, simply put an $ in front of the field name from the form and insert it that way correct?

I have been playing around with this and cannot seem to get it to insert any of the info. This is a snippet of the code I am using . . .

form.html
=========

<FORM action="insert.php3" method="post">
<input type="text" name="FirstName">
<input type="text" name="LastName">
<input type="submit" name="submit" value="submit">
</form>

insert.php3
=========

<?PHP
 
require('logon.inc');
 
 $table = 'CHHmember';
  
{
$str_sql = "insert into $table
 (
 FirstName,
 LastName
 )
 values
 (
 '$FirstName'
 '$LastName'
)";
 exit();
 
}
?>

==============

I have tried this several different ways (with quotes, without quotes, etc) and never get any error messages, it acts like the records have been updated, however, when I telnet to a mysql prompt and do a SELECT * FROM CHHmember it gives me an empty set, so the records are obviously not being inserted, I just don't know why.

What am I doing wrong?

Erik