I have developed one in which I tried to have require_once and cookie . but I got error of header . So is is possible to have both in one file
[code=php]
/ require_once(‘include/connect.php’);
if ($_POST[‘submit’]) {
//***** This is the code I had in connect.php which I move to main file
$hostUrl = ‘localhost’;
$username = ‘root’;
$password = ”;
//****************************************
$connectID = mysql_connect ($hostUrl, $username , $password)
or die (“Unable to connect to the Server”);
$username = $_POST[‘UNAME’];
$password_t = $_POST[‘PASSWORD1’];
//Establishing the connection to the table
mysql_select_db (“ticketing”, $connectID) or
die (“Unable to Fetch Record(s) From the Database”);
//Selecting record(s) based on the parameters passed
$result = mysql_query(“SELECT * FROM userinfo WHERE Uname = ‘$username’ AND Password = ‘$password_t'”,$connectID)
or die (“Unable to Authenticate the User “);
$num_rows = mysql_num_rows($result);
if ($num_rows >0 )
{
$AD_PERM = false; //This is Admin Permission
$FC_PERM = false; //Full Permission given
$ans = mysql_fetch_array($result, MYSQL_ASSOC);
if ($ans[‘Admin_AC’] == true) {
$AD_PERM= true;
$FC_PERM = false;
setcookie (“Admin”);
header (‘Location:recp.php’);
}
if ($ans[‘Full_AC’] == true) {
$AD_PERM = false;
$FC_PERM = true;
setcookie(“Full”);
}
}
if($num_rows < 1)
{
?>
<style>
a:hover {background: #836FFF ;color:#FFFF00; text-decoration:none}
</style>
<table>
<tr>
<td width = “400”> </td>
<td>
<table>
<tr>
<td style = “font:verdana; font-size:125%”>Invalid Login Credentials ..!! </td>
</tr>
<tr>
<td> <a href = “Main.html”>Click to Retun to Login Page… </a></td>
</tr>
</table>
</td></tr>
</table>
<?php
}
}
?>
Can you guide me.