..
In a former article we saw how to create a Search Engine in ASP using MS Access as database, forgetting a small detail, ie the data page , another topic covered in the past, but did not see the two merged into a single solution .
The purpose of this article is precisely to combine the two concepts and see both the case of transmission of data (search criteria) by the method GET with POST method, there being considerable differences in the philosophy of creation of the two research systems .
General Introduction: use and differences between GET and POST
This being an article of advanced nature, I assume that the reader understands the difference in sending data with GET or POST, but for completeness and to help the reader less convenient, I consider it a little preamble.
An HTML form can be handled, when sending data with the two methods mentioned above, setting the HTML code as follows.
GET:
<form method="GET" action="cerca.asp">POST:
<form method="POST" action="cerca.asp">The difference is that with GET data will be appended to the URL of the page through the parameters that are called querystring (search string, to be precise), but this does not happen with the POST method and the URL of the page will see only the file target as the final element of the URL itself.
The destination URL of the two cases will therefore be one of the following.
GET:
POST:http://localhostcerca.aspData recovery is always done through a form with built-in Request object, with the difference that we use the method to GET and POST QueryString retrieval of the retrieval method we use Forms.Another difference is that in the querystring (ie GET) is that the data is sent through a form or through a link, we "only" 255 characters available, so as a solution can be precisely adapted to a search system or a link few parameters, but not to send a registration form with many fields (in which case it is essential to the POST).
Last difference is in data security: GET a password, PIN, credit card number, is clear in the URL, the POST does not.
Which system to use to use a search engine? It 'the same and in this article, as already mentioned, we will examine the two cases.
Database Structure As mentioned above, use an MS Access database to contain data for the search request.
The database will be called db.mdb and will consist of a single table and its fields.
The search form
Create your personal Web server on the folder in which search the database and fix the file cerca.html accompanied by the following code:
<form method=" METODO_DI_INVIO "action="cerca.asp"> <input type="text" name="testo"> <input type="submit" value="Cerca"> </ Form>I do not think there is nothing to add.
For the two examples replace it with POST and GET with the value in bold METODO_DI_INVIO, the method specified in the attribute <form>.
Last prerequisite before moving to the practice to assign permissions for read and write access to the workbook look.
| |
ASP (Advanced)
Full course for creating dynamic Web sites. From 39 €. |
| |
ASP Zero (Ebook)
Learning Microsoft ASP and VBScript from scratch. At only 29 €. |
| |
ASP and Access (Ebook)
Managing a MS Access database with ASP. At only 29 €. |