#1
  1. No Profile Picture
    Marcello
    Guest
    Devshed Newbie (0 - 499 posts)
    I've had this new idea for a js, but I am not a programmer (I think it's simple anyway but I've never seen it around)

    This is what should happen:

    IF USER HOMEPAGE IS NOT "MyUrl" GO TO GOODBYE PAGE

    ELSE CONTINUE ON THIS HTML

    This is for rewarding people thet have my URL as their homepage, leting them see "secret" pages. I think there is a function to check the URL default as homepage, if not could be done through the nav. history.

    Can somebody help me, should be simple for a programmer

    Thank you very much

    Bye !!!
  2. #2
  3. No Profile Picture
    tack
    Guest
    Devshed Newbie (0 - 499 posts)
    make index.html do this:

    <body onload="document.location ='friend.html'">

    and put this in index2.html:

    function check(){
    if(window.history.length == 2){
    document.location = 'friend.html'
    }
    }

    <body onload="check()">

    window.history.length won't tell you if it's the homepage, but it will tell you how many pages have been opened in that window. The onload script in index.html forwards the user to index2.html so that if people bookmark your site, they are actually bookmarking index2.html. So in index2.html, we check() to see if we are the first page this window has loaded (if accessed via bookmark), or the second page. If they actually typed in the URL as their homepage they would have gone to index.html first, so now we know that IF the user has a home page set in their browser, then it is your homepage.

    this code is not debugged, and I assume you can figure out how to add it to your site if it's worth it to you.


    have fun

    dan

Similar Threads

  1. Opinions on an idea
    By dog135 in forum Dev Shed Lounge
    Replies: 3
    Last Post: December 3rd, 2003, 11:06 AM
  2. game idea...Need help....
    By punkin111 in forum Project Help Wanted
    Replies: 3
    Last Post: October 6th, 2003, 10:16 AM
  3. Security check idea - PHPSESSID
    By james555 in forum PHP Development
    Replies: 2
    Last Post: December 19th, 2002, 03:57 PM
  4. Replies: 2
    Last Post: January 11th, 2002, 09:25 AM
  5. No idea on how to connect to mySQL, please help
    By darthmahon in forum MySQL Help
    Replies: 1
    Last Post: January 7th, 2002, 05:31 AM

IMN logo majestic logo threadwatch logo seochat tools logo