php - Don't show this if the url contains the following -
I have a simple div that I do not want to load if the visitor loads a certain url.
Looks like:
& lt ;? Php if (stristr ($ _ server ['PHP_SELF'], 'blog') == incorrect) {echo " ;); }? & Gt; There is a problem ... it does not work ... # I still know when I load www.url.com/blog.
Am I lacking sleep or should I work above? If the URL is included in the blog then what will you do to not display the device?
Try instead:
if (substr ($ _ Server ['REQUEST_URI'], 0, 5)! == '/ blog') {echo '& lt; Div id = "stuff" & gt; & Lt; / Div & gt; '; }
REQUEST_URI
contains the requested URI path and query, not the existing editing script, such as the file PHP_SELF
.
Comments
Post a Comment