Your will need to define the fname,
Code:
sample.html
<form method="POST" action="sample.php">
<label>Firstname</label>
<input type="text" name="fname">
<input type="submit" value="Submit">
</form>
sample.php
<?php
$fname = $_POST['fname'];
if (isset($fname))
echo 'Firstname :' . ' ' . $fname;
?>
Kanang ikaduha nimo problema need na nimo i grant privileges ang user sa MySQL, in case you are using MyQSL,
Code:
GRANT SELECT, INSERT, DELETE ON db_name.* TO db_user@'localhost' IDENTIFIED BY 'db_passwd';
FLUSH PRIVILEGES;
or
GRANT ALL ON *.* TO root@'localhost' IDENTIFIED BY 'db_passwd';
FLUSH PRIVILEGES;
WHERE: *.* is equal to db_name.db_table.