SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Getting the value of a form onLoad

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    England
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting the value of a form onLoad

    I have a page which is generated by Lotus Domino. The IP address is placed in a hidden form variable in a page.
    What I want to do is to take the IP address from the form variable (called REMOTE_ADDR) and then redirect the user to a different site if the IP matches a certain address.

    Any ideas how I can get the value of a hidden form as soon as the page loads?

    Many thanks

    K

  2. #2
    ¿uʍop ǝpısdn ʎɥʍ velocd's Avatar
    Join Date
    Aug 2002
    Location
    California
    Posts
    449
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you could do such a check much more easily through PHP or a script process. When you submit the form, just do a check to see if $_POST['REMOTE_ADDR'] equals or is in whatever list of blocked IP addresses you don't want. Then, if it is, redirect from there.
    PHP Code:
    header("Location: http://www.example.com/"); 
    Or a way through javascript with redirecting:
    http://www.devscripts.net/browse.php?script=31

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    England
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I had just worked out how to get the value of the form. The redirect script you linked to was really helpful - its done the job.

    Cheers

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
  •