The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Passing data between PHP and MySQL database?
I have added a drop-down menu to the reply form, which has three options - "A", "B" and "C". Whenever someone replies they must select either of the three options.
I have also created a new field in the "post" table in the database. This field is called "option", and is used to record whether A, B or C was selected when the post was submitted. How do I pass the selected option from the reply form and place it in the "option" field in the database. e.g. When the post is submitted by the user, they select option A. How do I place "A" in the "post"table of the database. Thanks. |
#2
|
||||
|
||||
edit /includes/functions_newpost.php
|
#3
|
|||
|
|||
Thanks AN-net
|
#4
|
|||
|
|||
Still stuck here :ermm:
What do I need to add to /includes/functions_newpost.php to get the selected option written to the database? The drop down menu on the form has name = "option" and can have a selected value of "A", "B" or "C". How do I get $post[option] to contain the selected value? I'm guessing that it should be something along the lines of: $post[option] = val(option) - i.e. $post[option] contains the value of "option" passed from the form. I'm starting php from scratch here, so apologies for what seems like a fairly elementary question. |
#5
|
|||
|
|||
Sorted
If anyone else wants to know - use the $_POST variable which is automatically set by PHP when it encounters a form. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|