Click here to Skip to main content
15,899,475 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am getting wraning at header:



HTML
<html>
<head>
  
</head>
<body>

   // (1) Open the database connection
   $connection = mysql_connect("192.168.1.7","hari","hari");
if(!$connection)
{
die('could not connect:'.mysql_error());
}

   // (2) Select the persons database
   mysql_select_db("hari", $connection);
    $a=$_POST["name"];
    $b=$_POST["id"];

   // (3) Run the query on the persons through the connection
   $result = mysql_query ("INSERT INTO emp(name,id) VALUES('$a','$b')", $connection);
 if(TRUE){
     header("Location:http://www.test.com/form.html");
     exit();
}


   ?>

</body>
</html>
Posted
Updated 4-Oct-11 22:59pm
v2

PHP
// (3) Run the query on the persons through the connection
   $result = mysql_query ("INSERT INTO emp(name,id) VALUES('$a','$b')", $connection);
if($result==true){
      header("Location:http://www.test.com/form.html");
      exit();
}
 
Share this answer
 
Hi kesavahariprasad

<?php <br mode="hold" /?>$connection = mysql_connect("192.168.1.7","hari","hari");
if(!$connection)
{
    die('could not connect:'.mysql_error());
}else{
     mysql_select_db("hari", $connection);
     $a=$_POST["name"];
     $b=$_POST["id"];
 
     $result = mysql_query ("INSERT INTO emp(name,id) VALUES('$a','$b')",   $connection);
     if($result == true)
          header("Location:http://www.test.com/form.html");
     exit();
    }
}
?>
<html>
<head>
  
</head>
<body>
Your UI is here............
</body>
</html></html>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900