|
|
The constant __SELF__ I believe. Or maybe its __FILE__.... You'd have to mess with it to figure out.
Why do you need that though? I'd just use PHP's $_GET and $_POST to get the data from the URL.
|
|
|
|
|
__FILE__ returns the location of the file, not the URL.
And what I'm trying to do is have a file, so that it will only work on a specified board... so if someone tries to put it on their board, nothing will happen.
|
Support Rob Scuderi, the #1 Penguins Defender!
"Behold: me! I have authority in this building."
|
|
|
|
Oh. Wait. You mean you're trying to get a remotely hosted PHP file to only work on your board? I'd try the referrer then.
|
|
|
|
|
|
|
$uri = $_SERVER['REQUEST_URI'];
$location = "http://www.yoursite.com/".$uri;
|
|
|
|
|
Thanks, I finally got it to work, using the $_SERVER['HTTP_REFERER'] and strpos(). Edit: Uhh... I'm not sure what that is, but this is what I'm using right now: <?php $boardURL = $_SERVER['HTTP_REFERER']; $requiredURL = 'mithstestsite'; $pos = strpos($boardURL,$requiredURL); $code = 'document.write(\'You win\');';
if($pos === false) { echo 'document.write(\'You lose\');'; } else { echo $code; } ?>
Last Edit: Oct 22, 2006 22:07:18 GMT by Mithras
|
Support Rob Scuderi, the #1 Penguins Defender!
"Behold: me! I have authority in this building."
|
|
|
|
Thanks, I finally got it to work, using the $_SERVER['HTTP_REFERER'] and strpos(). Edit: Uhh... I'm not sure what that is, but this is what I'm using right now: <?php $boardURL = $_SERVER['HTTP_REFERER']; $requiredURL = 'mithstestsite'; $pos = strpos($boardURL,$requiredURL); $code = 'document.write(\'You win\');';
if($pos === false) { echo 'document.write(\'You lose\');'; } else { echo $code; } ?> basically request uri gets the path from the document root of the file your viewing so the uri of this page would be cgi-bin/index.cgi if you put the url of this in it would be studiozero.proboards44.com/cgi-bin/index.cgi
|
|
|
|
|