5 Replies - 2280 Views - Last Post: 10 April 2009 - 01:03 AM Rate Topic: -----

#1 jeffmc21  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 64
  • Joined: 27-November 07

Coldfusion - create "permanently bypass" on splash page

Post icon  Posted 09 April 2009 - 11:57 AM

I have a splash page for our site (not my choice, but my client wants it), and I need to add an option to "permanently bypass" beside the enter store option.

Anyone have any idea or advice on how to create that so that it works properly?
Is This A Good Question/Topic? 0
  • +

Replies To: Coldfusion - create "permanently bypass" on splash page

#2 xheartonfire43x  Icon User is offline

  • D.I.C Regular

Reputation: 46
  • View blog
  • Posts: 454
  • Joined: 22-December 08

Re: Coldfusion - create "permanently bypass" on splash page

Posted 09 April 2009 - 12:26 PM

View Postjeffmc21, on 9 Apr, 2009 - 10:57 AM, said:

I have a splash page for our site (not my choice, but my client wants it), and I need to add an option to "permanently bypass" beside the enter store option.

Anyone have any idea or advice on how to create that so that it works properly?


There are a couple ways of doing it. The only one that I really know though is using a query and the client computer's IP address. So what you would need to do is make a table in your DB called something like BypassSplash with columns like RemoteIP,Bypass and do a query everytime someone comes to the site.

SQL for entry to site
SELECT bypass FROM BypassSplash WHERE RemoteIP = <cfqueryparam value="#REMOTE_ADDR#">


If the recordcount is greater than one send them passed the splash... if not show the splash. And then when someone says that want to permanently bypass the splash add them to the table.

You can probably also do it with cookies and other stuff like that but I don't know how. Also if you are doing a user based website you could just do it by user.
Was This Post Helpful? 0
  • +
  • -

#3 sansclue  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 316
  • Joined: 21-November 07

Re: Coldfusion - create "permanently bypass" on splash page

Posted 09 April 2009 - 01:47 PM

Unfortunately, it sounds like you are dealing with anonymous visitors at that point (ie not logged into your application). So I think your choices are what xheartonfire43x mentioned. Regular or flash cookies are probably your best bet. But keep in mind there is no bullet proof option. Visitor IP's are often dynamic and they can obviously disable cookies.
Was This Post Helpful? 0
  • +
  • -

#4 jeffmc21  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 64
  • Joined: 27-November 07

Re: Coldfusion - create "permanently bypass" on splash page

Posted 09 April 2009 - 02:51 PM

Would either you guys know how to use cookies to do it?

That sounds like the simplest option (and I'd though that might be how), but I know virutally nothing about CF or dynamic programming in general. So cookies are new to me, other than knowing they exist and their general purpose.
Was This Post Helpful? 0
  • +
  • -

#5 sansclue  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 316
  • Joined: 21-November 07

Re: Coldfusion - create "permanently bypass" on splash page

Posted 09 April 2009 - 04:03 PM

View Postjeffmc21, on 9 Apr, 2009 - 01:51 PM, said:

Would either you guys know how to use cookies to do it?

That sounds like the simplest option (and I'd though that might be how), but I know virutally nothing about CF or dynamic programming in general. So cookies are new to me, other than knowing they exist and their general purpose.


The logic is simple. If the "DontShowSplashPage" cookie exists, direct the user to pageA. Otherwise, direct the user to pageB. The rest is just a matter of writing the basic CF code. But I will say that in most respects, working with cookies is almost like working with regular variables. Except you use <cfcookie> instead of cfset.

<cfcookie name="DontShowSplashPage" value="no" expires="never">

Determining if a cookie exists is also the same, except you would use the "cookie" scope, instead of VARIABLES, FORM, etc...

<cfif structKeyExists(COOKIE, "DontShowSplashPage")>
	  do something
<cfelse>
	  do something else
</cfif>



Just watch out for the common gotcha's with cookies. A lot of people think you can set and retrieve them on the same page. Since cookies are stored in the browser (ie client), obviously that doesn't work ;-) Also, watch out for using cflocation and cfcookie in the same page. I don't know about CF8, but in older versions you could mix the two.

Give it a shot, and post back with any problems. Though I would strongly suggest reading the documentation on cfcookie before you get started.
http://livedocs.adob.../Tags_c_12.html
Was This Post Helpful? 0
  • +
  • -

#6 sansclue  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 316
  • Joined: 21-November 07

Re: Coldfusion - create "permanently bypass" on splash page

Posted 10 April 2009 - 01:03 AM

Update:: Lol, nevermind. I can see I am just repeating what others have said on your other thread
http://www.sitepoint...ad.php?t=610209

The logic is simple. If the "DontShowSplashPage" cookie exists, direct the user to pageA. Otherwise, direct the user to pageB. The rest is just a matter of writing the basic CF code. But I will say that in most respects, working with cookies is almost like working with regular variables. Except you use <cfcookie> instead of cfset.

<cfcookie name="DontShowSplashPage" value="no" expires="never">

Determining if a cookie exists is also the same, except you would use the "cookie" scope, instead of VARIABLES, FORM, etc...

<cfif structKeyExists(COOKIE, "DontShowSplashPage")>
	  do something
<cfelse>
	  do something else
</cfif>



Just watch out for the common gotcha's with cookies. A lot of people think you can set and retrieve them on the same page. Since cookies are stored in the browser (ie client), obviously that doesn't work ;-) Also, watch out for using cflocation and cfcookie in the same page. I don't know about CF8, but in older versions you could mix the two.

Give it a shot, and post back with any problems. Though I would strongly suggest reading the documentation on cfcookie before you get started.
http://livedocs.adob.../Tags_c_12.html

This post has been edited by sansclue: 10 April 2009 - 01:04 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1