عملت صفحة وحتية في كل الفنكشن متاعي السكريبت وعملت داله للفورم لتسجيل الدخول ودالة التحقق من الاسم او كلمة السير صح ام خطاء وكل ما ادخل كلمة السي ر وعمل صفحة chak عليهم ارجو المساعد في هم
دية صفحة دوال الفنكشن اسمة function2.php
كود PHP:
<?php
/**
* @author
* @copyright 2008
*/
function do_html_head($title=''){
echo"<htmal dir='rtl'>";
echo"<head>";
echo"<title>'".$title."'</title>";
echo"</head>";
echo"<body>";
echo"<h1>welcome to mohamedhelal web sit</h1>";
}
function body_m($bady_n)
{
echo"<table border='1' bgcolor='red'width='100%' height='350'>";
echo"<tr>";
echo"<td><font color='blue'size='20'> $bady_n </font></td>";
echo"</tr>";
echo"</table>";
}
function do_login_form()
{
echo'<form name="login" method="POST" action="chak.php">';
echo"username:<br/>";
echo"<input type=\'text\' name=\'T1\'><br/>";
echo"password:<br/>";
echo"<input type=\'password\'name=\'T2\'>";
echo'<br><input name="butten" type="submit" value="submit" ><br/>';
echo"</form>";
}
function chakuser($username,$password){
$sql="select *from member where username='".$user."' AND password='".md($pass)."'";
$result=mysql_query($sql);
if(!$result){
return false;
}
else{
mysql_num_rows($result>0);
return true;
}
}
function footer($foot){
echo"<table border='1'>";
echo"<tr>";
echo"<td> $foot</td>";
echo"</tr>";
echo"</table>";
echo"</body>";
echo"</html>";
}
?>
ويدية الصفحة الرئيسية index2.php
كود PHP:
<?php
/**
* @author
* @copyright 2008
*/
include("config.php");
include("function2.php");
include("function2.php");
$user=$_post['T1'];
$pass=$_post['T2'];
do_html_head("mohamedhelal");
do_login_form($user,$pass);
footer('capyright mohamedhelal web site ');
?>
ودية صفحة chak.php
كود PHP:
<?php
/**
* @author
* @copyright 2008
*/
include("config.php");
$user=trim($_post['T1']);
$pass=trim($_post['T2']);
if($user&&$pass)
{
if(chakuser($user&&$pass))
{
header("localhost:welcome.php");
}
else{
echo"name is rong";
}
}
?>
المفروض بعد ميعرف الاسم صحيح ولا لا لو صحيح يستدعي صفحة الولكم او يطلع غلط في الاستعلام
اجو كتابة ما غلط فية عشان اعرفة وشكراااااااااااااااااااا ورمضان كريم علي الكل