Closed Thread
Results 1 to 8 of 8




  

Thread: Showing some HTML only on first visit thru php?

      
  1. #1
    The Force is Strong! JuggernautH is a jewel in the roughJuggernautH is a jewel in the roughJuggernautH is a jewel in the roughJuggernautH is a jewel in the roughJuggernautH is a jewel in the rough JuggernautH's Avatar
    Join Date
    March 12, 2007
    Location
    Sweden
    Posts
    585
    Rep Power
    6
    Feedback Score
    0

    Default Showing some HTML only on first visit thru php?

    Anyone have any ideas on how to do this? Want some HTML to only show up when the visitor first view the page.

  2. #2
    Jedi Master JHalstead will become famous soon enoughJHalstead will become famous soon enoughJHalstead will become famous soon enough JHalstead's Avatar
    Join Date
    January 3, 2008
    Location
    OKC, OK - USA
    Posts
    147
    Rep Power
    5
    Feedback Score
    0

    Default

    Something like this should work for you. Create a cookie and check said cookie to see if you need to output HTML.

    Scratch that, I'll look at this again when I get home.
    Last edited by JHalstead; Jan 3rd, 2008 at 3:02 pm. Reason: error in code

  3. #3
    Idolized By All noppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nice noppid's Avatar
    Join Date
    October 12, 2006
    Location
    Florida
    Posts
    487
    Rep Power
    6
    Feedback Score
    0

    Default

    First time ever and never ever again? First time in a new session?

    There are so many ways to think about this, 20 coders could give 20 different answers that all work and not serve your need.

    But cookies can help and sessions with DB records can certainly do it, but in the best case scenario if the case if never ever again, a user DB would be needed.
    Free vBulletin hacks and vBulletin Support.
    Talk to bikers around the world about motorcycles.
    Clogging an american dance step.

  4. #4
    The Force is Strong! JuggernautH is a jewel in the roughJuggernautH is a jewel in the roughJuggernautH is a jewel in the roughJuggernautH is a jewel in the roughJuggernautH is a jewel in the rough JuggernautH's Avatar
    Join Date
    March 12, 2007
    Location
    Sweden
    Posts
    585
    Rep Power
    6
    Feedback Score
    0

    Default

    Well first time and every first time you've closed your browser, so it only shows once if you do not close your browser.

  5. #5
    Idolized By All noppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nice noppid's Avatar
    Join Date
    October 12, 2006
    Location
    Florida
    Posts
    487
    Rep Power
    6
    Feedback Score
    0

    Default

    A cookie could do it. But cookies are blocked by so many these days it's possible it could not work for all.

    A session is likely the best bet I would speculate.
    Free vBulletin hacks and vBulletin Support.
    Talk to bikers around the world about motorcycles.
    Clogging an american dance step.

  6. #6
    The Force is Strong! JuggernautH is a jewel in the roughJuggernautH is a jewel in the roughJuggernautH is a jewel in the roughJuggernautH is a jewel in the roughJuggernautH is a jewel in the rough JuggernautH's Avatar
    Join Date
    March 12, 2007
    Location
    Sweden
    Posts
    585
    Rep Power
    6
    Feedback Score
    0

    Default

    Well how do i make a php script to do this? I'm kind of bad at it as i haven't coded php that much lately

  7. #7
    Idolized By All noppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nicenoppid is just really nice noppid's Avatar
    Join Date
    October 12, 2006
    Location
    Florida
    Posts
    487
    Rep Power
    6
    Feedback Score
    0

    Default

    If you are not collecting any personal info, a simple sessions code block found on the net will solve the problem. If it's personal info, I would hire a professional or use a service. Too much liability.

    It's not a difficult job to do, getting it right is important though for your needs and covering your butt and your users info.

    noppid added 5 Minutes and 8 Seconds later...

    See this post Webmaster Discussion Forums - View Single Post - form posts and .htaccess
    Last edited by noppid; Jan 4th, 2008 at 7:01 am. Reason: Automerged Doublepost
    Free vBulletin hacks and vBulletin Support.
    Talk to bikers around the world about motorcycles.
    Clogging an american dance step.

  8. #8
    The Force is Strong! jumpenjuhosaphat is a jewel in the roughjumpenjuhosaphat is a jewel in the roughjumpenjuhosaphat is a jewel in the roughjumpenjuhosaphat is a jewel in the roughjumpenjuhosaphat is a jewel in the roughjumpenjuhosaphat is a jewel in the rough
    Join Date
    January 5, 2008
    Location
    Denver, Colorado
    Posts
    121
    Rep Power
    5
    Feedback Score
    0

    Default

    I think that using a session is the best in your situation...But you have to keep in mind that the 3 major SE's don't care much for session ID's...Do you mind if I ask what you are doing? Cookies can be quite useful, you can use a cookie, and have the cookie expire within 10 minutes of no use, and have it re start everytime a new page is loaded...I have done this with a few script before...I try to avoid sessions at all costs. Basically, if the person leaves your website for 10 minutes or more, or idles for 10 minutes or more, they will be shown the front page of the site....Once they have seen the front page of the site....On and on....

    It's true that there are a few people who believe that disabling cookies is a security feature, however, most people nowadays are smarter than that, and continue to allow cookies...Especially considering that most of the internet wouldn't be available to them if it weren't for enabling cookies...I would say that less than 1% of internet users disable cookies.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Using Both home.html and index.html
    By zxpro168 in forum SEO Forum
    Replies: 14
    Last Post: Jun 10th, 2008, 6:47 am
  2. Showing Traffic Stats Publicly - Good or Bad?
    By Jani in forum General Business
    Replies: 8
    Last Post: Apr 8th, 2008, 4:46 pm
  3. Top vBulletin - come visit!
    By Ohiosweetheart in forum Forum Management
    Replies: 15
    Last Post: Dec 13th, 2006, 8:04 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
WebTalkForums
WebTalkForums
Recent Forum Threads