Amezis 0 Report post Posted December 3, 2005 I'm not that good with PHP, and I tried this code: if ( $_SERVER['REQUEST_URI'] == ('/') )/*'/' is the domain root*/{ echo('<img src="{I_ONEURL}" border="0" alt="{T_SOMETHING}" />');}else{ echo('<img src="{I_ANOTHERURL}" border="0" alt="{T_SOMETHING}" />');} However, it doesn't work. So, basically, I want that if the request is at the root (actually mysubdomain.domain.com), it will show {I_ONEURL} in the image src. If the request is not at the root, but for instance at index.php?showpage=22, it will show {I_ANOTHERURL} in the image src.I hope you understand what I want, and can make a new code. And I know I'm not the best PHP programmer Share this post Link to post Share on other sites
Spectre 0 Report post Posted December 4, 2005 That should work fine - maybe there's another section of code causing the block you mentioned to not work properly? I wouldn't recommend such a method for what you're trying to do. In my opinion, it would be better to use something like: if( $_SERVER['PHP_SELF'] == '/index.php' && count($_GET) < 1 ) { // Is the root} else { // Not the root} Or: $url = parse_url($_SERVER['REQUEST_URI']);if( ( $url['path'] == '/' || $url['path'] == '/index.php' ) && !isset($url['query']) ) { // Is the root} else { // Not the root} If that makes sense. That's my two dollars worth, anyway. Share this post Link to post Share on other sites
Amezis 0 Report post Posted December 4, 2005 Actually, my code worked.I was using it on a phpBB board, in the template file. I have installed a modification which should allow me to use PHP codes in the phpBB template file. But obviously, I couldn't use the special phpBB template tags IN the PHP code... Well, I thought I did something wrong. Anyways, thanks for your help Share this post Link to post Share on other sites