Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>تدوين</title>
- <meta charset="UTF-8"/>
- <link rel='stylesheet' href="css/css.css" medie="screen" type="text/css"/>
- </head>
- <body>
- <div class="all-wrrapper">
- </div>
- </body>
- </html>
- <meta charset="UTF-8"/>
- <?php
- $connectdb=mysql_connect("localhost","root","123") or die(mysql_error());
- $selectdb=mysql_select_db("mywebsite") or die(mysql_error());
- error_reporting(E_ALL & ~ E_NOTICE);
- if(isset($_POST["send"])){
- $username=strip_tags($_POST['username']);
- $userpass=md5($_POST['userpass']);
- $dbsql=mysql_query("SELECT * FROM user where username='$username' AND userpass='$userpass' ") or die(mysql_error());
- if(mysql_num_rows($dbsql) > 0 ){
- $userf=mysql_fetch_assoc($dbsql);
- $uid=$userf['userid'];
- $uname=$userf['username'];
- $upass=$userf['userpass'];
- if($username=$uname and $userpass=$upass){
- setcookie("uid",$uid,time()+60*60*24);
- setcookie("login","1",time()+60*60*24);
- header("Location: signup.php");
- }
- else{
- echo"<h1 style='color: red;
- font-size: 15px;
- font-weight: normal;
- position: absolute;
- top: 410px;
- right: 460px;'> الاسم او الباسوورد خاطئ </h1>";
- }
- }else{
- echo"<h1 style='color: red;
- font-size: 15px;
- font-weight: normal;
- position: absolute;
- top: 410px;
- right: 460px;'> الاسم او الباسوورد خاطئ </h1>";
- }
- }
- define("uid",$_COOKIE["uid"]);
- $selectuser=mysql_query("SELECT * FROM user WHERE userid='".uid."'");
- $fecthu=mysql_fetch_assoc($selectuser);
- define("login",$_COOKIE['login']);
- $useri=$fecthu['username'];
- if(login!=1){
- echo' <form style="position: absolute;
- right: 380px;
- top: 240px;" action="signin.php" method="POST">
- الاسم : <input type="text" name="username" style="margin-right:62px;"/><br/><br/><br/>
- الباسوورد : <input type="password" name="userpass" style="margin-right:40px;"/><br/><br/><br/>
- <input style="background: rgb(29, 160, 218) none repeat scroll 0% 0%;
- color: rgb(255, 255, 255);
- font-family: jf flat; margin-right: 230px;" type="submit" name="send" value="دخول"/>
- </form>';
- }
- else{
- echo"<h1 style='color: green;
- font-size: 15px;
- font-weight: normal;
- position: absolute;
- top: 230px;
- right: 450px;'>تم الدخول بنجاح</h1>"."<br/>"."<br/>";
- echo"<h1 style='color: green;
- font-size: 15px;
- font-weight: normal;
- position: absolute;
- top: 270px;
- right: 450px;'>اهلا بك يا</h1>";
- echo"<h1 style='color: rgb(29, 160, 218);
- font-size: 15px;
- font-weight: normal;
- position: absolute;
- top: 270px;
- right: 520px;'>".$useri." </h1>";
- echo"<a href='index.php' style='color: #000;
- font-size: 15px;
- font-weight: normal;
- position: absolute;
- top: 310px;
- right: 450px;'>اضغط هنا للدهاب للرئيسية</a>";
- }
- mysql_close($connectdb);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement