html - How do i style PHP validations -
this first time using php validation , validations working perfectly. how style validation, select echo function or have change validation code able style it. have tried using span , echoing out error function , changing echo's error function e.g $emailerr not luck, validations not work. suggestions?
html
<!-- <div id="first">--> <input type="email" id="email" name="email" placeholder="email address" value='' required><!--<span class="error"><!--<?php //echo $c_emailerr; ?></span>--> <br> <figure> <input class ="login-field" type="password" id="pass1" name="pass1" value="" placeholder="password" maxlength="30" required><!--<span class="error"><1--<?php //echo $c_pass1err; ?></span>--> <input class ="login-field" type="password" id="pass2" name="pass2" value="" placeholder=" confirm password" maxlength="30" required><!--<span class="error"><!--<?php //echo $c_pass2err; ?></span>--> <div id="messages"></div> </figure> <p class="remember_me"> </p> <input type="submit" name="submit" value="register" id="submit_button" class="btn btn-default"> <br> </form> php
<?php if (isset($_post['submit'])) { $reg_errors = array(); $c_email = $_post['email']; $c_pass1 = $_post['pass1']; $c_pass2 = $_post['pass2']; $emailerr = $pass1err = $pass2err = ""; // $c_email = $c_pass1 = $c_pass2 = ""; // remove illegal characters email // $c_email = filter_var($c_email, filter_sanitize_email); //checking email address if (!filter_var($c_email, filter_validate_email) === false) { echo("<b> valid email address </b>"); } else { echo("<b> email not valid email address</b>"); } if (strlen($c_pass1) <= '8') { echo "<b>your password must contain @ least 8 characters!</br>"; //check passwords }elseif ($c_pass1 == $c_pass2) { $q = "insert cus_register(cus_email,cus_password,cus_confirm_password) values (?,?,?)"; $stmt = mysqli_prepare($dbc, $q); //new // $stmt = mysqli_prepare($dbc, $insert_c); //debugging //$stmt = mysqli_prepare($dbc, $insert_c) or die(mysqli_error($dbc)); mysqli_stmt_bind_param($stmt, 'sss', $c_email, $c_pass1, $c_pass2); if ($q) { echo "<script> alert('registration sucessful')</script>"; } } else { echo "<b>oops! passwords not </b>"; } } ?>
say had tag text , have code
<? echo '<t>this text'; ?> to add styles have style "t" tag in css
t{ font-size:3px; background-color:red; // other styles }
Comments
Post a Comment