mufka:
Be sure to read completely the online manual page entry for strpos(). There is a warning there about possible logic errors that come up between the function's returning a 0 (if the searched-for string is at the beginning of the haystack) and the function's returning a FALSE (if the searched-for string is not in the haystack at all).
My haystack is $HTTP_REFERER and what I'm looking for is near the end. I'm checking to see if the result of strpos is > 0. If it is or if the needle variable is empty, it just leaves the variable for $HTTP_REFERER unchanged. If strpos is 0 or if the needle variable is not empty, I append something to the $HTTP_REFERER.
What I'm doing is linking from a query page and I need to send the query data back to the query script if I link back to it from the destination page. I'm using one destination page that can be reached from either the query script of a static page. Rather than having two different pages, I wanted to put logic in to take different action if the referrer was a query page.
You probably don't want to know all that, but I don't think I need to worry about the stated concerns. I've tried every combination of ins and outs from the pages and I've had no anomalies.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.