My HTML
<input type="text" name="fullname"></p>
<form name="form1" method="post" action="basic.php" ENCTYPE="x- <p><input type="submit" value="submit" name="submit">
</form>
My PHP
<?
$conn=mysql_connect("localhost", "root", "root");
mysql_select_db("sama",$conn);
$a1 = $_POST['fullname'];
echo $a1;
if ($_POST['submit'] == "submit")
{
$query = "INSERT INTO test values ('$a1')"; mysql_query($query);
}
?>
sama is by db and test is my table.
For some reason I am not able to echo the value of a1.
Upon pressing submit the db is populated but with no contents i.e the name is blank.
I am breaking my head for this simple problem.
Please help
regards
MP
<input type="text" name="fullname"></p>
<form name="form1" method="post" action="basic.php" ENCTYPE="x- <p><input type="submit" value="submit" name="submit">
</form>
My PHP
<?
$conn=mysql_connect("localhost", "root", "root");
mysql_select_db("sama",$conn);
$a1 = $_POST['fullname'];
echo $a1;
if ($_POST['submit'] == "submit")
{
$query = "INSERT INTO test values ('$a1')"; mysql_query($query);
}
?>
sama is by db and test is my table.
For some reason I am not able to echo the value of a1.
Upon pressing submit the db is populated but with no contents i.e the name is blank.
I am breaking my head for this simple problem.
Please help
regards
MP