ole Posted November 20, 2008 Share Posted November 20, 2008 I have a PHP webform, by filling the field and pressing submit you get to see a page with info from the mySQL database. Can I submit the form by simply entering a URL with parameters? Example: http://www.domain.com/index.php?field=queryvalue Best regards, Ole Quote Link to comment https://forums.phpfreaks.com/topic/133558-can-i-use-param-to-submit-a-form-by-url/ Share on other sites More sharing options...
flyhoney Posted November 20, 2008 Share Posted November 20, 2008 If the form uses method="get", then yes you can. <form method="get"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/133558-can-i-use-param-to-submit-a-form-by-url/#findComment-694715 Share on other sites More sharing options...
ole Posted November 21, 2008 Author Share Posted November 21, 2008 Seems to use POST instead of GET. Can one just change method with no negative consequences, and then it works? Quote Link to comment https://forums.phpfreaks.com/topic/133558-can-i-use-param-to-submit-a-form-by-url/#findComment-694838 Share on other sites More sharing options...
Maq Posted November 21, 2008 Share Posted November 21, 2008 Seems to use POST instead of GET. Can one just change method with no negative consequences, and then it works? What exactly do you mean? If you use GET you're passing variables via a URL and have to use the $_GET method to retrieve those values. If you use POST then you have to submit your form somehow and use $_POST to retrieve all of your values. Please read the basics. Quote Link to comment https://forums.phpfreaks.com/topic/133558-can-i-use-param-to-submit-a-form-by-url/#findComment-694844 Share on other sites More sharing options...
ole Posted November 21, 2008 Author Share Posted November 21, 2008 So it seems I would need to do so re-prorgamming to make it work. The motivation for using a parameter to retrieve mySQL data is to monitor uptime. If there's another way, I could try an alternative way of monitoring uptime than to verify mySQL retrieved text on a web page. I can monitor the web page and I could monitor the mySQL server port, but this might not catch some downtime situations as both web and mySQL server can be up, but for some reason the mySQL ouput is not showing on the web due to timeout etc. Quote Link to comment https://forums.phpfreaks.com/topic/133558-can-i-use-param-to-submit-a-form-by-url/#findComment-695570 Share on other sites More sharing options...
Maq Posted November 21, 2008 Share Posted November 21, 2008 Can you explain exactly what you're trying to do? First you asked: Can I submit the form by simply entering a URL with parameters? Doesn't really even make sense, at least to me. You can pass variables through the URL. Now you're talking about up time and monitoring MySQL ports... I'm lost ??? Quote Link to comment https://forums.phpfreaks.com/topic/133558-can-i-use-param-to-submit-a-form-by-url/#findComment-695593 Share on other sites More sharing options...
ole Posted November 21, 2008 Author Share Posted November 21, 2008 I can monitor my php page, this is easy (a server checks the page every 5 minutes if a text string is on the web page). But I would like to monitor my php/mySQL system, this can be done if I monitor a URL which shows content from the mySQL database. If I can use query parameters in the URL, instead of filling out the query form manually, that would display the database content so I can monitor uptime using a service like serviceuptime.com. Quote Link to comment https://forums.phpfreaks.com/topic/133558-can-i-use-param-to-submit-a-form-by-url/#findComment-695651 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.