#1 October 7, 2020 6:00am

tunga
Member
Registered: December 5, 2017
Posts: 8

Google Search

Hello,

I'd like to use Google Search on my website. I want to pass search text to the another page that includes Results Only code from Control Panel. How can I get values of _GET or _POST in my pages?

Best Regards.

Offline

#2 October 7, 2020 8:36am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Google Search

You should be able to reference $_GET and $_POST in your template files just as you would in any PHP script.

Offline

#3 October 7, 2020 8:58pm

tunga
Member
Registered: December 5, 2017
Posts: 8

Re: Google Search

My search box is in the header file and its name is q. Somehow,  $_GET["q"]  returns null in my search result page. Even the URL of the search result page lost its fragment part ("?q="). Is there anything that I may doing wrong. If I include a page that doesn't exist in action of the search form, fragment is there.

Last edited by tunga (October 7, 2020 9:04pm)

Offline

#4 October 8, 2020 8:11am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Google Search

If the URL you're getting to from your search form isn't including the GET variables you're either using a POST form or there's some other issue with your form.

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.