simple html code help
Please i would like to create a kind of quotation form with 2 ends (front and back). The front end would be a text box and a submit button and the back end would supply the response to the query / request that was inputed in the textbox at the front end. For example if the word that was typed in the text box is "apple" then the back end would return the word "fruit" on the page , but if the word that was typed in the text box is "cabbage" then the back end would return the word "this is not a fruit".
Its a silly example but i hope it gives you a better picture of what i am trying to do . Its just a simple script and i really hope someone could help out with this.
There are a couple of ways you could do this. Technically you could build all of this in one page (no back-end coding required). But I guess this kind of depends on how many words you want to generate a response for. If it's a large list then you probably want a back-end and you'll probably want to use a database at that.
The other thing would be how specific you want the matching to be. Now I don't know what this page is going to be for but using your example, if someone types "apple" they will get "fruit". But what if they type in "apples" or "some apples"? Again, since I don't know what this page is for I don't know how many different words or combinations people would be entering into this textbox. But it is still something to consider when writing a script. Plus as I read your post again I can't help but wonder if you want a list of words that get matched to their own specific phrases, or do you want a list of words and everything else that doesn't match gets your "this is not a fruit" message?
For example, do you want something like:
apple, banana, orange, grape, watermelon = fruit
everything else = this is not a fruit
Or are you looking for something more or less like
apple = fruit
banana = fruit
orange = fruit
grape = fruit
watermelon = fruit
cabbage = this is not a fruit
Once I better understand what you are looking for I can help you get some code that will do the job.
To get the front-end aspect started, the following HTML mark-up can be used:
<form id="fruitChecker" method="get" action="backendFruitChecker.php">
<label for="fruitName">Enter the food you would like to loo<br>
<input type="text" name="fruitName" value="">
<input type="submit" name="submit" value="Submit">
Note: this form submits to a back-end PHP file.
Thanks for your reply , Hey can you PM me?
Originally Posted by talleagle