kirkh34 Posted December 19, 2009 Share Posted December 19, 2009 Hello, I'd like to have a login form appear only when a link is clicked...is there any way to do this only using php? Quote Link to comment https://forums.phpfreaks.com/topic/185710-hidden-login-form/ Share on other sites More sharing options...
ignace Posted December 19, 2009 Share Posted December 19, 2009 It's not possible using PHP. You can use JavaScript for it though: <a href="#" onclick="javascript:showForm();">Show Form</a> <form id="someForm" style="display: none;" action="" method="post"> <label for="inputField">Label Name</label> <input type="text" name="inputField" id="inputField" /> </form> <script type="text/javascript"> function showForm() { var someForm = document.getElementById('someForm'); if ("block" == someForm.style.display) { someForm.style.display = "none"; } else { someForm.style.display = "block"; } } </script> Quote Link to comment https://forums.phpfreaks.com/topic/185710-hidden-login-form/#findComment-980616 Share on other sites More sharing options...
kirkh34 Posted December 19, 2009 Author Share Posted December 19, 2009 hmm this is the first time i've tried to mess w/ javascript, it seems a lot like php but i'm having some probs, my form still shows no matter what i do, but it's inside of a table...i dont know if that's a prob, but i took the test form you put in to test it and i can't get the link to work, what do i put in href? is the # sign okay for that? Quote Link to comment https://forums.phpfreaks.com/topic/185710-hidden-login-form/#findComment-980637 Share on other sites More sharing options...
George Botley Posted December 19, 2009 Share Posted December 19, 2009 Take a look here.. www.torindul-designs.co.uk My company website - cast your eyes to the Client Area button at the bottom right of the page, click it.... Is this something your after? I can provide the code for such addon for you if you require something similar, this is called an inline frame - not detecting by pop-up blockers for that reason and can load content of an internal/external page, in your case your login document whether in another directory or not. Quote Link to comment https://forums.phpfreaks.com/topic/185710-hidden-login-form/#findComment-980654 Share on other sites More sharing options...
kirkh34 Posted December 19, 2009 Author Share Posted December 19, 2009 that's pretty awesome...how complicated is that code? i was thinking of something more basic where it just pops up html right on the page, but i'll take any code, i desire to learn Quote Link to comment https://forums.phpfreaks.com/topic/185710-hidden-login-form/#findComment-980663 Share on other sites More sharing options...
George Botley Posted December 19, 2009 Share Posted December 19, 2009 The code isn't that hard to learn, infact its an adaptation of a few pre-built javascript codes. The code wasn't made by me, http://jquery.com/demo/thickbox/ - there is the website address demonstrating how to install and use it correctly within your site, it takes seconds to implement. The content it shows is within another file. Quote Link to comment https://forums.phpfreaks.com/topic/185710-hidden-login-form/#findComment-980667 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.