Advertisement
mahmoodn

index.html

Aug 25th, 2017
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.37 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title></title>
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.  
  8.     <link href="css/bootstrap.min.css" rel="stylesheet">
  9.     <style type="text/css">
  10.  
  11.  
  12.         body {
  13.             padding-top: 40px;
  14.             padding-bottom: 40px;
  15.             background-color: #f5f5f5;
  16.         }
  17.  
  18.         .form-signin {
  19.             max-width: 600px;
  20.             padding: 40px 40px 40px;
  21.             margin: 0 auto 20px;
  22.             background-color: #fff;
  23.             border: 1px solid #e5e5e5;
  24.             -webkit-border-radius: 5px;
  25.             -moz-border-radius: 5px;
  26.             border-radius: 5px;
  27.             -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
  28.             -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
  29.             box-shadow: 0 1px 2px rgba(0,0,0,.05);
  30.         }
  31.         .form-signin .form-signin-heading,
  32.         .form-signin .checkbox {
  33.             text-align: center;
  34.             font-size:26px;
  35.             margin-bottom: 20px;
  36.         }
  37.         .form-signin input[type="text"],
  38.         .form-signin input[type="password"] {
  39.             font-size: 20px;
  40.             text-align: center;
  41.             height: 10px;
  42.             margin-bottom: 20px;
  43.             padding: 20px 9px 20px;
  44.         }
  45.  
  46.         .error-msg {
  47.             direction: ltr;
  48.             background-color: #c41c26;
  49.             border-radius: 2px;
  50.             padding: 5px;
  51.             margin-top: 16px;
  52.             color: white;
  53.         }
  54.     </style>
  55.     <link href="css/bootstrap-responsive.css" rel="stylesheet">
  56. </head>
  57.  
  58. <body>
  59.  
  60. <div class="container">
  61.     <form class="form-signin" action="" method="post">
  62.         <h4 class="form-signin-heading">Please enter the project name</h4>
  63.         <input type="text" class="input-block-level" id="folder_name" name="foldername" placeholder="Project name" onkeyup="checkLanguage()" required>
  64.         <input type="submit" class="btn btn-primary btn-block btn-md" value="Create">
  65.         <input type="hidden" name="createFolder">
  66.         <?php
  67.        if (isset($_POST['createFolder'])) {
  68.            $folder_name = $_POST['foldername'];
  69.            if(!is_dir($_POST['foldername'])) {
  70.                mkdir($_POST['foldername']);
  71.                $FileName = "inf.txt";
  72.                $FileHandle = fopen($_POST['foldername'] . "/" . $FileName, 'a') or die("can't open file");
  73.                $stringData = $_POST['foldername'] . "\r\n";
  74.                fwrite($FileHandle, $stringData);
  75.                fclose($FileHandle);
  76.                header("Location: upload.php?foldername=$folder_name");
  77.                exit();
  78.            }else{
  79.                header("refresh: index.php");
  80.                echo "<p class=\"error-msg\">Sorry ,the directory " ."\"" . $folder_name ."\"" . " already exists.</p>";
  81.             }
  82.         }
  83.         ?>
  84.     </form>
  85.  
  86. </div> <!-- /container -->
  87.  
  88.  
  89.  
  90. <script type="text/javascript">
  91.  
  92.         function checkLanguage() {
  93.             // A-Z : 65 - 90 , a-z : 97 - 122
  94.             var reg = new RegExp('[a-zA-Z]');
  95.             if(reg.test(event.key)){
  96.                 return;
  97.             }
  98.             else {
  99.                 document.getElementById('folder_name').value = "";
  100.                 alert ("زبان صفحه کلید بایدانگلیسی باشد.");
  101.             }
  102.         }
  103.  
  104. </script>
  105.  
  106. </body>
  107. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement