Advertisement
Guest User

Untitled

a guest
Aug 14th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.08 KB | None | 0 0
  1.  
  2.  
  3. <html>
  4. <head>
  5.     <title>تدوين</title>
  6.     <meta charset="UTF-8"/>
  7.     <link rel='stylesheet' href="css/css.css" medie="screen" type="text/css"/>
  8.     </head>
  9.  
  10.  
  11. <body>
  12.   <div class="all-wrrapper">
  13.  
  14.  
  15.  
  16.  
  17.     </div>
  18.  
  19.  
  20.  
  21.     </body>
  22.  
  23.  
  24.  
  25.  
  26. </html>
  27.  
  28.  
  29.  
  30. <meta charset="UTF-8"/>
  31. <?php
  32.  
  33. $connectdb=mysql_connect("localhost","root","123") or die(mysql_error());
  34. $selectdb=mysql_select_db("mywebsite") or die(mysql_error());
  35. error_reporting(E_ALL & ~ E_NOTICE);
  36.  
  37.  
  38.  
  39.  
  40. if(isset($_POST["send"])){
  41.  
  42.         $username=strip_tags($_POST['username']);
  43.         $userpass=md5($_POST['userpass']);
  44.         $dbsql=mysql_query("SELECT * FROM user where username='$username' AND userpass='$userpass' ") or die(mysql_error());
  45.  
  46.     if(mysql_num_rows($dbsql) > 0 ){
  47.  
  48.         $userf=mysql_fetch_assoc($dbsql);
  49.         $uid=$userf['userid'];
  50.         $uname=$userf['username'];
  51.         $upass=$userf['userpass'];
  52.  
  53.  
  54.  
  55.         if($username=$uname and $userpass=$upass){
  56.  
  57.  
  58.  
  59.         setcookie("uid",$uid,time()+60*60*24);
  60.          setcookie("login","1",time()+60*60*24);
  61.         header("Location: signup.php");
  62.         }
  63.  
  64.  
  65.         else{
  66.  
  67.                echo"<h1 style='color: red;
  68. font-size: 15px;
  69. font-weight: normal;
  70. position: absolute;
  71. top: 410px;
  72. right: 460px;'> الاسم او الباسوورد خاطئ </h1>";
  73.         }
  74.  
  75.     }else{
  76.                echo"<h1 style='color: red;
  77. font-size: 15px;
  78. font-weight: normal;
  79. position: absolute;
  80. top: 410px;
  81. right: 460px;'> الاسم او الباسوورد خاطئ </h1>";
  82.  
  83.     }
  84.  
  85. }
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93. define("uid",$_COOKIE["uid"]);
  94. $selectuser=mysql_query("SELECT * FROM user WHERE userid='".uid."'");
  95. $fecthu=mysql_fetch_assoc($selectuser);
  96.  
  97. define("login",$_COOKIE['login']);
  98. $useri=$fecthu['username'];
  99.  
  100. if(login!=1){
  101.  
  102.  
  103.         echo'  <form style="position: absolute;
  104. right: 380px;
  105. top: 240px;" action="signin.php" method="POST">
  106.  
  107.      الاسم : <input type="text" name="username" style="margin-right:62px;"/><br/><br/><br/>
  108.            الباسوورد : <input type="password" name="userpass"  style="margin-right:40px;"/><br/><br/><br/>
  109.       <input style="background: rgb(29, 160, 218) none repeat scroll 0% 0%;
  110. color: rgb(255, 255, 255);
  111. font-family: jf flat; margin-right: 230px;" type="submit" name="send" value="دخول"/>
  112.      </form>';
  113.  
  114.  
  115.  
  116. }
  117.  
  118.  
  119. else{
  120.  
  121.  
  122.  
  123.        echo"<h1 style='color: green;
  124. font-size: 15px;
  125. font-weight: normal;
  126. position: absolute;
  127. top: 230px;
  128. right: 450px;'>تم الدخول بنجاح</h1>"."<br/>"."<br/>";
  129.  
  130.                echo"<h1 style='color: green;
  131. font-size: 15px;
  132. font-weight: normal;
  133. position: absolute;
  134. top: 270px;
  135. right: 450px;'>اهلا بك يا</h1>";
  136.  
  137.  
  138.     echo"<h1 style='color: rgb(29, 160, 218);
  139. font-size: 15px;
  140. font-weight: normal;
  141. position: absolute;
  142. top: 270px;
  143. right: 520px;'>".$useri." </h1>";
  144.  
  145.  
  146.  
  147.     echo"<a href='index.php' style='color: #000;
  148. font-size: 15px;
  149. font-weight: normal;
  150. position: absolute;
  151. top: 310px;
  152. right: 450px;'>اضغط هنا للدهاب للرئيسية</a>";
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159. }
  160.  
  161.  
  162.  
  163.  
  164. mysql_close($connectdb);
  165. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement