Jump to content

get url


dreamwest

Recommended Posts

REMOTE_ADDR gets you a users ip address, not a url of any kind. Maybe you where thinking of HTTP_REFERER, but even then, it simply gets the refering address, not the current. Maybe you where thinking of REMOTE_HOST, again, this relates to the client.

 

Maybe your looking for combination of SERVER_NAME, REQUEST_URI and QUERY_STRING?

Link to comment
Share on other sites

$scheme = !empty($_SERVER['HTTPS']) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http';
echo $scheme, '://', $_SERVER['HTTP_HOST'], $_SERVER['SCRIPT_NAME'];

 

Almost what im looking for.. Im trying to track ppl trying to hack my site

 

I have this in htaccess: ErrorDocument 404 /404.php , so whenever someone tries to guess urls:

 

http://site.com/admin/something.php it will automatically go to http://site.com/404.php. But  $_SERVER['HTTP_REFERER']; isnt working for this.

 

Link to comment
Share on other sites

$_SERVER['HTTP_REFERER'] will get you the site the visitor came from if they clicked a link to your site. Provided of course there browser sends this information.

 

What information are you after exactly? keep in mind that anyone who knows anything about cracking websites won't send very much real information in there requests at all.

Link to comment
Share on other sites

Im interested in seeing what theyre after, itll give me some insite on how to better secure the site

 

Over the last 5 mins ive had 5 different ips trying to access restricted files, i dont want to ban them yet i want to spy on them and see what they do

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.