this code
[code]//function login
function login($arrval)
{
$query = “select * from tbluser where user_email = '”.$arrval[0]."’ and user_password = ‘".$arrval[1]."’";
$rs = mysql_query($query);
if(mysql_num_rows($rs) > 0)
{
ob_start();
session_start();
$row = mysql_fetch_array($rs);
$_SESSION[‘usrid’] = $row[‘user_id’];
$_SESSION[‘usremail’] = $row[‘user_email’];
$_SESSION[‘usrname’] = $row[‘user_name’];
header(“location:main.php”);
}else
{
$error=“Invalid User name or password.”;
}
}[/code]
is locate in other directory
Problem it is i’m login with form it’s (user )info are not available(mysql database).but it not show error Why?
form.php code
[code]<?php
include"connection.php";
include"includes/classes/classsignup.php";
$objsignup = new classsignup();
$msg ="";
$arrval = array();
if(isset($_POST[‘btnadd’]))
{
$arrval[0] = $_POST[‘name’];
$arrval[1] = $_POST[‘email’];
$arrval[2] = $_POST[‘password’];
$arrval[3] = $_POST[‘mobno’];
$rs = $objsignup->signup($arrval);
if($rs == 1)
{
$message = "Dear $arrval[0],
We Welcome u in Email Moderation Engine(VU PROJECT)
";
$msg = $message;
//exit;
$to= $arrval[1]; //email address
$subject = "Email Moderation Engine";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: Administrator Email Moderation Engine\r\n" ;
mail( $to, $subject, $message, $headers);
}else
$msg= “dear sorry u cant registered”;
}
include"headerfirst.php";
include"signup.html";
?>[/code]
How to show login Error if password or user name Error