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

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

Tal.M 23-02-06 21:06

מה לא בסדר עם הקוד הבא:
 
PHP קוד:

<?
require("pass.php");
require(
"data/language.dat");
require(
"$showlang");
$user "$your_username";
$pass "$your_password";
if(!
$username OR !$password) {
echo 
"$_action_missing.<br>"; }
if(
$username == $user AND $password == $pass) {
session_start();
session_register("innlogget");
header("Location: admin.php"); }
else {
echo 
"$_action_wrong.<br>$_action_tryagain.
<br><br><img src=images/back.gif><a href=index.php?module=login>$_action_goback</a>"
; }
?>


שקד 23-02-06 21:08

יש לך שגיאה או משהו ?

Tal.M 23-02-06 21:11

כן..
יש עוד קוד להתחברות קובץ בשם pass.php שבו מגדירים את השםמשתמש וסיסמא

Kuchi 23-02-06 21:11

תנסה שיניתי לך מ OR ל ||
PHP קוד:

<?
require("pass.php");
require(
"data/language.dat");
require(
"$showlang");
$user "$your_username";
$pass "$your_password";
if(!
$username || !$password) {
echo 
"$_action_missing.<br>"; }
if(
$username == $user AND $password == $pass) {
session_start();
session_register("innlogget");
header("Location: admin.php"); }
else {
echo 
"$_action_wrong.<br>$_action_tryagain.
<br><br><img src=images/back.gif><a href=index.php?module=login>$_action_goback</a>"
; }
?>


Tal.M 23-02-06 21:14

אותו הדבר אחי..

הינה הקוד שבקובץ pass.php אם זה עוזר:

<?php
$tal = "user1";
tal$ = "password1";
?>

Kuchi 23-02-06 21:17

היוזר וסיסמא שהוא מקבל ?
תראה הגדרת יוזר ופאסס משהו שונה
עריכה תעשה ככה
PHP קוד:

$user $your_username;
$pass $your_password


Tal.M 23-02-06 21:20

אין עדיין אותה בעיה

Kuchi 23-02-06 21:27

אשמח אם תשים פא את שתי הקבצים בלי למחוק פרטים שממ חשובים כגון לשנות ל טל או משהו התחברות למסד או משהו שצריך להחביא תשנה לNAME PASS
ואשמח אם תכתוב תשגיאה !
תודה

שקד 23-02-06 21:38

תנסה ככה
PHP קוד:

<?php
require("pass.php");
require(
"data/language.dat");
require(
"$showlang");
$user $your_username;
$pass $your_password;
if(!
$username || !$password) {
    echo 
"".$_action_missing."<br />";
}
if(
$username == $user AND $password == $pass) {
session_start();
session_register("innlogget");
header("Location: admin.php");
}else {
  echo 
"".$_action_wrong."<br />".$_action_tryagain." <br /><br /><img src='images/back.gif'><a href='index.php?module=login'>".$_action_goback."</a>";
}
?>

לפי מה שאני רואה אח"כ תצוץ לך עוד בעיה עם ה session
אם אני זוכר נכון זה שגיאה בסגנון
ציטוט:

Warning: session_start(): Cannot send session cache limiter - headers already sent (....)
תסדר את זה, יש פלט לפני הסשן ..
בהצלחה :)


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

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