i suppose i should use that if i had a if statement before but i have something like this
in the index.php
<!-- BODY OF THE RIGHT PART -->
<?php
if ($login_status==1) {
echo "User: <b>$login_user</b>";
} else {
include("login.php");
}
?>
in the login.php
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#999999">
<tr>
<td bgcolor="#33B9FF"><b><font color="#FFFFFF">Login</font></b></td>
</tr>
<tr>
<form name="form1" method="post" action="index.php?pagina=login">
<td bgcolor="#FFFFFF">
<div align="center"><font size="1">User</font><font size="1">:
<input type="text" name="login" size="8">
<br>
Password:
<input type="password" name="password" size="8">
<br>
</font>
<input type="submit" name="Submit" value="Enter">
</div>
</td>
</form>
</tr>
</table>
in the login_main.php
<?php
include("BDMySQL.class.php");
include("ARUtilizador.class.php");
?>
<b>RESULT OF LOGIN</b>
<p> </p>
<?php
$user = new ARUser();
if($user->verifyUser($login, $password)==true) {
echo "Login done successfully...<br>";
$login_status = 1;
$login_user = "$login";
} else {
echo "User not registred. <br>";
}
$utilizador->endARUser();
?>
and in ARUser.class.php (this is the function called to do the login)
...........(other functions)
function verifyUser($login, $password) {
$sql = "SELECT * FROM user WHERE email LIKE '$login' AND password LIKE '$password'";
if(($rs=$this->bd->executarSQL($sql))){
if(mysql_fetch_row($rs)==false) {
return false;
} else {
return true;
}
}
else {
return false;
}
}
........(yet more functions)
how can i make a function and how can i call it and from where,
sorry i'm just messed up as i've been trying it for hours now.
thanks in advance.