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

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

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 22-07-08, 00:44   # 17
Daniel
אחראי פורום
 
מיני פרופיל
תאריך הצטרפות: Mar 2007
הודעות: 2,875

Daniel לא מחובר  

תאמין לי שלא הרג אף אחד טיפה, טיפה, טיפה לנסות.
PHP קוד:
<?php
error_reporting
(E_ALL);
include 
"config.php";
$tp = <<<EOF
<html dir="rtl">
<head>
    <title>דף ראשי</title>
</head>
<body>
EOF;
$hour time() + 3600;
$username $_COOKIE['user'];
$password $_COOKIE['pass'];

if (!isset(
$_COOKIE['user'])) {
    
$tp .= "אתה אינך מחובר :: <a href=\"?act=loginform\">התחברות</a><br />";
} else
    
$tp .= "ברוך הבא $username :: <a href=\"?act=logout\">התנתק</a><br />";

$act = isset($_GET['act']) ? $act $_GET['act'] : $act "loginform"// הגדרת משתנה ראשי

if ($act == "logincheck") { // בדיקת התחברות
    // הכנסת פרטי הטופס למשתנים
    
$user $_POST['User'];
    
$pass $_POST['Pass'];
    
// בדיקת טופס
    
$tp .= "
    <table class=\"loginchecktable\">
    <tr><td valign=\"top\" dir=\"rtl\" class=\"login_check_td_table\">"
;

    if (
$pass == "") {
        
$tp .= "סיסמא לא הוזנה
<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=?act=loginform\">"
;
    } else if (
$user == "") {
        
$tp .= "שם משתמש לא הוזן
       <META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=?act=loginform\">"
;
    } else {
        
$s mysql_query("SELECT * FROM members WHERE username='$user' && password='$pass'") or die(mysql_error());
        
$checkform mysql_num_rows($s);

        if (
$checkform == "0") {
            
$tp .= "אחד מהפרטים אינו נכון
        <META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=?act=loginform\">"
;
        } else {
            
$tp .= "התחברת בהצלחה<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=index.php\">";
            
setcookie('user'$user$hour);
            
setcookie('pass'$pass$hour);
        }
    }

    
$tp .= "</td></tr>
</table>"
;
} else if (
$act == "loginform") { // טופס התחברות
    
if (!isset($_COOKIE['user'])) {
        
$tp .= <<<LOGINFORM

<form action="?act=logincheck" method="post">
<table class="logintable">

    <tr><td valign="top" dir="rtl" class="logintdtable">שם משתמש: </td>
    <td valign="top" dir="rtl" class="logintdtable"><input type="text" name="User"></td>
    </tr>
    <tr><td valign="top" dir="rtl" class="logintdtable">סיסמא:  </td>
    <td valign="top" dir="rtl" class="logintdtable"><input type="password" name="Pass"></td>
    </tr>
    <tr><td valign="top" dir="rtl" class="logintdtable"></td>
    <td valign="top" dir="rtl" class="logintdtable"><input type="reset" value="נקה"><input type="submit" value="התחבר"></td>
    </tr>
</table>
</form>

LOGINFORM;
    } else {
        
$tp .= "אתה מחובר למערכת
<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=index.php\">"
;
    }
} else if (
$act == "logout") {
    
$past time() - 100;
    
setcookie('user''I dont know PHP'$past);
    
setcookie('pass''I dont know PHP'$past);
    
$tp .= "התנתקת בהצלחה
        <META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=index.php\">"
;
}
$tp .= "</body></html>";
echo 
$tp;

?>
  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. הזמן כעת הוא 21:50.

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