unsider Posted March 14, 2008 Share Posted March 14, 2008 K, let's assume that i am currently using example.com/main/index.php as my index page. If I call $_SERVER['PHP_SELF'] It returns example.com/main/index.php/..... correct? Well is it possible to load just example.com/ as opposed to the full filepath from this? Is so, how? Link to comment https://forums.phpfreaks.com/topic/96081-_serverphp_self-help/ Share on other sites More sharing options...
Stooney Posted March 14, 2008 Share Posted March 14, 2008 try $_SERVER['HTTP_HOST'] Link to comment https://forums.phpfreaks.com/topic/96081-_serverphp_self-help/#findComment-491859 Share on other sites More sharing options...
unsider Posted March 14, 2008 Author Share Posted March 14, 2008 Hmm, that simple? I suppose I expected something more. Maybe I should go do some more reading. Link to comment https://forums.phpfreaks.com/topic/96081-_serverphp_self-help/#findComment-491860 Share on other sites More sharing options...
unsider Posted March 14, 2008 Author Share Posted March 14, 2008 Ran into a problem. About to go read up on it, but I figure I can do two things at once. $self = $_SERVER['HTTP_HOST']; echo '<a href="$self\star_rating.php">Star Rating</a>'; URL Output: http://example.com/main/$self/index.php Link to comment https://forums.phpfreaks.com/topic/96081-_serverphp_self-help/#findComment-491866 Share on other sites More sharing options...
unsider Posted March 14, 2008 Author Share Posted March 14, 2008 Still haven't found anything. Bump. Link to comment https://forums.phpfreaks.com/topic/96081-_serverphp_self-help/#findComment-491882 Share on other sites More sharing options...
derrick1123 Posted March 14, 2008 Share Posted March 14, 2008 IS: echo '<a href="$self\star_rating.php">Star Rating</a>'; Needs to be: echo "<a href='$self\star_rating.php'>Star Rating</a>"; Link to comment https://forums.phpfreaks.com/topic/96081-_serverphp_self-help/#findComment-491885 Share on other sites More sharing options...
unsider Posted March 14, 2008 Author Share Posted March 14, 2008 Thank you very much. Link to comment https://forums.phpfreaks.com/topic/96081-_serverphp_self-help/#findComment-491898 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.