Im writing this code in PHP and after i click Submit I want the values to be saved in the texbox. first time when I open the page I see some errors inside textfild?How can i fix this ?
<html>
<body>
<form action="" method="GET">
First number<input type="text" name="num1" placeholder="<?php echo $_GET['num1'] ; }?>"/>
Second number<input type="text" name="num2" placeholder="<?php echo $_GET['num2'] ; ?>"/>
<input type="submit" name="submit" value="Submit"/>
</form>
<?php
if(isset($_POST['submit']))
{
$num1=$_GET['num1'];
$num1=$_GET['num2'];
$sum=($num1+$num2);
echo "Sum is :<input type='text' value='$sum'/>";
}
?>
</body>
</html>