Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $mess = "" ;
- $username_error = "";
- $email_error = "";
- $password_error = "";
- $you_text_error = "";
- $antispam_error = "";
- $ok = "";
- if (isset($_POST['form1'])) {
- $u_username = $_POST['u_username'];
- $u_email = $_POST['u_email'];
- $password = $_POST['password'];
- $antispam = $_POST['antispam'];
- $u_text = $_POST['textarea_name'];
- $ok = "";
- $value = 1;
- $mess ="";
- if (empty( $u_username ) ) {
- $value = 0;
- $username_error = "Pleass Enter your User Name<br>";
- }
- if (empty( $u_email ) ) {
- $value = 0;
- $email_error = "Pleass Enter your Email <br>";
- }
- if (empty( $password ) ) {
- $value = 0;
- $password_error = "Pleass Enter your Password<br> ";
- }
- if (empty( $u_text ) ) {
- $value = 0;
- $you_text_error = "Pleass Enter your text<br> ";
- }
- if (empty( $antispam ) ) {
- $value = 0;
- $antispam_error = "Pleass Enter your ans<br> ";
- }
- if ( $antispam == 5 ) {
- $ok = "ok";
- }
- else{
- if ($antispam < 5 || $antispam > 5) {
- $antispam_error .= "Your code is not mach";
- }
- }
- if ( $value == 1 ) {
- echo "You Information is ready";
- }
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>HTML Form</title>
- <style type="text/css">
- * { margin: 0; padding: 0; }
- html { height: 100%; font-size: 62.5% }
- body { height: 100%; background-color: #FFFFFF; font: 1.2em Verdana, Arial, Helvetica, sans-serif; }
- /* ==================== Form style sheet ==================== */
- table.form { margin: 25px 0 0 29px; border-collapse: collapse; }
- table.form th, table.form td { padding: 4px 5px; text-align: left; font-weight: normal; }
- table.form label { font-family: Verdana, Arial, Helvetica, sans-serif; color: #181818; margin-right: 12px; }
- table.form td span { font-size: 0.9em; color: #181818; margin-left: 8px; }
- table.form td samp { font: 1em Verdana, Arial, Helvetica, sans-serif; color: #000000; }
- table.form input { width: 340px; }
- table.form input.answer { width: auto; }
- table.form textarea { width: 385px; height: 160px; }
- table.form input.inp-text, table.form input.answer, table.form textarea
- { border: 1px solid #909090; border-right: 1px solid #BBBBBB; border-bottom: 1px solid #BBBBBB; padding: 3px; }
- table.form input:focus, table.form textarea:focus { border: 1px solid #606060; } /* does not work in IE */
- table.form th.message-up { vertical-align: top !important; }
- table.form label.invisible { visibility: hidden; }
- table.form td.submit-button-right { text-align: right !important; }
- table.form input.submit-text { font: 1.4em Georgia, "Times New Roman", Times, serif; letter-spacing: 1px; width: auto; }
- .red_color{
- color: red;
- }
- /* ==================== Form style sheet END ==================== */
- </style>
- </head>
- <body>
- <form action="" method="post">
- <table class="form">
- <tr>
- <th><label for="input-one"><strong>User Name:</strong></label></th>
- <td>
- <?php echo $username_error ; ?>
- <input class="inp-text" name="u_username" id="input-one" type="text" size="30" />
- </td>
- </tr>
- <tr>
- <th><label for="input-two"><strong>Email</strong></label></th>
- <td>
- <?php echo $email_error ; ?>
- <input class="inp-text" name="u_email" id="input-two" type="text" size="30" />
- </td>
- </tr>
- <tr>
- <th><label for="input-three"><strong>Password:</strong></label></th>
- <td>
- <?php echo $password_error ; ?>
- <input class="inp-text" name="password" id="input-three" type="password" size="30" />
- </td>
- </tr>
- <tr>
- <th class="message-up"><label for="message"><strong>Message:</strong></label></th>
- <td>
- <?php echo $you_text_error ; ?>
- <textarea name="textarea_name" id="message" cols="30" rows="5"></textarea>
- </td>
- </tr>
- <tr>
- <th><label for="question" class="invisible">Question:</label></th>
- <td><samp>3 + 2 =</samp> <input class="answer" name="antispam" id="question" type="text" size="5" />
- <span><strong>(spam protection)</strong></span>
- <?php echo $antispam_error ; ?>
- <?php echo $ok ; ?>
- </td>
- </tr>
- <tr>
- <td class="submit-button-right" colspan="2"><input class="submit-text" type="submit" value="SEND" name="form1" /></td>
- </tr>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement