I\'m getting undefined index errors on the $_POST variables. I.E. $_POST[\'hostname\']. I know kinda why I\'m getting them, but is there a way to keep the php and form in th
Wrap your PHP code in an if
with an isset
condition. This way, the code will only be run if the form has been submitted:
if(isset($_POST['submit']))
{
include_once("config.php");
$date = date('Y-m-d');
//Database Variables
$dbhost = strip_tags($_POST['hostname']);
$dbuser = strip_tags($_POST['dbuser']);
$dbpass = strip_tags($_POST['dbpassword']);
$submit = isset($_POST['submit']);
}