A post variable is not in the User Agent, thats a string to identify the browser ;)
When you refresh the page after a submit, the browser (at least chrome) asks you if you want to resubmit the post data and then does the exact same request again including your post data.
If you really want to work arround this (and you can't check if the user is logged in or something like this) use a session variable:
<?php
session_start(); // call this at the top of your document
if ($_POST['userReg'] == "1" && !isset($_SESSION["reg"])) {
$_SESSION["reg"] = true;
// process the form, e.g check if userid already in database, etc etc.....
}
?>
A redirect may also work:
<?php
// this must be at the top of your document
if ($_POST['userReg'] == "1") {
// process the form, e.g check if userid already in database, etc etc.....
header("Location: index.php?registration=".$status);
// use if($_GET["registration"] == "...") to give feedback
// close db connection etc
die(); // and exit, the user is redirected
}
?>