I created a simple php script to create a database and then redirect the user back
to the original page after display a message that the database was created.
I get the following message
Warning: Cannot modify header information - headers already sent by
Newbie in search of knowledge
to the original page after display a message that the database was created.
Code:
<?php
$sql = "CREATE database ".$_POST['db_name'];
$connection = mysql_connect('localhost', 'root', '')
or die(mysql_error());
$result = mysql_query($sql, $connection);
if($result) {
$msg = "Database ".$_POST['db_name']." created!";
}
?>
<html>
<head>
<title></title>
<head>
<body>
<?php echo $msg;
header("Location: MYSQL_ADMIN.htm"); ?>
<body>
</html>
I get the following message
Warning: Cannot modify header information - headers already sent by
Newbie in search of knowledge