oturumları ile sisteme giriş

0 Cevap php

i have created a login system with sessions in php,when used header to redirect to a particular page after checking username and password, it shows the following in firebug response "Failed to load source for: http://localhost/emp_tracker/main/edit_new.php" ,but it redirects in local system instead in server when i host it does not redirect.Is there any way to redirect other than header('Location:'.$filename);

Kod:

<?php
session_start();
include("db_connect.php");
$filename="edit-grid.php";
$myusername = mysql_real_escape_string($_REQUEST['myusername']);
$encrypted_mypassword = mysql_real_escape_string(crypt($_REQUEST['mypassword'], 'ctk'));
$check_query=mysql_query
("select * from login where u_name='$myusername' and password='$encrypted_mypassword'");
$session_value=mysql_fetch_array($check_query);
$count=mysql_num_rows($check_query);
$session_name=$session_value['u_name'];
if($count==1){$_SESSION['session_name']=$session_name;
header('Location:'.$filename);
}
?>

0 Cevap