# Explode hostname referere

**URL:** <https://forum.kirupa.com/t/explode-hostname-referere/167915>\
**Category:** Uncategorized\
**Created:** [November 2, 2005, 12:54pm UTC](https://forum.kirupa.com/t/explode-hostname-referere/167915 "2005-11-02T12:54:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manga](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@manga](https://forum.kirupa.com/u/manga)\
**Post date:** [November 2, 2005, 12:54pm UTC](https://forum.kirupa.com/t/explode-hostname-referere/167915/1 "2005-11-02T12:54:28Z")

</div>

hey all,

what is the best way… to see if a script is executed from the samedomain…  
//$st=$\_SERVER[“HTTP\_REFERER”];

$st=“[http://www.domain.nl/folder/test.php](http://www.domain.nl/folder/test.php)”;  
$st=preg\_replace("/http://.[www.]\*/","",$st);  
$stA=explode("/",$st);  
print $stA[0];

if($stA[0]==’[color=#003366]domain.nl’){[/color]

//like this?

}
