This is a discussion on "[SOLVED] Php Forms problem" within the PHP Forum section. This forum, and the thread "[SOLVED] Php Forms problem are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Php Forms problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] Php Forms problem
Hey! I am creating a dating site and have created a php based website with appache server & a working mysql database for the information from my forms to go into the database. When i use dreamweavers record insertion wizerd the infomation from my forms goes directly into my database, but when i use list menu forms the data does not go in the data base. The internet states i need to hand code the php code to do a loop so the information goes into my database from my list menu forms. I have no idea how to peform such a task, i am really new to php code, is ther anyone who can give me a working example so i can compare mine and finnish my site???
So a quick run down of my problem: I need php code that will allow list menus from my php pages to submit data from the list menus directly into my mysql database. Here is my Email NeoReloaded@hotmail.co.uk If any can write this code form me and outline which peace of code does what i would be very gratefull!!! Below is my code.... I have attached my php file to this post
Last edited by Rakuli; Oct 4th, 2007 at 11:02. Reason: Please use [html][/html] BBC when posting HTML |
|
|
|
||||
|
Re: Php Forms problem
Hi Longstand and welcome to Webforumz,
You don't have any values assigned to your <option value="">'s. When processing, PHP won't see the what is between the <option> tags, it will only see the value. In the case of these drop down boxes, the value is empty for all of them. I am looking at your code but without any values it won't work at all
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
||||
|
Re: Php Forms problem
Okay, I've had a look at your code and I'm happy to write an example script but I need to know what your MySQL database setup is. ie. What table are these values going into and what are the column names?
Let me know. Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Php Forms problem
Quote:
My mysql database is called: sexy My table is called: details My columns are called: 1) i_am 2) interested_in 3) here_for 4) m 5) d 6) y 7) postal 8) uk_area 9) web_address 10) u 11) p The connection type is: conndb Each drop down list in my code is in the exact order i have listed the columns above. The code i sent u has the exact order they go in and which options to choose. Basically for instance the top column listed above says i_am so i need the user to choose a option from the Iam\We are list menu and have the choice inputted into the i_am column of my mysql database. My code has a drop down menu saying: Interested In Meeting - i would like the choice from that list menu to go into interested_in column of my database. I have a list menu in my code saying: For - i would like the choice from this menu to go directly into the here_for column of my database. My code has a: enter birth date section, i would like the month chosen from the list menu input into the m cloumn of my database. The day chosen from the list menu input into the d column of my database. And the year chosen from my list menu input into the y column of my database. I have a section in my code saying: post code. Iwould like the user to input the post code into this section (Textfield) i have already managed this part myslef but i am getting multible entries in my mysql database. basically it is creating about 5 rows every time i enter just one text field data entry. I have a UK Area section in my code and would like the choice from the list menu to go into the uk_area column of my database. I have a: enter a valid Email Address part of my code (Textfield) and would like the user to input there email address into the textfield and the input go directlty into the web_address column of my database. I have a: Please Choose a user name section of of my code (Textfield) and would like the user to input a desired username into the Textfield, and the input go directly into the database. I have a: Please choose a password section of my code (textfield) and would like the user to input a desired password into the textfield, and the input go into my database. I have attached a screen image of my database to this post in the form of a html file for you to look at... Cheers for your help i am really gratfull.... Would you be able to create the code/put it were it needs to go & put explanations on why its there so i can try and learn it myself.... I am very new to php so i am not enterly confident i will no were to put the code myself.... thanks again |
|
||||
|
Re: Php Forms problem
Hi again Longstand, You have a fairly length form so I have written the below code to handle it. I stress though, you *must* add values to your <option>'s. PHP will not receive any useful values until you do. eg. <option value="man">Man</option> <option value="woman">Women</option> <option value="Coupke_man_woman">Couple_Man_Women</option> <option value="etc..">Couple_2_Women</option> <option value="">Couple_2_Men</option> <option value="">Group</option> The below code is fairly simple but will do as you wish.. Now please note it is heavily commented and I have not included all your form elements, you will need to add these yourself but it should give you the gist.
|