Advertisement
Guest User

Untitled

a guest
Jan 12th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.50 KB | None | 0 0
  1. <?php
  2.  
  3.     $mess = "" ;
  4.     $username_error  = "";
  5.     $email_error  = "";
  6.     $password_error   = "";
  7.     $you_text_error = "";
  8.     $antispam_error = "";
  9.     $ok = "";
  10.  
  11.     if (isset($_POST['form1'])) {
  12.  
  13.         $u_username = $_POST['u_username'];
  14.         $u_email =  $_POST['u_email'];
  15.         $password =  $_POST['password'];
  16.         $antispam =  $_POST['antispam'];
  17.         $u_text =  $_POST['textarea_name'];
  18.         $ok = "";
  19.  
  20.         $value = 1;
  21.         $mess ="";
  22.         if (empty( $u_username ) ) {
  23.             $value = 0;
  24.             $username_error  = "Pleass Enter your User Name<br>";
  25.         }
  26.         if (empty( $u_email ) ) {
  27.             $value = 0;
  28.             $email_error = "Pleass Enter your Email <br>";
  29.         }
  30.         if (empty( $password ) ) {
  31.             $value = 0;
  32.             $password_error  = "Pleass Enter your Password<br> ";
  33.         }
  34.         if (empty( $u_text ) ) {
  35.             $value = 0;
  36.             $you_text_error  = "Pleass Enter your text<br> ";
  37.         }
  38.        
  39.         if (empty( $antispam ) ) {
  40.             $value = 0;
  41.             $antispam_error  = "Pleass Enter your ans<br> ";
  42.         }
  43.         if ( $antispam == 5 ) {
  44.             $ok = "ok";
  45.         }
  46.         else{
  47.             if ($antispam < 5 || $antispam > 5) {
  48.                 $antispam_error .= "Your code is not mach";
  49.             }
  50.         }
  51.         if ( $value == 1 ) {
  52.             echo "You Information is ready";
  53.         }
  54.  
  55.  
  56.     }
  57.  
  58. ?>
  59.  
  60. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  61. <html xmlns="http://www.w3.org/1999/xhtml">
  62. <head>
  63. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  64. <title>HTML Form</title>
  65.  
  66. <style type="text/css">
  67.  
  68. * { margin: 0; padding: 0; }
  69.  
  70. html { height: 100%; font-size: 62.5% }
  71.  
  72. body { height: 100%; background-color: #FFFFFF; font: 1.2em Verdana, Arial, Helvetica, sans-serif; }
  73.  
  74.  
  75. /* ==================== Form style sheet ==================== */
  76.  
  77. table.form { margin: 25px 0 0 29px; border-collapse: collapse; }
  78.  
  79. table.form th, table.form td { padding: 4px 5px; text-align: left; font-weight: normal; }
  80.  
  81. table.form label { font-family: Verdana, Arial, Helvetica, sans-serif; color: #181818; margin-right: 12px; }
  82. table.form td span { font-size: 0.9em; color: #181818; margin-left: 8px; }
  83. table.form td samp { font: 1em Verdana, Arial, Helvetica, sans-serif; color: #000000; }
  84.  
  85. table.form input { width: 340px; }
  86. table.form input.answer { width: auto; }
  87. table.form textarea { width: 385px; height: 160px; }
  88.  
  89. table.form input.inp-text, table.form input.answer, table.form textarea
  90. { border: 1px solid #909090; border-right: 1px solid #BBBBBB; border-bottom: 1px solid #BBBBBB; padding: 3px; }
  91. table.form input:focus, table.form textarea:focus { border: 1px solid #606060; } /* does not work in IE */
  92.  
  93. table.form th.message-up { vertical-align: top !important; }
  94.  
  95. table.form label.invisible { visibility: hidden; }
  96.  
  97. table.form td.submit-button-right { text-align: right !important; }
  98. table.form input.submit-text { font: 1.4em Georgia, "Times New Roman", Times, serif; letter-spacing: 1px; width: auto; }
  99.  
  100. .red_color{
  101.     color: red;
  102. }
  103.  
  104. /* ==================== Form style sheet END ==================== */
  105.  
  106. </style>
  107. </head>
  108.  
  109.  
  110. <body>
  111.  
  112.     <form action="" method="post">
  113.         <table class="form">
  114.             <tr>
  115.                 <th><label for="input-one"><strong>User Name:</strong></label></th>
  116.                 <td>
  117.                     <?php echo $username_error ; ?>
  118.                     <input class="inp-text" name="u_username" id="input-one" type="text" size="30" />
  119.                 </td>
  120.             </tr>
  121.  
  122.             <tr>
  123.                 <th><label for="input-two"><strong>Email</strong></label></th>
  124.                 <td>
  125.                     <?php echo $email_error ; ?>
  126.                     <input class="inp-text" name="u_email" id="input-two" type="text" size="30" />
  127.                 </td>
  128.             </tr>
  129.  
  130.             <tr>
  131.                 <th><label for="input-three"><strong>Password:</strong></label></th>
  132.                 <td>
  133.                     <?php echo $password_error ; ?>
  134.                     <input class="inp-text" name="password" id="input-three" type="password" size="30" />
  135.                 </td>
  136.             </tr>
  137.  
  138.             <tr>
  139.                 <th class="message-up"><label for="message"><strong>Message:</strong></label></th>
  140.                 <td>
  141.                 <?php echo $you_text_error ; ?>
  142.                 <textarea name="textarea_name" id="message" cols="30" rows="5"></textarea>
  143.                 </td>
  144.             </tr>
  145.  
  146.             <tr>
  147.                 <th><label for="question" class="invisible">Question:</label></th>
  148.                 <td><samp>3&nbsp;+&nbsp;2&nbsp;=</samp> &nbsp; <input class="answer" name="antispam" id="question" type="text" size="5" />
  149.                 <span><strong>(spam protection)</strong></span>
  150.                     <?php  echo $antispam_error ; ?>
  151.                     <?php echo $ok ; ?>
  152.                 </td>
  153.             </tr>
  154.  
  155.             <tr>
  156.                 <td class="submit-button-right" colspan="2"><input class="submit-text" type="submit" value="SEND"  name="form1" /></td>
  157.             </tr>
  158.         </table>
  159.     </form>
  160.  
  161. </body>
  162. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement