jquery mobile and php headers break buttons on next page -
i making login php file uses headers redirect different types of users , when ever redirects user specific page buttons on page become un-clickable. me?
login html:
<form action="login-all.php" method="post"> <lable>login:</lable> <input type="text" id="name" name="name" placeholder="first name"/> <input type="password" id="pass" placeholder="password" name="pass"/> <button type="submit">log-in</button> </form>
php:
if($role === '1' ) { //1 admin - 0 user header('location: admin.php'); //echo "admin"; }else{ header('location: user.php'); //echo "user"; }
buttons on user.php (not working header redirect)
<a href="#input"><button>input</button></a> <a href="#submit"><button>submit</button></a>
wrapping button anchor tag doesn't work (see: http://jsbin.com/ekozud/1/). instead, need add event listeners click event of each of buttons javascript:
<button id="google">go google</button> <script> function gotogoogle() { document.location = 'http://www.google.com'; } if(document.addeventlistener) { document.getelementbyid('google').addeventlistener('click', gotogoogle); } else { document.getelementbyid('google').attachevent('onclick', gotogoogle); } </script>
of course problem approach if client doesn't have js (or doesn't have enabled), these buttons not work. suggest instead using anchor no buttons , styling links buttons (if need button look).
Comments
Post a Comment