Forum Moderators: coopster

Message Too Old, No Replies

please help with correct 'in string' syntax?

instr(?) perhaps?

         

marcus76

12:56 pm on May 21, 2005 (gmt 0)

10+ Year Member



hi, i have the following code which captures the URL, i want to conditionally set my header based on the URL string, however i can only specify the exact URL? , i want to specify only a partial part of the dynamic URL, which contains the unique session - that being:

[domain-name.com...]

any ideas?, i have the following so far..

<?php
$url = sprintf("%s%s%s","http://",$HTTP_HOST,$REQUEST_URI);

if ($url == "http://www.domain-name.com/test"){
require(DIR_WS_INCLUDES . 'header1.php');
}

elseif
($url == "http://www.domain-name.com"){
require(DIR_WS_INCLUDES . 'header2.php');
}

else require(DIR_WS_INCLUDES . 'header.php');
?>

Many thanks in advance

Marcus

jatar_k

4:55 pm on May 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try using one of these functions to see if your substring occurs within the url

[php.net...]
[php.net...]