The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Calling a form
Hey, I've put a profile field in my index.php. It displays custom profile field #6.
I'd like to be able to choose something from the dropdown, then update the database with the selection, and finally be redirected back to index.php. Here's what I did to index.php: PHP Code:
This is my forumhome_logoutcode template where I want this field to show up: Code:
<form action="index.php" name="updatematrixform" method="post"> $TheField <input type="hidden" name="action" value="updatematrix"> </form> Any help would be awesome, or just a hint. Thanks |
#2
|
||||
|
||||
OK, I think I've improved the code ...
I figured I'd forget the onchange event for now and just see if I can update the database with a submit button. Here's my code: PHP Code:
|
#3
|
||||
|
||||
OK, it looks like optionlines is an array. How do I know which array element the user chose from the dropdown?
|
#4
|
||||
|
||||
Instead of all the above, just make the form call another PHP file that runs the query that adds the value to the custom profile field. So no need PHP edits, just edit the template, and then upload a new PHP file. It definitely works because I have something similar set up.
|
#5
|
||||
|
||||
That sounds good. But I'm still unsure about how to update the database with the current state of the dropdown. ?
|
#6
|
||||
|
||||
Don't use the automatic dropdown. Make it up manually, then add it as HTML to the template. The form should call the other php file.
|
#7
|
||||
|
||||
OK, I see what you're saying. But I still am confused about how I get the current state of the dropdown to be passed into the database.
Now, I have a php file xxx.php: PHP Code:
Code:
<form action="matrix.php" name="updatematrixform" method="post"> <select size="1" name="field6"><option value="TheValue" >TheValue</option><option value="TheValue1" >TheValue1</option><option value="TheValue2">TheValue2</option><option value="TheValue3">TheValue3</option></select> <br> <input type="submit" name="action" value="Update Matrix"> </form> |
#8
|
||||
|
||||
Replace this:
PHP Code:
PHP Code:
|
#9
|
||||
|
||||
Kickass!! That did it man, thanks a lot.
|
#10
|
||||
|
||||
You're welcome!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|