/    Sign up×
Community /Pin to ProfileBookmark

cookie that lets me see user IP adress

i need a cookie that lets me see a users IP adress so i can determine wether they are allowed on my site or not because i use a Javascript code that makes it that can block certain IP adresses. please help me.

[QUOTE]

One by one penguins steal my sanity.

[/QUOTE]

to post a comment
JavaScript

15 Comments(s)

Copy linkTweet thisAlerts:
@JupacSep 25.2004 — That can be bypassed easily.
Copy linkTweet thisAlerts:
@age13kidauthorSep 25.2004 — how can it be bypassed?







One by one penguins steal my sanity.[/QUOTE]
Copy linkTweet thisAlerts:
@JupacSep 25.2004 — 1) Turn OFf javascript

2) Get a differnt ip
Copy linkTweet thisAlerts:
@age13kidauthorSep 25.2004 — no what i mean is that i want to beable to see the IP adresses of who is on my website like via E-mail when they enter my page or a status bar.
One by one penguins steal my sanity.[/QUOTE]
Copy linkTweet thisAlerts:
@JupacSep 25.2004 — ook this is best done with a server-side language

such as php,asp.net or asp
Copy linkTweet thisAlerts:
@age13kidauthorSep 25.2004 — ok this is how i want it to work

is what happens when users clik submit it ses things like the user name and then the radio button cliked and the it shows REMOTE_HOST:xx.xxx.xxx.xx (what ever the number is) can i use that to filter who can see my website. but first i need to know what it is for whoever visits my page
One by one penguins steal my sanity.[/QUOTE]
Copy linkTweet thisAlerts:
@JupacSep 25.2004 — does your server support php?
Copy linkTweet thisAlerts:
@age13kidauthorSep 25.2004 — its a free geocities account
One by one penguins steal my sanity.[/QUOTE]
Copy linkTweet thisAlerts:
@JPnycSep 25.2004 — Well then you probably can't do what you want. You'll need a database and serverside scripting to search it, which I doubt a free site will support. Once you find the IPs you want to block, you will need to store them somewhere, and then search against that list in the database. If you don't have one, where are you going to store the ones you want blocked?
Copy linkTweet thisAlerts:
@JupacSep 25.2004 — IMO drop geocities. Worst HOST ever
Copy linkTweet thisAlerts:
@age13kidauthorSep 25.2004 — i got this code from http://javascript.internet.com

<i>
</i>&lt;!-- ONE STEP TO INSTALL IP ADDRESS FILTER 2:

1. Copy the coding into the HEAD of your HTML document --&gt;

&lt;!-- STEP ONE: Paste this code into the HEAD of your HTML document --&gt;

&lt;HEAD&gt;

&lt;SCRIPT LANGUAGE="JavaScript"&gt;

&lt;!-- This script and many more are available free online at --&gt;
&lt;!-- The JavaScript Source!! <a href="http://javascript.internet.com">http://javascript.internet.com</a> --&gt;
&lt;!-- Original: kdcgrohl --&gt;
&lt;!-- Web Site: <a href="http://www.kdcgrohl.com">http://www.kdcgrohl.com</a> --&gt;

&lt;!-- Begin
// This JavaScript uses server side includes ("SSI") so this document's name must end in .shtml
function ban(){
var ip = '&lt;!--#echo var="REMOTE_ADDR"--&gt;';

//add as many ip's below as you wish.
if (ip == "x.x.x.x" || ip == "x.x.x.x") {

//if you wish to change the alert message, do so below.
alert("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Attention!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!nYour ip address ("+ip+") has been banned!");
history.go(-1);
window.location.replace("http://javascript.internet.com/")
}
}
ban();
// End --&gt;
&lt;/script&gt;


&lt;p&gt;&lt;center&gt;
&lt;font face="arial, helvetica" size"-2"&gt;Free JavaScripts provided&lt;br&gt;
by &lt;a href="http://javascriptsource.com"&gt;The JavaScript Source&lt;/a&gt;&lt;/font&gt;
&lt;/center&gt;&lt;p&gt;

&lt;!-- Script Size: 1.10 KB --&gt;
Copy linkTweet thisAlerts:
@JupacSep 25.2004 — [code=php]
<script type="text/javascript">
var ip = '<!--#echo var="REMOTE_ADDR"-->';
doucument.write("<a href="#" onclick="mailto:[email protected]?subject=ip&message=+ ip +>ok</a>");
</script>

[/code]



untested
Copy linkTweet thisAlerts:
@JPnycSep 25.2004 — Ok, so everytime you want to ban someone, you have to add their IP to the if statement. Better hope you don't want to ban too many. Besides, it can easily be gotten around by disabling javascript in the browser.

The only way you can get around THAT, is to make a simple HTML page with a message "You must have javascript enabled to view this page", And that page would contain a javascript redirect to your site. Then, disabling JS wouldn't get them to your site. They'd have to have it enabled to get there.
Copy linkTweet thisAlerts:
@age13kidauthorSep 25.2004 — yah i know how to do that the website i got the code from told me how
Copy linkTweet thisAlerts:
@age13kidauthorSep 25.2004 — &lt;script type="text/javascript"&gt;
var ip = '&lt;!--#echo var="REMOTE_ADDR"--&gt;';
doucument.write("&lt;a href="#" onclick="mailto:[email protected]?subject=ip&amp;message=+ ip +");
&lt;/script&gt;
i tested that by itself andit doesnt seem to work. do i need to include it into the filter script? or does it take forever to email me.
×

Success!

Help @age13kid spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...