| |||||||
| المدوّنات | البحث | مشاركات اليوم | اجعل كافة المشاركات مقروءة |
|
| | LinkBack | أدوات الموضوع |
| |||||
| ممكن مساعدة بخصوص صلاحيات الاعضاء حالياً جالس اشتغل على برنامج صغير ولاكن من المهام هو اعطاء صلحيات لكل عضو مثلا التعديل و الحذف لعضو معين و الاضافه لعضو صراحه الفكره ماهي جايه في بالي ابداً ولا قد تطرقت لها او اني قريت عنها شي فقط ما ارغبه هو الفكره طريقة الصلاحيات لكل عضو بنتظاركم | |||||
|
| |||||
| اقتباس:
يكون متكون من الحقول التالية group_id group_del حذف مواضيع مثلا group_writing كتابة مواضيع مثلاً الخ .. وفي جدول الاعضاء سوي حقل باسم group_id ![]() والباقي اكيد انت بتعرفه | |||||
|
| |||||
|
اخوي GlobTrax انا سويت قاعدة بيانات بشكل هذا كود: -- phpMyAdmin SQL Dump -- version 2.9.1.1 -- http://www.phpmyadmin.net -- -- قاعدة البيانات: `AD` -- -- -------------------------------------------------------- -- -- بنية الجدول `registered_members` -- CREATE TABLE `registered_members` ( `id` int(4) NOT NULL auto_increment, `username` varchar(65) NOT NULL, `password` varchar(65) NOT NULL, `level` varchar(65) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=cp1256 AUTO_INCREMENT=4; -- بس المشكلة عند عرض الصفحة كيف اعطي صلاحيات على هذه الصفحة بحيث اذا كان الرقم 1 او 2 او 3 في حقل level لايستطيع الدخول اما اذا كان 4 او 5 يستطيع الدخول هذه هي الصفحة كود: <?
session_start();
if(!session_is_registered(myusername)){
header("location:index.php");
}
?>
<html>
<head>
<title>Faleh S Al-Harthi</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="JavaScript" fptype="dynamicanimation">
<!--
function dynAnimation() {}
function clickSwapImg() {}
//-->
</script>
<script language="JavaScript1.2" fptype="dynamicanimation" src="animate.js">
</script>
</head>
<body bgcolor="#93CFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="dynAnimation()" language="Javascript1.2">
<div align="center">
<table id="Table_01" width="768" height="1001" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="14">
<img src="images/faleh_01.jpg" width="767" height="7" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="7" alt=""></td>
</tr>
<tr>
<td colspan="2" rowspan="2">
<img src="images/faleh_02.jpg" width="26" height="101" alt=""></td>
<td>
<a href="logout.php">
<img border="0" src="images/faleh_03.jpg" width="32" height="46"></a></td>
<td rowspan="2">
<img src="images/faleh_04.jpg" width="35" height="101" alt=""></td>
<td>
<a href="Contact.php">
<img border="0" src="images/faleh_05.jpg" width="31" height="46"></a></td>
<td rowspan="2">
<img src="images/faleh_06.jpg" width="29" height="101" alt=""></td>
<td>
<a href="stc.php">
<img border="0" src="images/faleh_07.jpg" width="62" height="46"></a></td>
<td colspan="7" rowspan="2">
<img src="images/faleh_08.jpg" width="552" height="101" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="46" alt=""></td>
</tr>
<tr>
<td>
<img src="images/faleh_09.jpg" width="32" height="55" alt=""></td>
<td>
<img src="images/faleh_10.jpg" width="31" height="55" alt=""></td>
<td>
<img src="images/faleh_11.jpg" width="62" height="55" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="55" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="images/faleh_12.jpg" width="14" height="90" alt=""></td>
<td colspan="7">
<iframe name="I1" src="wellcome.php" height="69" width="312" border="0" frameborder="0">
لا يدعم المستعرض الذي تستخدمه الإطارات المضمنة أو تمت تهيئته حالياً حتى لا يدعم الإطارات المضمنة.
</iframe></td>
<td colspan="6" rowspan="2">
<img src="images/faleh_14.jpg" width="441" height="90" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="69" alt=""></td>
</tr>
<tr>
<td colspan="7">
<img src="images/faleh_15.jpg" width="312" height="21" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="21" alt=""></td>
</tr>
<tr>
<td colspan="9" rowspan="19">
<iframe name="I2" src="staff_reviewdatast.php" height="746" width="535" border="0" frameborder="0">
لا يدعم المستعرض الذي تستخدمه الإطارات المضمنة أو تمت تهيئته حالياً حتى لا يدعم الإطارات المضمنة.
</iframe></td>
<td colspan="5">
<img src="images/faleh_17.jpg" width="232" height="48" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="48" alt=""></td>
</tr>
<tr>
<td rowspan="19">
<img src="images/faleh_18.jpg" width="5" height="702" alt=""></td>
<td colspan="3">
<a href="addstaff.php" onmouseover="var img=document['fpAnimswapImgFP1'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP1'].src=document['fpAnimswapImgFP1'].imgRolln">
<img border="0" src="images/faleh_19.jpg" width="220" height="32" id="fpAnimswapImgFP1" name="fpAnimswapImgFP1" dynamicanimation="fpAnimswapImgFP1" lowsrc="images/faleh2_19.jpg"></a></td>
<td rowspan="19">
<img src="images/faleh_20.jpg" width="7" height="702" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="32" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/faleh_21.jpg" width="220" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3">
<a href="dataamendment.php" onmouseover="var img=document['fpAnimswapImgFP2'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP2'].src=document['fpAnimswapImgFP2'].imgRolln">
<img border="0" src="images/faleh_22.jpg" width="220" height="28" id="fpAnimswapImgFP2" name="fpAnimswapImgFP2" dynamicanimation="fpAnimswapImgFP2" lowsrc="images/faleh2_22.jpg"></a></td>
<td>
<img src="images/spacer.gif" width="1" height="28" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/faleh_23.jpg" width="220" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3">
<a href="reviewdata.php" onmouseover="var img=document['fpAnimswapImgFP3'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP3'].src=document['fpAnimswapImgFP3'].imgRolln">
<img border="0" src="images/faleh_24.jpg" width="220" height="28" id="fpAnimswapImgFP3" name="fpAnimswapImgFP3" dynamicanimation="fpAnimswapImgFP3" lowsrc="images/faleh2_24.jpg"></a></td>
<td>
<img src="images/spacer.gif" width="1" height="28" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/faleh_25.jpg" width="220" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3">
<a href="leave.php" onmouseover="var img=document['fpAnimswapImgFP4'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP4'].src=document['fpAnimswapImgFP4'].imgRolln">
<img border="0" src="images/faleh_26.jpg" width="220" height="28" id="fpAnimswapImgFP4" name="fpAnimswapImgFP4" dynamicanimation="fpAnimswapImgFP4" lowsrc="images/faleh2_26.jpg"></a></td>
<td>
<img src="images/spacer.gif" width="1" height="28" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/faleh_27.jpg" width="220" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3">
<a href="absence.php" onmouseover="var img=document['fpAnimswapImgFP5'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP5'].src=document['fpAnimswapImgFP5'].imgRolln">
<img border="0" src="images/faleh_28.jpg" width="220" height="28" id="fpAnimswapImgFP5" name="fpAnimswapImgFP5" dynamicanimation="fpAnimswapImgFP5" lowsrc="images/faleh2_28.jpg"></a></td>
<td>
<img src="images/spacer.gif" width="1" height="28" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/faleh_29.jpg" width="220" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3">
<a href="delay.php" onmouseover="var img=document['fpAnimswapImgFP6'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP6'].src=document['fpAnimswapImgFP6'].imgRolln">
<img border="0" src="images/faleh_30.jpg" width="220" height="28" id="fpAnimswapImgFP6" name="fpAnimswapImgFP6" dynamicanimation="fpAnimswapImgFP6" lowsrc="images/faleh2_30.jpg"></a></td>
<td>
<img src="images/spacer.gif" width="1" height="28" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/faleh_31.jpg" width="220" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3">
<a href="eststaf.php" onmouseover="var img=document['fpAnimswapImgFP7'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP7'].src=document['fpAnimswapImgFP7'].imgRolln">
<img border="0" src="images/faleh_32.jpg" width="220" height="28" id="fpAnimswapImgFP7" name="fpAnimswapImgFP7" dynamicanimation="fpAnimswapImgFP7" lowsrc="images/faleh2_32.jpg"></a></td>
<td>
<img src="images/spacer.gif" width="1" height="28" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/faleh_33.jpg" width="220" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="3">
<a href="Irregularities.php" onmouseover="var img=document['fpAnimswapImgFP8'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;" onmouseout="document['fpAnimswapImgFP8'].src=document['fpAnimswapImgFP8'].imgRolln">
<img border="0" src="images/faleh_34.jpg" width="220" height="34" id="fpAnimswapImgFP8" name="fpAnimswapImgFP8" dynamicanimation="fpAnimswapImgFP8" lowsrc="images/faleh2_34.jpg"></a></td>
<td>
<img src="images/spacer.gif" width="1" height="34" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/faleh_35.jpg" width="220" height="183" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="183" alt=""></td>
</tr>
<tr>
<td rowspan="3">
<img src="images/faleh_36.jpg" width="37" height="278" alt=""></td>
<td>
<a href="admin.php">
<img border="0" src="images/faleh_37.jpg" width="177" height="94"></a></td>
<td rowspan="3">
<img src="images/faleh_38.jpg" width="6" height="278" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="94" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="images/faleh_39.jpg" width="177" height="184" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="180" alt=""></td>
</tr>
<tr>
<td colspan="9">
<img src="images/faleh_40.jpg" width="535" height="4" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="4" alt=""></td>
</tr>
<tr>
<td colspan="14">
<img src="images/faleh_41.jpg" width="767" height="52" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="52" alt=""></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="14" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="12" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="32" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="35" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="31" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="29" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="62" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="111" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="209" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="5" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="37" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="177" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="6" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="7" height="1" alt=""></td>
<td></td>
</tr>
</table>
</div>
</body>
</html> التعديل الأخير تم بواسطة : manindark بتاريخ 15-02-2008 الساعة 04:02 PM. | |||||
|
| |||||
| اقتباس:
شكراً لك اخوي ماقصرت على اني لم افهم شي صراحه ![]() لو تتكرم وتقوم بشرح الطريقه بالتفصيل يكون افضل او اقل شي اقلام نقدر نتبعها انا الطريقة اللي جت في بالي اني اضع حقل جديد في جدول الاعضاء واعطيه قيمه بعد كذا اسوي if($_SESSION['level'] == "1"){ echo "يعرض البيانات التي مسموح بها"; } انتظر ردك | |||||
|
| |||||
|
السلام عليكم الطريقه بكل بساطه عند تسجيل الدخول والتاكد من صحة البيانات اذا كانت صحيحه ورقم المجموعه صحيح نقوم بتسجيل الجلسه كما في المثال التالي طبعا مع تغيير المعلومات لما يناسب قاعدة البيانات الخاصه بكم كود PHP: | |||||
|
| |||||
| كود PHP: جرب هذي الطريقه على مافهمت انا من الشرح | |||||
|
| |||||
| اقتباس:
شكراً لك | |||||
|
| |||||
|
انا عند الكود لتسجيل الدخول وهذا هو ملف التحقق من التسجيل كود: <?php
ob_start();
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
$encrypted_mypassword=md5($mypassword);
include'configlogin.php';
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$encrypted_mypassword'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:login_success.php");
}
else {
echo '<META http-equiv="refresh" content="0;URL=index.php">';
}
?> كود: session_register("myusername");
session_register("mypassword");
session_register("level"); كود: <?
session_start();
if(!session_is_registered(myusername)){
header("location:index.php");
}
if($_SESSION['level'] == "1"){
echo "غير مرخص لك بالدخول";
exit;
}else{
?> التعديل الأخير تم بواسطة : manindark بتاريخ 18-02-2008 الساعة 02:50 PM. | |||||
|
| |||||
|
مرحبا انا لم اجرب الطريقه الى الان للاسف ولاكن جربها انت ورد علينا استخدم هذا الكود للتسجيل الدخول وبعد كذا جرب الطريقة اللي شرحتها لك كود PHP: | |||||
|