hii again

sorry i ask much

but i need help and i learn

this my error massage:: Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\admin\logink.php:9) in C:\xampp\htdocs\admin\logink.php on line 24

<html>



<head>



<?php



 extract($_POST);


if (isset($_POST['userName']) && isset($_POST['password'])) 
{

        $userId = $_POST['userName'];
        $password = $_POST['password'];

        if ($userId=="XXXX" && $password =="XXXX")
        {
          header("Location:home.html");
          }

          else

          print("<p>invalid user name or passwoerd<p>");









}

?>
</head>

<body>






<!-- check if the input file is empty -->






<table align="center">
<tr>
<td>


<form name = "login" method="post"  action="logink.php" >

<lablel>
<div align="center">User name:
    <input name ="userName" type="text" size="25"/> 
    </label>
    <br />

</div>
<p align="center"><lablel>Password:
  <input name ="password" type="text" size="25"/> 
</label></p>

<p align="center">

<input type="submit" value="login"/>

</p>

</form>

</td>
</tr>
</table>



</body>

</html>

Recommended Answers

All 3 Replies

the reason you are getting this error is because all headers must be sent before anything is displayed. moving the php code to the top of the script may take care of your problem.

thank u very very much ProfessorPC

:) :)

it works now

your welcome. would you mind marking this as solved so others will know the solution is displayed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.