Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Warning: Cannot modify header information

Status
Not open for further replies.

vttech

Technical User
Jan 28, 2006
297
US
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.
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top