gazfocus Posted August 16, 2011 Share Posted August 16, 2011 Really looking for some help as soon as possible as I'm going round the twist with this one. I've been an online shop for a client and Google Adwords have stipulated that it needs to have an Age gate before entering the site. Obviously this will impact SEO so what I want to do is have some javascript that will hide all of the home page content and show the age verification form, then if the visitor clicks to say they're over 18, the home page content 'unhides' itself for the rest of that visit.. If they click they're not over 18, they're taken to a page to say they're not old enough to enter. Can anyone PLEASE help me? Quote Link to comment https://forums.phpfreaks.com/topic/244929-age-verification-script/ Share on other sites More sharing options...
Adam Posted August 16, 2011 Share Posted August 16, 2011 You mean you've been developing an online shop for a client? Quote Link to comment https://forums.phpfreaks.com/topic/244929-age-verification-script/#findComment-1258147 Share on other sites More sharing options...
gazfocus Posted August 16, 2011 Author Share Posted August 16, 2011 I do indeed You got my hopes up then thinking someone had a solution Quote Link to comment https://forums.phpfreaks.com/topic/244929-age-verification-script/#findComment-1258161 Share on other sites More sharing options...
Adam Posted August 16, 2011 Share Posted August 16, 2011 Well then as it's for a *client*, and you will be paid for the work, I think you would be better posting this in the freelance section. Don't want to sound obnoxious here, but you have the theory in your head so it's a case of putting it into code. If you need help writing that code, then whoever helps you should rightly get part of your earnings. Quote Link to comment https://forums.phpfreaks.com/topic/244929-age-verification-script/#findComment-1258174 Share on other sites More sharing options...
gazfocus Posted August 16, 2011 Author Share Posted August 16, 2011 Well then as it's for a *client*, and you will be paid for the work, I think you would be better posting this in the freelance section. Don't want to sound obnoxious here, but you have the theory in your head so it's a case of putting it into code. If you need help writing that code, then whoever helps you should rightly get part of your earnings. Well techincally I'm not getting paid for it because I've been paid for developing the online shop. They've now thrown in this problem and I'm not getting paid anymore for it. Also I was asking if someone can point me in the direction of tutorials or something. Afterall, the point of this site is to help people is it not? Quote Link to comment https://forums.phpfreaks.com/topic/244929-age-verification-script/#findComment-1258178 Share on other sites More sharing options...
Adam Posted August 16, 2011 Share Posted August 16, 2011 That's correct, PHPFreaks is here to teach. At the same time though, as I'm sure you can appreciate, I don't believe the aim is take away paid-jobs from hard-working developers. Just giving the solution away for free to someone who doesn't put in the time to learn it, ultimately makes them easy money off the community that should have gone to someone else. Anyway, it was just a misunderstanding. Your first post struck me as a specification more than anything else. Back to your original question... Personally I would avoid JavaScript as much as possible for this, as anyone with JS disabled would bypass the verification without knowing. You can detect if they have the cookie set on the PHP-side, and then display the overlay hiding the content if it's not. The overlay itself would be just simple HTML/CSS mark-up included at the end of the page, and would only be a 'gate' to anybody visually viewing the content - not search engines. Also be aware of how cookies work, as when you set them they're not actually available until the next request. So when the user enters their age, assuming it's valid, you need to ensure that both the cookie isn't set and a valid age hasn't been posted, before displaying the overlay. Aopart from that there's not really much I can suggest right now. Quote Link to comment https://forums.phpfreaks.com/topic/244929-age-verification-script/#findComment-1258198 Share on other sites More sharing options...
codefossa Posted August 17, 2011 Share Posted August 17, 2011 I'll point you in the correct direction, but I'm not doin' the work for ya when you're gettin' paid. From the sounds of it, you want two options before the page shows it's contents. To do this a bit of a 'nicer' way, you can have it, when click, load the contents of an external page into a div. JQuery: click() When they click, you wanna get the contents of the other page, and put them into the div. JQuery: load() If you wanted to throw me a few bucks, I'd happily write it for ya. Quote Link to comment https://forums.phpfreaks.com/topic/244929-age-verification-script/#findComment-1258480 Share on other sites More sharing options...
Adam Posted August 17, 2011 Share Posted August 17, 2011 As I mentioned before, I would avoid JavaScript for this. That said, you can of course add some JavaScript richness to it, but you should first concentrate on ensuring it works without it. I'm not at all familiar with Google's verification policies, but using JS alone may invalidate it for reasons I mentioned before. Quote Link to comment https://forums.phpfreaks.com/topic/244929-age-verification-script/#findComment-1258484 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.