문제

I have implemented OpenSearch on a website, but the idea is to receive the resulting parameter and then use it to forward to another service. Something like:

  • My opensearch.xml has the URL such as mywebsite/search&q={searchTerms}
  • When I reach mywebsite/search, I need to verify if "q" exists and proceed

I'm trying to print all $_GET and $_POST variables, and "q" is nowhere to be seen.

How can I test if {searchTerms} exists?

도움이 되었습니까?

해결책

mywebsite/search&q={searchTerms}

the url should be

mywebsite/search?q={searchTerms}

or you are not sending valid query parameters then q should be accessible in $_GET['q']

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top