I have a form who uses the post method:
<form method="POST" action="">
And I have an input at the end of it to submit the information typed:
<input type="submit" name="okform" value="Submit"/>
Here is PHP code I tried to execute:
<?php
$bdd = new PDO('mysql:host=127.0.0.1;dbname=pure', 'root', '');
if(isset($_POST['okform'])){
echo "yo";
}
?>
the "yo" string shows when I click on the submit button, but when I refresh my website page the string is still shown. The $_POST['okform']
variable is set even after refreshing the webpage. Why? I don't understand.
Any thoughts?