הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

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

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 30-11-06, 14:32   # 1
forils
Permanently Banned
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
הודעות: 368

forils לא מחובר  

בבקשה תעזרו לי למצוא מה לא טוב בקוד הקצר הזה ?

זה התחברות :
PHP קוד:
<?
include "config.php";

$username $_POST['username']; 
$password $_POST['password']; 
$password md5($password); 

  
$db_conn mysql_connect($server$db_user$db_pass) or die ("Database CONNECT Error"); 
  
mysql_select_db($database$db_conn);
$query_of_user mysql_query("SELECT * FROM users WHERE username = '{$username}' and password='$password' AND level='2'"); 

if (
mysql_num_rows($query_of_user) != 0

    
$details mysql_fetch_array($query_of_user)
        
$username $details["username"]; 
        
$password $details["password"]; 
    } 

    
session_user('user_area'); 
    
$_SESSION['user_area'] = $username
    echo 
"<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=Pages.php?ID=My\">"
}  
?> 
    <form method=post action="index.php">
    <table align=center border=0>
    <tr><td>גג:</td>
    <td><input type=text name=username></td></tr>
    <tr><tdגדד:</td>
    <td><input type=password name=password></td></tr>
    <tr><td colspan=2 align=center>
    <input type=submit value="Log in"></td></tr>
    </table></form>
הבעיה :
PHP קוד:
Parse errorsyntax errorunexpected T_VARIABLE in /usr/home/matrixip/domains/dicw.net/public_html/1/pages/my/login.php on line 15 
זה כאן :
PHP קוד:
        $username $details["username"]; 

Last edited by forils; 30-11-06 at 14:34..
  Reply With Quote
ישן 30-11-06, 14:39   # 2
Naxon
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
הודעות: 254

Naxon לא מחובר  

PHP קוד:
<? 
include "config.php"

$username $_POST['username'];  
$password $_POST['password'];  
$password md5($password);  

  
$db_conn mysql_connect($server$db_user$db_pass) or die ("Database CONNECT Error");  
  
mysql_select_db($database$db_conn); 
$query_of_user mysql_query("SELECT * FROM users WHERE username = '{$username}' and password='$password' AND level='2'");  

if (
mysql_num_rows($query_of_user) != 0)  
{  
    
$details mysql_fetch_array($query_of_user
        
$username $details["username"];  
        
$password $details["password"];  
    }  else {

    
session_user('user_area');  
    
$_SESSION['user_area'] = $username;  
    echo 
"<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=Pages.php?ID=My\">";  
}   
?>  
    <form method=post action="index.php"> 
    <table align=center border=0> 
    <tr><td>גג:</td> 
    <td><input type=text name=username></td></tr> 
    <tr><tdגדד:</td> 
    <td><input type=password name=password></td></tr> 
    <tr><td colspan=2 align=center> 
    <input type=submit value="Log in"></td></tr> 
    </table></form>
נסה את זה.
  Reply With Quote
ישן 30-11-06, 14:41   # 3
meshuga
הנהלת הפורום לשעבר
 
meshuga's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 35
הודעות: 7,601

meshuga לא מחובר  

שכחת נקודה-פסיק ( ; ) בשורה:
PHP קוד:
$details mysql_fetch_array($query_of_user
  Reply With Quote
ישן 30-11-06, 14:45   # 4
forils
Permanently Banned
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
הודעות: 368

forils לא מחובר  

תודה אבל עכשיו זה מראה בעיה אחרת
בשורה 19 איפה שהתחלתי לרשום את הסיישן ?
PHP קוד:
Fatal errorCall to undefined function: session_user() in /usr/home/matrixip/domains/dicw.net/public_html/1/pages/my/login.php on line 19 

Last edited by forils; 30-11-06 at 14:47..
  Reply With Quote
ישן 30-11-06, 14:51   # 5
BlueNosE
אין כמו ב127.0.0.1
 
BlueNosE's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: כפ"ס
גיל: 32
הודעות: 4,086

BlueNosE לא מחובר  

אין פונקצייה כזאת SESSION_USER
O.ם
__________________
עומר,
admin [@] rely.co.il

בניית אתרים Rely

סלנג מילון סלנג utter
  Reply With Quote
ישן 30-11-06, 14:54   # 6
forils
Permanently Banned
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
הודעות: 368

forils לא מחובר  

תודה אני מחליף שניה
  Reply With Quote
ישן 30-11-06, 15:01   # 7
Tomer
Whatever
 
Tomer's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
הודעות: 7,039
שלח הודעה באמצעות MSN אל Tomer Send a message via Skype™ to Tomer

Tomer לא מחובר  

נמאס לי להעיר לכם, מהיום כל מי שמביא קודים מקבל אזהרה, גם אם הקוד הוא רק "תיקון" למה שהמשתמש כתב.
__________________
תומר
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


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

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