November 24th, 2001, 06:20 PM
using html forms
I have got a questions about html forms....I figured I would put this in the tutorial section because it can be a tricky subject.
Now my question is when creating a form for a web page the setup is pretty easy to have a form that will not execute anything just the form. I am having a little trouble with the setup of the database for the form. I do not actually have a provider (web page provider) yet and i was wondering if this was my problem.
First where should the database be created, before the head or after? Second should it be after the form or before? I can not get it to search the database. For example if you wanted to have a list of movies and the user would then type in the movie name. How can you make the form search the database right from the actual natepad? Or is it impossible.
I am learning java now but until I figure this out I am dead in the water. Any leads would be great. Thanks
November 24th, 2001, 06:24 PM
Given a bit more info I could probably try to run together a bit of JS that might at least help you understand the workings of it and how to do what you actually want it to do??
November 24th, 2001, 09:27 PM
I used this site when i got a lil stuck on forms, its all html based, java, all kinds of programming..might help
November 24th, 2001, 09:31 PM
November 24th, 2001, 10:09 PM
November 24th, 2001, 10:12 PM
November 24th, 2001, 10:13 PM
Well, when i say advanced, I mean like how to get C++ Builder programs to connect to the internet and do stuff liek ping and traceroute and portscanning!
November 24th, 2001, 10:21 PM
Ive yet to get into C C++ properly, the languages ive done so far are limited, pascal, html, java, VB, tiny bit of perl and cgi..but i'm know master, just chugging along.
The net tools you mentioned sounds intresting, i'd like to be able to do my own programs like that. See how they work on the net, from scratch..ect..
Where did you start ?
November 24th, 2001, 10:22 PM
Re: using html forms
Ok, this is going to take some explaining but, here goes:
The database should already be created unless you are storing your 'movie' names in an array. If you are using an array then you will have to make it before the form (so it is executed before the form is displayed). I personally would use a database like mySQL or Access, etc to store this information. Better than an array and easier to update (anytime you want to update your array by adding movies you'd have to edit the code in the actual page).
First where should the database be created, before the head or after?
Ok, if you are loading from a real database, not an array this is what you do. Top of page - make the connection to the database and load the recordset (the collection of all records in the database). Then, load your form with a loop in it, making a new option for every record in the recordset. After the form has been displayed, close the recordset.
Second should it be after the form or before?
Ok, now you have to write some sql scripts. This would be like "SELECT * From movielist Where movie_name = '" & strParamater & "' Order By movie_name DESC". Something like that. This would not be done in the same place. This would be in your handler method (if request("submit") <> null or something like that). You would check the form (using your name tags on elements) by doing something like strParamater = Request("movie_name") and then do a get from the database recordset. Wow, then you would display this information. If you do this, make sure to test for 0's cuz you might get a recordset with nothing in it (if there were no movies of that name). The only problem with that sql script I gave you is it will only look for exact matches I believe (can't quite remember my SQL).
For example if you wanted to have a list of movies and the user would then type in the movie name.
Impossible. Notepad is only displaying text, it is not scripting.
How can you make the form search the database right from the actual natepad? Or is it impossible.
To learn some JSP go here: P2P at Wrox. Or search for JSP. One problem I noticed that you have is you do not have a web host. You need one and you need to decide on your scripting language depending on the web server they are using. Ie. IIS = ASP, Apache = PHP, JSP etc etc.
Anyways, hope this helps. If you need more help just reply to this or send me a message.
PS Sorry for the length of the message.
\"Vini, Vici, Vidi\"
I came, I saw, I conquered.
- Julius Caesar
November 24th, 2001, 10:23 PM
did this link come up before....its not shown..
O well reposted