View Single Post
ישן 14-10-08, 21:31   # 1
CodeX
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2006
הודעות: 172

CodeX לא מחובר  

[בעיה] סיישנים ועוגיות, כמה בעיות איתם @!?#

יש לי דף רגיל עם טופס התחברות.

PHP קוד:
<?php
include("config.php");
$query mysql_query("SELECT * FROM Details ORDER BY Title DESC") or exit(mysql_error());
$row mysql_fetch_array($query);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html dir="ltr">

<head>
<?php
$KeyWords 
$row['KeyWords'];
$Description $row['Description'];
echo<<<END
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="description" content="$Description"/>
<meta name="keywords" content="$KeyWords"/> 
<link rel="stylesheet" type="text/css" href="default.css" media="screen"/>
<title>Login to Control Panel</title>
END;
?>
</head>

<body>

<div class="container">
    
    <div class="main">

        <div class="header">
        
            <div class="title">
<?php
echo<<<END
                <h1>Login to Control Panel</h1>
END;
?>
            </div>

        </div>
        
        <div style="text-align: center;">

        <h1 style="margin: 10px">Insert your details for connecting.</h1>
        <form method="POST" action="getit.php">
        <table>
            <tr>
                <td><b>Username:</b></td> <td><input type="text" name="User" class="styled" /></td>
            </tr>
            <tr>
                <td><b>Password:</b></td> <td><input type="password" name="Pass" class="styled" /></td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit" value="" class="button2" /></td>
            </tr>
        </table>
        </form>

        </div>
    
        <div class="clearer"><span></span></div>

    </div>

    <div class="footer"><b>Contect System  by NitaY, 2008 | </b><a href="index.php">Home Page</a>
    </div>

</div>

</body>

</html>

לאחר הזנת הפרטים הוא מעביר אל הדף הבא:
PHP קוד:
<?php
ob_start
();
session_start();

$U htmlspecialchars($_POST['User']);
$P htmlspecialchars($_POST['Pass']);

$_SESSION['User']=$U;
$_SESSION['Pass']=$P;

include(
"config.php");


$User $_SESSION['User'];
$Pass $_SESSION['Pass'];

$query mysql_query("SELECT * FROM Admins Where User='$User' AND Pass='$Pass'") or exit(mysql_error());
if (
mysql_num_rows($query) == 1)
{
echo<<<END
        <h1 style="margin: 10px">Your connected is successfully!</h1>
END;
}
else
{
echo<<<END
        <h1 style="margin: 10px">Sorry, but the details aren't true.</h1>
END;
}
?>

זה הדף:
http://gilronen.goldserv.co.il/ContectSystem/login.php


תנסו להתחבר עם המשתמש Admin והסיסמא 1234
ותראו את הבעיה המציקה.
הוא מציג תגובה חיובית אבל מציג את השורות הבאות:
קוד:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/gilronen/domains/gilronen.goldserv.co.il/public_html/ContectSystem/getit.php:1) in /home/gilronen/domains/gilronen.goldserv.co.il/public_html/ContectSystem/getit.php on line 3

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/gilronen/domains/gilronen.goldserv.co.il/public_html/ContectSystem/getit.php:1) in /home/gilronen/domains/gilronen.goldserv.co.il/public_html/ContectSystem/getit.php on line 3
מה עושים ?

=\


(ד"א קרתה לי אותה בעיה עם העוגיות)
תודה ענקית לעוזריםם
  Reply With Quote