Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Location
    UK
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Creating Registration

    I know i'm a newbie but pls do take me seriously. I would like to know if there is an javascript which collects the ip of a registering user and then reports it to you (the webmaster) so it is possible to ban them from your site if you think they are abusing it? This would be a great help to me if it's possible. Im only 13 and would appreciate it if someone could help. Im also interested in cookies, would be able to collect information about a user like "find how many times he/she has downloaded something"?

    Someone PLEASE Reply

    - Chris
    I Luv Sarah 4eva
    (a.k.a Buffy)

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry to disappoint you, but JavaScript is not suited for the tasks you described. You see, it's a client-side scripting language. That means it only runs in the browser of the user.

    What you need is a server-side solution. There are plenty of languages that can serve your purpose, you'll first have to check out which your host provides. But maybe then your post is better located in the server-side forums.

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Location
    UK
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, so is server side like a online data base
    I Luv Sarah 4eva
    (a.k.a Buffy)

  • #4
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well not necessarily. You could use a bit of java to pick up an ip address and then use a mail function to mail this to you.

    eg.

    <script language="javascript">
    <!-- Original: Hostroute.com -->
    <!-- Web Site: http://www.hostroute.com/script_ip.html -->

    var ip = '<!--#echo var="REMOTE_ADDR"-->'

    function ipval() {
    document.myform.ipaddr.value=ip;
    }
    </script>

    You would then have to use some server side scripting to package this off and send it via a mail to you.

    For that though, look up CDONTS or JMail. Then again, if you're on a free server you're pretty much snarfed coz not mailing provide these services!

    Good luck though,

    ih.

  • #5
    New to the CF scene
    Join Date
    Aug 2002
    Location
    UK
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok say lets say i ONLY needed to have the ip sent to me. would i have to have server side or is it always aviliable?
    I Luv Sarah 4eva
    (a.k.a Buffy)

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Trust me, you want a server-side solution.

    What ihitman posted was not java, but simpy a javascript that writes a variable's content into a form field. Though that seems to imply that it's possible to retrieve the IP via javascript, it's not true. The variable is generated through a server-side include (the <!--#echo var="REMOTE_ADDR"--> part).

    There is absolutely no point in first writing the IP to the HTML output, and then trying to send it to you. It can be all done server-side at once without the involvement of javascript at all.

  • #7
    New to the CF scene
    Join Date
    Aug 2002
    Location
    UK
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey i no im kinda goin off topic here but wot exactly is server side?
    I Luv Sarah 4eva
    (a.k.a Buffy)

  • #8
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah soz Mordred, that snippet was just a piece of code I found in a very BIG javascript folder I've got.

    And Phoenix, check out this site : http://www.thescripts.com/serversidescripting/
    It should provide you with everything you need to know...

    ih.

  • #9
    New to the CF scene
    Join Date
    Aug 2002
    Location
    UK
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok thanks guys, u'v been a great help
    I Luv Sarah 4eva
    (a.k.a Buffy)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •