A
Anonymous
Guest
I am new to PHP, I am using it with mysql and am trying to get a basic database to work but cannot get past this one little thing. I am using a form to transfer user input from an input page, over to a page that puts the information into the database. The problem is that the info is not getting over to the second page. I have my form "post" the information and when the other page opens up the information is somehow lost or invisible to my php.
Here is what I have (basically) in my input.php page
And in my insert_info.php page I have
My info is not getting through, and I have found through the troubleshooting process that the values for $submit and $name are null. I also tried putting them through "get" rather than "post" and the info shows up in my address bar, but is not available to my php. Do I need to use a function to get these variables like http_get_vars or something? I am lost, and have little form history. Any help would be appreciated and thank you ahead of time.[/code]
Here is what I have (basically) in my input.php page
Code:
<form action=insert_info.php method=post>
<input type=text size=40 name=name>
<input type=submit name=submit value=submit>
</form>
And in my insert_info.php page I have
Code:
<?php
if ($submit== "submit")
{
$query = "insert into usertable
(name) values
('name')"
;
mysql_query($query) or
die (mysql_error());
?>
My info is not getting through, and I have found through the troubleshooting process that the values for $submit and $name are null. I also tried putting them through "get" rather than "post" and the info shows up in my address bar, but is not available to my php. Do I need to use a function to get these variables like http_get_vars or something? I am lost, and have little form history. Any help would be appreciated and thank you ahead of time.[/code]