steviez Posted February 14, 2007 Share Posted February 14, 2007 Hi, On my website when users signup i want them to have to click the "i agree to the terms of user" before they can signup. I have been trying for ages now and cant get it to work. How is this done? Thanks Link to comment https://forums.phpfreaks.com/topic/38482-solved-somthing-simple/ Share on other sites More sharing options...
Balmung-San Posted February 14, 2007 Share Posted February 14, 2007 You're going to have to be a bit more specific then that. There are a ton of ways to have an "I agree to ..." built in, it's a matter of what you're looking for. I know that phpBB puts up the ToS on a page, then for the agree link it sends you back to the same page with a variable attached to the back of the url, then in the page they check for the value, and output accordingly. Another common way is to have a checkbox at the bottom of your registration form. When they submit it you can then check whether or not it's checked. It all really depends on how you want to do it. Link to comment https://forums.phpfreaks.com/topic/38482-solved-somthing-simple/#findComment-184608 Share on other sites More sharing options...
steviez Posted February 14, 2007 Author Share Posted February 14, 2007 I just want a check box on my signup page Link to comment https://forums.phpfreaks.com/topic/38482-solved-somthing-simple/#findComment-184611 Share on other sites More sharing options...
Jessica Posted February 14, 2007 Share Posted February 14, 2007 <input type="checkbox" name="terms" value="1"> I agree <input type="checkbox" name="terms" value="1" CHECKED> I agree <-- prechecked if(isset($_POST['terms']) && $_POST['terms'] == 1){ //they agreed. } Link to comment https://forums.phpfreaks.com/topic/38482-solved-somthing-simple/#findComment-184613 Share on other sites More sharing options...
steviez Posted February 14, 2007 Author Share Posted February 14, 2007 It wont work for me. I just want it to validate if the user has checked it Link to comment https://forums.phpfreaks.com/topic/38482-solved-somthing-simple/#findComment-184621 Share on other sites More sharing options...
Balmung-San Posted February 14, 2007 Share Posted February 14, 2007 It wont work for me. I just want it to validate if the user has checked it Explain "won't work". jesirose's code is a perfect example on how to do exactly what you want. Link to comment https://forums.phpfreaks.com/topic/38482-solved-somthing-simple/#findComment-184626 Share on other sites More sharing options...
steviez Posted February 14, 2007 Author Share Posted February 14, 2007 If the box is not checked it still posts the form without an error or message saying "you must agree to our terms of use" Link to comment https://forums.phpfreaks.com/topic/38482-solved-somthing-simple/#findComment-184634 Share on other sites More sharing options...
Balmung-San Posted February 14, 2007 Share Posted February 14, 2007 You'd need JavaScript. Link to comment https://forums.phpfreaks.com/topic/38482-solved-somthing-simple/#findComment-184638 Share on other sites More sharing options...
Jessica Posted February 14, 2007 Share Posted February 14, 2007 You need to do client side validation as WELL as javascript, but what you want is javascript. Link to comment https://forums.phpfreaks.com/topic/38482-solved-somthing-simple/#findComment-184648 Share on other sites More sharing options...
steviez Posted February 14, 2007 Author Share Posted February 14, 2007 Link to comment https://forums.phpfreaks.com/topic/38482-solved-somthing-simple/#findComment-184783 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.