I have been programing a php online bot with an admin panel. It mainly works good an all but my forms are double posting. So the way I have designed the form is that the user enters the data. Then clicks the submit button which sends the data to MySQL. Then anybody can view that data through a viewer I have made. The problem with this system is that when I submit the form data, the data not only goes to MySQL but the data is also posted just after the button on the php page as well. Below is the code I use for the form.
echo "<form method='post'>";
$submitinfo=$_POST['klrpomth'].$_POST['questionid'].$_POST['answer'].$_POST['matchnum'].
$_POST['keywords01'].$_POST['keywords02'].$_POST['keywords03'].$_POST['keywords04']
.$_POST['keywords05'].$_POST['keywords06'].$_POST['keywords07'].$_POST['keywords08']
.$_POST['keywords09'].$_POST['keywords10'].$_POST['keywords11'].$_POST['keywords12']
.$_POST['keywords13'].$_POST['keywords14'].$_POST['keywords15'].$_POST['keywords16']
.$_POST['botname'];
//form fields
echo "<input type='submit' value='Submit ' name='dataappend' onclick='$submitinfo'></form>";
When those variables inside $submitinfo are sent, there is an if statement that detects if they are sent and forwards the data to MySQL.
Also note that the $_POST variable can contain html codes (eg <b></b>) and it is only when html is used in the $_POST variable that the data is posted into the page.
So is there I way to both send the data to MySQL (as it already does) and for the data NOT to be posted inside the page where it can be viewed by the user. Also I would prefer not to send the variables to the url bar as there is so much in the $_POST variable.