السلام عليكم ورحمة الله وبركاته
لو سمحتم طالب مساعده فى هذا الكود
ده كود تسجيل الدخول
كود صفحة الاعضاءكود:<?php session_start(); include 'config.php'; if(isset($_POST['login'])) { $username = trim(addslashes($_POST['username'])); $password = md5(trim($_POST['password'])); $query = mysql_query("SELECT * FROM Users WHERE Username = '$username' AND Password = '$password' LIMIT 1") or die(mysql_error()); $row = mysql_fetch_array($query); } if(mysql_num_rows($query) > 0) { $_SESSION['s_logged_n'] = 'true'; $_SESSION['s_username'] = $username; $_SESSION['s_name'] = $row['Name']; @setcookie("2lexusername",$username,time()+3600*3); header("Location: member.php"); } ?> <html> <head> <title>Login</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <div id="head">the login page</div><br> <div id="main"> <p>You must login to view this page. Enter your username and password below and hit submit:</p> <form method="post" action="login.php"> <p>Username:<br> <input name="username" type="text" Cid="username"> <p>Password:<br> <input name="password" type="password" id="password"> </p> <p> <input name="login" type="submit" id="login" value="Submit"> </p> </form> <p>Didn't get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p> <p>Need an account? <a href="register.php">Click here</a> to register, it's completely free! </p> </div> </div> </body> </html>
انا عاوز العضو بعد ما يسجل ويدخل على صفحة الاعضاء يتكتب فيها اسم العضو ورقم الاى دى بتاعهكود:<?php session_start(); if($_SESSION['s_logged_n'] == 'true'){ include 'process.php'; ?> <html> <head> <title>Members Page</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <div id="head">The member page</div><br> <div id="container"> <? include 'menus.php' ?> </div> <div id="spacer"> </div> <div id="memmain"> <?php switch($_GET['change']){ case 'password': echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post"> <p>Current password:<br> <input name="current" type="password"></p> <p>New password:<br> <input name="new" type="password"></p> <p>Confirm new password:<br> <input name="confirm" type="password"></p> <p><input type="submit" value="Change Password" name="changepassword"></p> </form> '; break; case 'email': echo '<p> WARNING! - By changing your email address you will have to re-validate. Make sure you email address is 100% correct.</p> <form action="'.$_SERVER['PHP_SELF'].'" method="post"> <p>Current email:<br> <input name="current" type="text"></p> <p>New email:<br> <input name="new" type="text"></p> <p>Confirm new email:<br> <input name="confirm" type="text"></p> <p><input type="submit" value="Change Email" name="changeemail"></p> </form> '; break; case 'account': echo '<p> WARNING - By closing your account, you will not be able to login again under this account. Press the button below to confirm you wish to close your account</p> <form action="'.$_SERVER['PHP_SELF'].'" method="post"> <p><input type="submit" value="Close Account" name="closeaccount"></p> </form> '; break; default: echo '<p>Welcome to the super secret members only control panel!</p>'; } ?> </div> </body> </html> <?php } else { header("Location: login.php"); } ?>


رد مع اقتباس
