pescott Posted December 26, 2007 Share Posted December 26, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/83239-solved-if-isset_getsubmitsearch-issue/ Share on other sites More sharing options...
revraz Posted December 26, 2007 Share Posted December 26, 2007 This right here determines if it runs on load or on submit if (isset($_GET['submitSearch'])) Quote Link to comment https://forums.phpfreaks.com/topic/83239-solved-if-isset_getsubmitsearch-issue/#findComment-423445 Share on other sites More sharing options...
shocker-z Posted December 26, 2007 Share Posted December 26, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/83239-solved-if-isset_getsubmitsearch-issue/#findComment-423446 Share on other sites More sharing options...
revraz Posted December 26, 2007 Share Posted December 26, 2007 I was assuming this page was called from his FORM from another page. Quote Link to comment https://forums.phpfreaks.com/topic/83239-solved-if-isset_getsubmitsearch-issue/#findComment-423448 Share on other sites More sharing options...
pescott Posted December 26, 2007 Author Share Posted December 26, 2007 Problem solved! Thanks for the tips guys. Quote Link to comment https://forums.phpfreaks.com/topic/83239-solved-if-isset_getsubmitsearch-issue/#findComment-423746 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.