Jump to content

[SOLVED] if (isset($_GET['submitSearch'])) issue


pescott

Recommended Posts

Hello,

 

I posted a question here before regarding the ssame code which I got working. The problem I have now is probably very simple to solve, yet I am stuck.

 

There is a query that I would like to run ONLY AFTER the submit button has been pressed, so not on page load. I am ussing this code:

modified

 

Now the alternative to the query running, is a flat echo of text, yet when that happens the error is displayed after the echo like so:

Wanneer u hierboven een woonplaats en een budget invoert en op 'Zoek' klikt, ziet u het meest recente aanbod!Query was empty

 

The rest of the HTML and PHP that is there is not displayed.

 

It all comes down to this: How to run a query AFTER THE SUBMIT BUTTON HAS BEEN PRESSED, NOT ON page load, and display text of no query is to be run?

Help appreciated!

Link to comment
https://forums.phpfreaks.com/topic/83239-solved-if-isset_getsubmitsearch-issue/
Share on other sites

Where is the form that submits to the page? I cant find any form tags or form elements after scanning over your code.

 

You need to set the action of your form to method="GET" as well as naming you submit button submitSearch.

 

<input type="submit" name="submitSearch" value="Submit">

 

 

 

 

 

Regards

Liam

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.