SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JAVASCRIPT REFERRER URL

    Dear Friends,

    I have very important thing to ask. Need help solving this issue as Javascript seems to be difficult for me more than PHP, etc..

    I know asking to provide me whole code sounds funny. You all must have something important to do. But if you can help me code these, i will be able to finish my project. I can only use html pages and therefor, no service side can be used... so i want to do this in java.


    User visits www . domain . ext
    Or visits any internal pages www.domain.ext/subfolder

    This will redirect them to www.domain.ext/verify.html
    To accept that this site is not for kids. (don't worry, its not for nudity or adult etc)

    When they click No, i send them directly to Google.com so thats working fine.


    When they click yes they are 18. Then they should go back to where they came from the sites page and this time that sites main page or the site's subfolder page will not redirect them to verify.html


    So i need as simple as possible the code. This is going to be done through cookie i am sure... so cookie should get expire after minutes.... like 15 minutes. After 15 minutes, if they visit, they should be redirected again. If they clean the cookies, they will be redirect again... etc etc.


    So, what is needed


    For header file of every page in site:

    JS Code to: redirect them for verification. to: verify.html?ref=previous-url-from-where-they-were-redirected


    For verify.html

    "No" Click will goto Google. Simple Anchor... So i can do that

    "Yes" Click will take them to verifIED.html??ref=previous-url-from-where-they-were-redirected <=== here you might want to activate cookie with 15 minutes and then redirect them to from where they came.

    Verified.html??ref=previous-url-from-where-they-were-redirected will create the cookie for 15 minutes and http refresh to the ref url from query string. so that the whole site (through header file) can allow him to stay on the site without being redirected to verify.htm again



    I know it is tough thing to help someone with that much details, but i am here with hope that someone can take some time to provide me all these codes. And treat me as baby as much as possible so that you don't leave any code to assumed by me

    For example, most of the experts give js function code... but duffer like me don't know that the function needs to be called as well. So please explain all these things.

    I am really hoping to receive a great reply without being insulted as on other forum, someone said, that WHY SHOULD BE WRITE ALL THESE FOR YOU. But anyways, its their right to say that. But its my humble request to provide me the code. As i really tried using Google search and couldnt find.

    If it was php, i would have done this in minutes... but it should be done in html pages


    Thanks

    Waiting....

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2012
    Location
    Tinker Air Force Base, Oklahoma, United States
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Couldn't you just go back one page in the history?

  3. #3
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Ron for your reply. But it has nothing to do with my whole required code You did not read my post. But Thanks for taking time.

  4. #4
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mhquestions View Post
    Javascript seems to be difficult for me more than PHP
    Well that's handy because this is a job for PHP and it doesn't involve reading the referrer.

    You redirect to the confirmation page in the absence of a cookie that you set on it.
    Tab-indentation is a crime against humanity.


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
  •