I am using a MYSQL Server and using php to run an Inventory Search page on my website.
A supplier of ours is requesting us to provide them with a HTTP Get Request URL that implements a part search on our website. Currently I use a form on our website that searches a database table for the item and displays the results on an inventory_srch_results page.
Is there a way of doing what our supplier is asking?
Our website is: http://www.escomponents.com
(The home page has a search form)
The results page is: inventory_srch_resultsRR.p
Any help would be greatly appreciated.
Your search results still looks like this:
A GET request is when you are just asking the web server for a specific page, but you're not POSTing data. So when you go to your home page in your browser:
...that is a GET request.
You can also pass data in a GET request, in a part of the URL known as the "query string." If you see a question mark in a URL, you're seeing the part that splits the URL from the data.
So if I went here:
...then I am still getting the same page, but PHP has access to GET variables called "hello" and "name". The value for the "hello" GET variable is "world", and the value for "name" is "Rick".
Now, currently your search form sends POST data to the inventory search engine, and your search engine expects POST data. For example, the field that it sends for the search word is called "srchCriteria".
Your supplier seems to be asking you for a version of your inventory search engine that will allow them to type in a part number in the URL and search that way, like this:
However, it seems that your search engine is only looking for POST data and not GET data.
One quick way of resolving this (but not necessarily the best way) is to change any references to $_POST in the search engine results page to $_REQUEST. The $_REQUEST variables look at both POST and GET data and takes whichever one is available.
All that said, I would be cautious about doing this and would suggest hiring a freelance developer (elance.com and sites like it have contractors for hire) to make the change. You could accidentally open up security risks if you are not careful with what you're changing or understand all of the changes.