For example I have a html file like below:
<html>
<form action="insert.php" method="post">
Name:<input type="text" name="txtname" />
<input type="submit" name="but" value="Submit" />
</form>
</html>
and a php file like below:
<?php
if(isset($_POST['but']))
{
mysqli_query($con,"insert into student(Name) values(".$_POST["txtname"].")");
}
?>
My question is that if I can write $name=$post['txtname']
and I use $name
in values part then dot
is not used but if I write directly post in values part then dot is used, why this dot used?