Which city is more dangerous, Detroit or Philadelphia?

I am making a form that includes city & email & a submit button & Ive a few questions on connecting 2 database?

  • I am a beginner programmer (and 16 years old) so I am having a difficulty of finding a answer that is simple to follow and understand... I making a site (on dreamweaver cs5) and the frontpage of the site has a select city and a dropdown of all the major cities and a email text box. I have a few questions and those are as follows: What is my next step now that I have the html pretty much done... do i connect it to a database? What php script would I need to make sere both fields (the city and email) are filled? and where would i enter this php script? Here is some of my code in case you were wondering: <body> <div id="apDiv3"><select name="select" style="width: 30 400px; height: 20px; font-size: 11px;"> <option>Albuquerque</option> <option>Arlington</option> <option>Atlanta</option> <option>Austin</option> <option>Baltimore </option> <option>Boston</option> <option>Buffalo</option> <option>Charlotte</option> <option>Chicago</option> <option>Dallas</option> <option>Denver</option> <option>Detroit</option> <option>El Paso</option> <option>Fort Worth</option> <option>Fresno</option> <option>Honolulu</option> <option>Houston</option> <option>Indianapolis</option> <option>Jacksonville</option> <option>Kansas City</option> <option>Las Vegas</option> <option>Long Beach</option> <option>Los Angeles</option> <option>Loisville</option> <option>Memphis</option> <option>Mesa</option> <option>Miami </option> <option>Milwaukee</option> <option>Minneapolis</option> <option>Nashville</option> <option>New Orleans</option> <option>New York</option> <option>Oakland</option> <option>Oklahoma City</option> <option>Omaha</option> <option>Philadelphia</option> <option>Phoenix</option> <option>Portalnd</option> <option>Sacramento</option> <option>St. Louis</option> <option>San Antonio</option> <option>San Diego</option> <option>San Francisco</option> <option>San Jose</option> <option>Seattle</option> <option>Syracuse</option> <option>Tuscon</option> <option>Tulsa</option> <option>Virginia Beach</option> <option>Washington DC</option> <option>Wichita </option> </select></div> <div id="apDiv4"><form> <input type="text" name="email" /> </form> </div> <div id="apDiv2"><img src="finalyyyy.png" width="1027" height="768" /></div> <div id="apDiv8"><form action="sub.html" method="get"><input type="submit" value="Subscribe"></form></div> </body> </html> THANKS and remember I am a beginner so the simplest explanations the better! I appreciate it!

  • Answer:

    I won't be able to go over everything because what you are asking requires a lot of explanation. But for starters you are missing an opening <form> tag before the select. You also need to keep everything in one form element. You want that opening <form> tag to be at the top of the script before the select element. If you are worried that you can only have form elements inside of form tags don't worry about that you can have <div> <p> and really anything in the form tags. Its all valid markup. So your form will look like below. Not word for word though. <form action="sub.php" method="get"> <select name="countries"> <option value="country_name">....</option> <option value="country_name">....</option> <option value="country_name">....</option> ....etc. </select> <div id="apDiv2"><img src="finalyyyy.png" width="1027" height="768" /></div> <input type="submit" value="Subscribe" name="submit_data"></input> </form> So I changed a few things. 1) The form wraps everything that has to do with the form. The select and input tags. 2) I changed the form action value from "sub.html" to "sub.php". You are going to have to use PHP to communicate with a database. 3) I changed the name value of the select tag from "select" to "countries". This is not necessary because you can name it anything you want but you will be referencing the selection in the sub.php file so giving it a name that relates to the data would make more sense. 4) I gave the option elements a value attribute. You can name these the name of the country they are holding. TIP: These need to be unique if you want them to be effective. I only named them the same just cause I copy and pasted. 5) I also gave the submit input a name as well. I named it submit_data because we will need to reference this submit action in the sub.php file. And we need a name for referencing. Thats about all I am going to give you for now. So heres some homework for you. If you are going to be using php you will need something that can test it locally. Download either WAMP (Windows) or MAMP (Mac). You will also need to learn How server side scripting works. Because PHP is a server side language. There are some great tutorials on w3schools.

Johnny at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.