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

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

N0B0DY 24-03-09 01:12

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

<? require "config.php"?>
<html dir="rtl">
<head>
    <title>Pstyle- úéëðåú åòéöåá àúøéí | áðééú àúøéí | òéöåá àúøéí | äðôùåú ôìàù | àúøé ôìàù</title>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1255" />
    <meta http-equiv="Content-Language" content="he" />
    <link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body bgcolor="#ffffff">
<form action='' method='post'>
<center>

ùí îùúîù :
<input type="text" name="aname" id="aname" style="width:200px;" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;



ñéñîà îùúîù :
<input type="password" name="pname" id="pname" style="width:200px;" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

<input type="submit" name="add" id="add" style="width:100px;" />

</form>

<?php
if (isset($_POST['add']))
{
$aname htmlspecialchars(mysql_real_escape_string($_POST['aname']));
$pname htmlspecialchars(mysql_real_escape_string($_POST['pname']));
    
//checking if all fields were full
    
$error "";
    if (empty(
$aname))
    {
        
$error .= "Admin name is empty<br>";
    }
    if (empty(
$pname))
    {
        
$error .= "Admin Pass is empty<br>";
    }

    echo 
$error
    if (
$error == "")
    {
        
$query_del mysql_query("SELECT * FROM users WHERE admin_name = '".$_POST['aname']."' AND admin_pass = '".$_POST['pname']."'") or die (mysql_error());
        if (
mysql_num_rows($query_del) > 0)
        {
            echo 
"The Username and Password Match! you are logged in :)";
            
$_SESSION['username'] = "($_POST["aname"])";
            
$_SESSION['password'] = "($_POST["pname"])";
        echo 
"<meta http-equiv='Refresh' content='1.5; url=DeleteServer.php'>";
        }
        else
        {
            echo 
"Wrong details!";
        }
    }
}
?>

</body>
</html>

כנראה מקודם שכחתי איזה פסיק או משהו ויש סיכוי קטן שגם עכשיו חח

CBox.Co.il 24-03-09 12:12

אותו השגיאה, אחי ממש תודה על כל העזרה שלך .

N0B0DY 24-03-09 13:52

PHP קוד:

<? require "config.php"?>
<html dir="rtl">
<head>
    <title>Pstyle- úéëðåú åòéöåá àúøéí | áðééú àúøéí | òéöåá àúøéí | äðôùåú ôìàù | àúøé ôìàù</title>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1255" />
    <meta http-equiv="Content-Language" content="he" />
    <link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body bgcolor="#ffffff">
<form action='' method='post'>
<center>

ùí îùúîù :
<input type="text" name="aname" id="aname" style="width:200px;" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;



ñéñîà îùúîù :
<input type="password" name="pname" id="pname" style="width:200px;" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

<input type="submit" name="add" id="add" style="width:100px;" />

</form>

<?php
if (isset($_POST['add']))
{
$aname htmlspecialchars(mysql_real_escape_string($_POST['aname']));
$pname htmlspecialchars(mysql_real_escape_string($_POST['pname']));
    
//checking if all fields were full
    
$error "";
    if (empty(
$aname))
    {
        
$error .= "Admin name is empty<br>";
    }
    if (empty(
$pname))
    {
        
$error .= "Admin Pass is empty<br>";
    }

    echo 
$error
    if (
$error == "")
    {
        
$query_del mysql_query("SELECT * FROM users WHERE admin_name = '".$_POST['aname']."' AND admin_pass = '".$_POST['pname']."'") or die (mysql_error());
        if (
mysql_num_rows($query_del) > 0)
        {
            echo 
"The Username and Password Match! you are logged in :)";
            
$_SESSION['username'] = ($_POST["aname"]);
            
$_SESSION['password'] = ($_POST["pname"]);
        echo 
"<meta http-equiv='Refresh' content='1.5; url=DeleteServer.php'>";
        }
        else
        {
            echo 
"Wrong details!";
        }
    }
}
?>

</body>
</html>

אולי ככה? חחח
זה מה שאני שונא בשפות תיכנות, כל הקטע של הפסיקים, הסוגריים וכל זה.
אני תמיד מתבלבל בזה =\

CBox.Co.il 24-03-09 14:17

אחי יצאת תותח, עובד לי תודה רבה על כל העזרה !!!
תודה גם לשאר העוזרים .


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

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