Thread: html form - writing ip to a hidden field

  1. #1
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385

    html form - writing ip to a hidden field

    I understand that you can use hidden input fileds on html forms and i also know how to use a javascript to trap someones ip address, is there any way of writing the ip address to a hidden filed?
    thanks in advance
    Monday - what a way to spend a seventh of your life

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Not too sure what you are trying, but to create a hidden feild try;

    <INPUT TYPE="HIDDEN" NAME="IP">
    Out of interest, what are you working on?

  3. #3
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    its a competition form and an attempt to block multiple entries i want to get the ip address of the user submitting it. I have setup a hidden filed to recieve the ip address and have written the javascript to get the ip address, im just having trouble writing the ip addresss to the hidden field
    Monday - what a way to spend a seventh of your life

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    What are you doing on the server end? Wouldnt it be easier to do this there?

  5. #5
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    it probably would, but the server i am on is hired by a friend and wed ont have full root access, if there is a way to do it without root please let me know. We are however considering investing in our own server.
    Monday - what a way to spend a seventh of your life

  6. #6
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Does the host offer any cgi at all? PERL Maybe?

  7. #7
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    yes we have access to cgi, perl, mysql and php
    Monday - what a way to spend a seventh of your life

  8. #8
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    You should be able to do it..... but I'm not to good yet with perl and I have no php skill at all.

    Have a peek at this.
    I found the site today and it has a lot of examples for PERL, PHP and JavaScript.

    Might have some ideas here....

  9. #9
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Just an observation on your proposed technique. Most ISP's allocate an IP address at connect time, and it varies from connection to connection. By storing and checking the address, you cannot be sure that you will block multiple entries.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  10. #10
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    >>Just an observation on your proposed technique. Most ISP's allocate an IP address at connect time, and it varies from connection to connection. By storing and checking the address, you cannot be sure that you will block multiple entries.


    He he.... thats very true...... Maybe your best option is through cookies? Still open to abuse, but easier to manage...... And I think you can use them with Jscript... cant you?

  11. #11
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    If you have code running on the client, get the MAC adress of the modem/NIC. That will get you even those in LAN's.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  12. #12
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    I think i may revert to cookies - a cookie javascript seems easier.
    As for trapping the mac address of a modem - how do you do that? this is not for my site - just out of interest.

  13. #13
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    >>As for trapping the mac address of a modem - how do you do that? this is not for my site - just out of interest.

    I didnt know you could do that.

  14. #14
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Use a NCB and Netbios().

    But if you can get the MAC there is no other MODEM/NIC with that number -> positive ID of PC.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  15. #15
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Use a NCB and Netbios().

    But if you can get the MAC there is no other MODEM/NIC with that number -> positive ID of PC.

    Yeah I know..... but how do you access that with JavaScript?

    Is it possible????????????

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extract IP from HTML of webpage
    By John87412897 in forum Networking/Device Communication
    Replies: 10
    Last Post: 09-03-2008, 05:51 PM
  2. Writing an HTML Preprocessor
    By thetinman in forum C++ Programming
    Replies: 1
    Last Post: 09-17-2007, 08:01 AM
  3. Obtaining source & destination IP,details of ICMP Header & each of field of it ???
    By cromologic in forum Networking/Device Communication
    Replies: 1
    Last Post: 04-29-2006, 02:49 PM
  4. Submitting HTML form and parse respons
    By IdunnO in forum Networking/Device Communication
    Replies: 4
    Last Post: 03-07-2006, 10:28 AM