View Full Version : Creating Registration

08-08-2002, 01:45 PM
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

08-08-2002, 03:50 PM
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.

08-08-2002, 06:50 PM
Ok, so is server side like a online data base

08-08-2002, 07:44 PM
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.


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

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

function ipval() {

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,


08-08-2002, 07:48 PM
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?

08-08-2002, 09:22 PM
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.

08-08-2002, 09:39 PM
hey i no im kinda goin off topic here but wot exactly is server side?

08-09-2002, 09:26 AM
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...


08-09-2002, 10:23 AM
ok thanks guys, u'v been a great help :thumbsup: