or is there something that will give me the refering url in a string so i can block out certain requests for a page if the refering page doesn't match what i want?
Announcement
Collapse
No announcement yet.
is there a php code for this
Collapse
X
-
is there a php code for this
is there a code in php similiar to asp's code to check whether or not the current page's url matches a certain string (extremely usefull for conditional includes)
or is there something that will give me the refering url in a string so i can block out certain requests for a page if the refering page doesn't match what i want?Tags: None
-
I'm new to php but I use the following code snippet to determine the current filename (under Apache only, I believe):
<?php
/***************************************
** Get environment variables.
***************************************/
$full_path = getenv("REQUEST_URI");
/***************************************
** Evaluate base path's existence,
** get filename and compensate for
** hidden index.html file.
***************************************/
$dot_pos = strpos($full_path, ".");
if ($dot_pos == false) {
$base = $full_path;
$page_file = "index.html";
}
else {
$base = dirname($full_path);
$page_file = basename($full_path);
}
?>
Comment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment