login code not working

hello guys

i’m a new member and i need ur help
this code is working properly on localhost but not working on the internet
any one can help me please …

[php]

<?php session_start(); //================================================== // استدعاء بيانات ملف اعداد الاتصال بقاعدة البيانات include("admin/config.php"); //================================================== // استدعاء ملف البيانات العامه include("admin/setting.php"); include("Check.php"); echo $stylescript; echo $stylebody; //================================================== // اسم الصفحه $titlepage = "$schoolsname - صفحة الدخول"; //================================================== if ($action == 'trylogin') { if(($user_name_insert == "") OR ($user_password_insert == "")) { $result = mysql_query("SELECT template_content FROM school_template where template_name = '".ErrorInsertUserNameAndPassword."'"); $result_info = mysql_fetch_array($result); $ErrorInsertUserNameAndPassword = $result_info["template_content"]; $ErrorInsertUserNameAndPassword = str_replace("\"","'",$ErrorInsertUserNameAndPassword); eval("\$ErrorInsertUserNameAndPassword = \"$ErrorInsertUserNameAndPassword\";"); echo $ErrorInsertUserNameAndPassword; exit; } $result = mysql_query("SELECT * FROM school_user where user_name = '$user_name_insert'"); $result_num = mysql_num_rows($result); if ($result_num == 0) { // طباعة رساله خطأ بعدم صحة الاسم المدخل $result = mysql_query("SELECT template_content FROM school_template where template_name = '".ErrorWrongUserNameInsert."'"); $result_info = mysql_fetch_array($result); $ErrorWrongUserNameInsert = $result_info["template_content"]; $ErrorWrongUserNameInsert = str_replace("\"","'",$ErrorWrongUserNameInsert); eval("\$ErrorWrongUserNameInsert = \"$ErrorWrongUserNameInsert\";"); echo $ErrorWrongUserNameInsert; exit; } else { $result_info = mysql_fetch_array($result); $user_password = $result_info['user_password']; $user_password2 = $result_info['user_password2']; $user_group_id = $result_info['user_group_id']; $user_user_id = $result_info['user_user_id']; // التاكد من صحة الرقم السري المدخل if(($user_password_insert <> $user_password) and ($user_password_insert <> $user_password2)) { $result = mysql_query("SELECT template_content FROM school_template where template_name = '".ErrorWrongUserPasswordInsert."'"); $result_info = mysql_fetch_array($result); $ErrorWrongUserPasswordInsert = $result_info["template_content"]; $ErrorWrongUserPasswordInsert = str_replace("\"","'",$ErrorWrongUserPasswordInsert); eval("\$ErrorWrongUserPasswordInsert = \"$ErrorWrongUserPasswordInsert\";"); echo $ErrorWrongUserPasswordInsert; exit; } else { $new_value_lasttime = time(); // اذا كان الرقم السري يخص المدير if($user_group_id == 1) { // استخراج بيانات المدير $result = mysql_query("SELECT * FROM school_employee where employee_id = $user_user_id"); $result_info = mysql_fetch_array($result); $user_full_name = $result_info['employee_full_name']; $user_login_lasttime = $result_info['employee_login_lasttime']; // استدعاء صيغة وقت اخر زياره النصيه include("user_login_lasttime_text.php"); $date_to_convert = $user_login_lasttime; $sho_time=1; //include("hejri.php"); $user_login_lasttime = $date_result; // عمل تحديث لوقت اخر زياره للمدير $result = mysql_query("UPDATE school_employee SET employee_login_lasttime = '$new_value_lasttime',employee_count_login = employee_count_login+1 WHERE employee_id = $user_user_id"); } // اذا كان الرقم السري يخص المدرسين if($user_group_id == 3) { $result = mysql_query("SELECT * FROM school_employee where employee_id = $user_user_id"); $result_info = mysql_fetch_array($result); $user_full_name = $result_info['employee_full_name']; $user_login_lasttime = $result_info['employee_login_lasttime']; // استدعاء صيغة وقت اخر زياره النصيه include("user_login_lasttime_text.php"); $date_to_convert = $user_login_lasttime; $sho_time=1; //include("hejri.php"); $user_login_lasttime = $date_result; // عمل تحديث لوقت اخر زياره للمدرس $result = mysql_query("UPDATE school_employee SET employee_login_lasttime = '$new_value_lasttime',employee_count_login = employee_count_login+1 WHERE employee_id = $user_user_id"); } // اذا كان الرقم السري يخص الطالب او ولي امره if($user_group_id == 4) { if($HTTP_SESSION_VARS['S_pas_login'] == 1){$welcomepas ="ولي امر : ";} // استخراج بيانات الطالب $result = mysql_query("SELECT * FROM school_student where student_id = $user_user_id"); $result_info = mysql_fetch_array($result); $user_full_name = $welcomepas.''.$result_info['student_full_name']; $user_login_lasttime = $result_info['student_login_lasttime']; // استدعاء صيغة وقت اخر زياره النصيه include("user_login_lasttime_text.php"); $date_to_convert = $user_login_lasttime; $sho_time=1; //include("hejri.php"); $user_login_lasttime = $date_result; // معرفه من قام بالدخول .. الطالب او ولي امره if($user_password_insert == $user_password2) { $S_pas_login = 1; $S_student_login = 0; session_register("S_pas_login"); session_register("S_student_login"); // عمل تحديث لوقت اخر زياره لولي امر الطالب $result = mysql_query("UPDATE school_student SET student_login_pas_lasttime = '$new_value_lasttime',student_pas_login_count = student_pas_login_count+1 WHERE student_id = $user_user_id"); } elseif($user_password_insert == $user_password) { $S_pas_login = 0; $S_student_login = 1; session_register("S_pas_login"); session_register("S_student_login"); // عمل تحديث لوقت اخر زياره للطالب $result = mysql_query("UPDATE school_student SET student_login_lasttime = '$new_value_lasttime',student_login_count = student_login_count+1 WHERE student_id = $user_user_id"); } } $S_user_user_id = $user_user_id; session_register("S_user_user_id"); $S_user_group_id = $user_group_id; session_register("S_user_group_id"); $S_user_full_name = $user_full_name; session_register("S_user_full_name"); $S_user_login_lasttime = $user_login_lasttime; session_register("S_user_login_lasttime"); $S_user_login_lasttime_text = $user_login_lasttime_text; session_register("S_user_login_lasttime_text"); echo "

تم قبول بياناتك ... فضلا انتظر ثواني للدخول الى الموقع

"; exit(""); } } } //================================================== //################################################## // طباعة صفحة الدخول للموقع $result = mysql_query("SELECT template_content FROM school_template where template_name = '".login."'"); $result_info = mysql_fetch_array($result); $login = $result_info["template_content"]; $login = str_replace("\"","'",$login); eval("\$login = \"$login\";"); echo $login; //################################################## ?> [/php]

“Isn’t working” is very vague. What is not working ? Are you receiving errors? What are they?

the problem in redirect code.

on the localhost on my my computer working very good but on the internet not working

Just curious, but is that Arabic isn’t it?

Anyways, Trying to decipher with the info you gave and your code. I think the reason it works on the local service and the web is there is information being sent after the header has already been issued. By the way, it looks like you’re using the windows header instead of php…I think… :-[
Using php header
[php]header(“Location: index.php”);
exit();[/php]
might do the trick for you

or
enclose the information that the php code with an if statement might also do the trick.

However, without truly knowing what exactly is going on I’m guessing.

thanx for help

but the question is ? where i should put this code ?

the code stops here :
if ($action == ‘trylogin’)

Sponsor our Newsletter | Privacy Policy | Terms of Service