The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
html forms, php, and and (refreshing?) pages
here's my basic deal. I have a pulldown menu at the top of a page. I want to select an item on the pulldown and then have that open more fields below based on the selected item in the pulldown menu.
the only way I know how to do this is with an "if" block. I'm not sure though if that will automatically go to the if block. if my html looks like this <form action="pd_opt.php" method="get" name="myform"> What type of site addition is this? <select name="pulldown"> <option value="1">option 1</option> <option value="2">option 2</option> </select><br> </form> and my php looks like this PHP Code:
Thanks. I'm really new to php and I'm sorry as this most likely is a very trivial question |
#2
|
||||
|
||||
You'd have to refresh the page, so make a form, name the "<select>" tag, (name it "pb_opt") (don't forget to put a submit button).
Below this add a line break, then put "<? echo($subopt); ?>" by itself. In the braces, you'll need to put this: PHP Code:
|
#3
|
||||
|
||||
Black Vivi you are the man. Again you help me out. Thanks a million.
I have one more question. If the html form is in one document and the php is in another one how do I call the variable with echo from another document or in other words PHP Code:
and I'm trying to get PHP Code:
ok I think I got it but can you let me know if this is right??? PHP Code:
|
#4
|
||||
|
||||
basically yea
but it would be easier to do this: PHP Code:
then where you want the options displayed, put PHP Code:
make sure there aren't any echos, prints or just output html in the pd_opt file tho sorry about the late reply |
#5
|
|||
|
|||
Quote:
|
#6
|
||||
|
||||
Yeah I forgot about the == instead of just the = thanks though. Black vivi again thanks for the feedback. I pretty much had it figured out though. I'm trying to teach myself how to save and make updating a webpage easy. I don't know anything about mySql and that's the easiest way to do it. I'm begining to see how mwsql would make this easier, fewer things in an array to keep track of but we'll see. next on my list of things to figure out. MySql
|
#7
|
||||
|
||||
lol
goodluck then |
#8
|
||||
|
||||
How important is extensive MySql Knowledge in making a database for my Web-site? is there something that will just give me the basics of what I need. PHP seems easy enough but MySql seems to be an animal of a different nature?
|
#9
|
|||
|
|||
If you're making a database then MySQL is extremely important.
|
#10
|
||||
|
||||
MySQL is actually quite easy from when u learn to create tables onwards (for me anyway)
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|