Copy link to clipboard
Copied
I've been asked to create a page that only shows up once for a user. This page is to include a form that the user fills out, but once the user has filled it out, they wouldn't see the page pop up ever again. Does anyone know the best way to do this?
I was told to build an ip logger that checks the database for ip addresses and only shows the page if the ip address is unique. That might be way beyond my ability. Is there a program out there that I could possibly use?
My client wants this done asap, so any help would be much appreciated...
Thanks in advance!
Jules
Copy link to clipboard
Copied
Use cookies or have user login and then update their table row to show or hide the desired content.
best,
Shocker ![]()
Copy link to clipboard
Copied
>I was told to build an ip logger that checks the database for ip
>addresses and only shows the page if the ip address is unique.
That's not really going to work. Your problem is a difficult one. How do you define 'the same user' ?
IP addresses on the internet do not uniquely identify individual computers, let alone users. Virtually all company's use NAT routers which mean that hundreds of computers inside the company share the same IP address that your site will see. And most household internet providers use DCHP, or some other type of dynamically allocated IP address, which means a households address is always changing. Finally, users often have more than one computer, and many people often share the same computer. The most reliable method would be to have the user login so you can 'positively' identify them.
So to start, you need to define what you mean by 'the same user'.
Copy link to clipboard
Copied
I guess I should have posted my client's site example: http://www.barackobama.com
Once you've entered the site the first time, the sign up page doesn't show again. I haven't dealved into the code on the page to see what they have done. I'm assuming they used "cookies" or something. Oh, and once you have been there, you can't get back in, which could end up being annoying to the site user if they decided they did want to sign up, after all.
I see the argument about the ip address. Wasn't thinking about ip addresses changing... you are totally right about that! I do realize that not everyone has a static ip. Good point!
Copy link to clipboard
Copied
is using cookies to control the splash page. You do understand the limitations associated with cookies, right?
Copy link to clipboard
Copied
Some limitations of cookies are that user needs to enable cookies, cookies expire, cookies can be deleted by the client, and they're dependent on the machine/browser that the cookie was set to. Basically, by using cookies, you as a developer do not have any control over the presentation of the data for the visitor because the visitor can manipulate how the data is presented.
That means if more than one person shares the same browser on the same computer then after user 1 visits the page and sets the cookie then users 2,3,4 or whatever will not see the landing page that was intended for a first time visitor since user 1 already set the cookie. Once cookie expires the script will not see a valid cookie so the landing page will display once again. If cookies are disabled on the browser then a cookie will never be set and the landing page will always display. If cookies are enabled on the browser and cookie is set by a user then later the user deletes the cookie from their browser then the landing page will display.
Cookies can be set and checked using javascript or server side scripting. There's plenty of information on the limitations of cookies and how to set and check for set cookies if you search online for php cookies, javascript cookies, etc. or visit http://www.w3schools.com/PHP/php_cookies.asp
Control of your data from a database is the best method of development. If you do not have a registration system currently developed and it's imperative for each individual user to complete the form before continuing on to the site, then the form you speak of *IS* the registration form and should be developed with a database. What information does the user have to complete on this form?
Sometimes there are situations where you do not want to force a signup/login for the user to access a page, yet you still want to control data to some extent. In these scenarios the use of cookies is the only reasonable alternative, which is arguably better than using an IP method. It really all depends on the circumstances that are being considered. Personally I don't think this situation is well suited for cookies or IP use. Based off the information provided I believe this should be developed using a database and server side scripting. It also depends on the importance of the page that is being displayed after the landing page and the importance of the data retrieved from the submitted form on the landing page. If it's of low importance then go with a compromised method such as cookies or IP. If the data is important then use a database.
best,
Shocker ![]()
Find more inspiration, events, and resources on the new Adobe Community
Explore Now