הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   בעיה בקוד (https://hosts.co.il/forums/showthread.php?t=100336)

Agam Levi 09-10-12 16:15

בעיה בקוד
 
PHP קוד:

$do=$_GET['do'];
if (
$do == login) {
if(
$_SESSION['logined5'] != md5(md5($login['password']))){
    if (isset(
$_POST['dologin']) && $_POST['username'] != "" ){
        
$query mysql_query("SELECT * FROM `buildp_users` WHERE `id`");
        
$status 0;
        while(
$login mysql_fetch_assoc($query)){
            
$sqlpass $login['password'];
            
$postpass md5($_POST['password']);
            if (!
strcmp($login['username'],$_POST['username']) && !strcmp($sqlpass,$postpass)){
    
$status 1;
    
$_SESSION['logined175'] = $login['password'];
    
$userlog $login['username'];
            }else{
                
$error ' <div class="center"> <font color="red">Username or Password Are Incorrect.</div></font>';
            }
        }
        if (
$status == 1){
               
$_SESSION['logined175'] = md5(md5($login['password']));
                
$_SESSION['username'] = $_POST['username'];
            
$meta '<meta http-equiv="refresh" content="0"; URL="panel.php" />';
                echo 
"{$meta}";    

            }  
                      
    } 

המערכת אמורה לבצע התחברות ולהעביר את הגולש לעמוד panel.php . משום מה היא לא מעבירה לפאנל.

אשמח לעזרה בדחיפות.

Ori The Man 09-10-12 18:24

לא עברתי על כל הקוד
אבל למה אתה משתמש ב meta? תשתמש ב header כדי להעביר עמוד, ובדקת שהוא מגיע לתנאי של ההעברה? במקום ה $meta תרשום נגיד 1 תראה אם הוא מציג לך את הפלט

BuildDream 09-10-12 18:45

התג מטא כתוב לא נכון, סגרת את המאפיין Content מיד אחרי ה0, ועוד פעם אחרי הurl, הנה התיקון:

PHP קוד:

<meta http-equiv="refresh" content="0;url=panel.php" />; 

בכל מקרה עדיף לך להשתמש בheaders ולא במטא, יותר יעיל

Agam Levi 09-10-12 19:26

תוכלו להראות לי כיצד אני מחליף עמוד בעזרת Header ?

Ori The Man 09-10-12 19:29

PHP קוד:

header("Location: page.php"); 


Agam Levi 09-10-12 19:39

PHP קוד:

['do'];
if (
$do == login) {
if(
$_SESSION['logined5'] != md5(md5($login['password']))){
    if (isset(
$_POST['dologin']) && $_POST['username'] != "" ){
        
$query mysql_query("SELECT * FROM `buildp_users` WHERE `id`");
        
$status 0;
        while(
$login mysql_fetch_assoc($query)){
            
$sqlpass $login['password'];
            
$postpass md5($_POST['password']);
            if (!
strcmp($login['username'],$_POST['username']) && !strcmp($sqlpass,$postpass)){
    
$status 1;
    
$_SESSION['logined175'] = $login['password'];
    
$userlog $login['username'];
            }else{
                
$error ' <div class="center"> <font color="red">Username or Password Are Incorrect.</div></font>';
            }
        }
        if (
$status == 1){
               
$_SESSION['logined175'] = md5(md5($login['password']));
                
$_SESSION['username'] = $_POST['username'];
        
header("Location: panel.php"); 

גם הקוד הזה לא עובד.

Tomer 09-10-12 20:29

תגדיר לא עובד. יש שגיאה?

Agam Levi 09-10-12 21:21

אין שגיאה ואין שום הודעה. כשמנסים לבצע את הבדיקה הדף מתרענן.

אתם יכולים לבדוק בעצמכם :
שם משתמש : hostsproblem
ססמא : hostsproblem

http://www.boster.tk/index.php?do=login

Tomer 09-10-12 21:58

יש session_start() בתחילת העמוד?

Agam Levi 09-10-12 22:13

ציטוט:

נכתב במקור על ידי Tomer (פרסם 859624)
יש session_start() בתחילת העמוד?

כן.

האתר עבד בצורה טובה מאוד על אחסון שונה, ואתמול העברתי אותו לipage.com והתקלה החלה.

אני חושב שמדובר בתקלה באחסון, אבל זה תמוה מאוד, בגלל שכל שאר האלמנטים באתר עובדים בצורה מצוינת, מלבד ההתחברות.


כל הזמנים הם GMT +2. הזמן כעת הוא 19:54.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ