Hey, I am having trouble coding the following. I want to end up with IF current web url contains "domain.com/photos/*" then print x else print y So I want to know if the current url has domain.com/photos/* The * denotes that anything could be after the slash and should be ignored. If anyone can help I would be most thankful.
$url = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; if (stripos($url, 'domain.com/photos/') !== false) { true, contains it } else { false } PHP: Try that out
hmmm, doesn't want to take the code into the template Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/fhlinux159/s/EDITED-FOR-PRIVACY.com/user/htdocs/includes/adminfunctions_template.php(3596) : eval()'d code on line 99 This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
I have attached the file and at the bottom I have put a comment in CAPS where I am trying to put the code. I really appreciate you taking the time to look at this
I can't really tell, it looks like some special sort of markup (at a wild guess - vbulletin). I'm not sure how to put raw php code into there.