Domain verification

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

Domain verification

Post by GK »

How do i check if a domainname(domain.com) of a site running my script is the same as in a file?

example:

(de key file includes: domain.com)
how do i let it check if its the same as where its run from
$check=domain.com

if its not on domain.com it should go false
SBukoski
Forum Contributor
Posts: 128
Joined: Wed May 21, 2003 10:39 pm
Location: Worcester, MA

Post by SBukoski »

Have you looked at the $_SERVER variables? Seems like the $_SERVER["HTTP_HOST"] may be useful as it returns the domain name. or at least it did for me when I ran phpinfo() on my server.
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

Post by GK »

ok but how do i get that output from http://www.realmaturesluts.com to realmaturesluts.com ?

<?
$domein = $_SERVER["HTTP_HOST"];
$remote = $_SERVER["REMOTE_ADDR"];
echo $domein;
echo $remote;
?>
Post Reply