Jump to content

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


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.