View Full Version : html forms, php, and and (refreshing?) pages
DeMuro1
04-27-2003, 09:41 AM
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
if ($pd_opt=1)
{ };
elseif ($pd_opt=2)
{ };
Now will this update the lower part of the mage immediately or do I need to add something that I'm not aware of. Also what do I put in my {braces} that allows me to open another page, another php file or in my case add php to the bottom portion of a page
Thanks. I'm really new to php and I'm sorry as this most likely is a very trivial question
Black Vivi
04-27-2003, 01:35 PM
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:
$subopt = "THE HTML";
That's the way I'd make it anyway...
DeMuro1
04-28-2003, 07:02 AM
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
$subopt = "THE HTML";
is in a document called pd_opt.php
and I'm trying to get
$subopt
in the first document in the html, so do I need to include anything extra so I can get the variable into my html document???
ok I think I got it but can you let me know if this is right???
<?
function pulldown_type()
{
include(pd_opt.php);
echo($subopt);
}
pulldown_type()
?>
is that right???
Black Vivi
05-02-2003, 09:22 PM
basically yea
but it would be easier to do this:
include("pd_opt.php");
at the top of the page (under the <?)
then where you want the options displayed, put
echo($subopt);
otherwise it will be displayed where you put it in the page.
make sure there aren't any echos, prints or just output html in the pd_opt file tho
sorry about the late reply
filburt1
05-02-2003, 09:33 PM
04-27-03 at 06:41 AM DeMuro1 said this in Post #1 (https://vborg.vbsupport.ru/showthread.php?postid=387817#post387817)
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
if ($pd_opt=1)
{ };
elseif ($pd_opt=2)
{ };
Now will this update the lower part of the mage immediately or do I need to add something that I'm not aware of. Also what do I put in my {braces} that allows me to open another page, another php file or in my case add php to the bottom portion of a page
Thanks. I'm really new to php and I'm sorry as this most likely is a very trivial question
Side note: use == if you want those conditions to work. Also proper indenting is your friend. :)
DeMuro1
05-02-2003, 09:49 PM
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
Black Vivi
05-03-2003, 06:31 AM
lol
goodluck then
DeMuro1
05-06-2003, 08:19 AM
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?
filburt1
05-06-2003, 10:18 AM
If you're making a database then MySQL is extremely important.
Black Vivi
05-06-2003, 03:01 PM
MySQL is actually quite easy from when u learn to create tables onwards (for me anyway)
DeMuro1
05-08-2003, 08:54 AM
is there a tutorial out there that will make my life easy. I see a lot of prompt work. Is this how thinghs are done in MySql?. I mean I know where my database is for my boards but those are really of the arena of the the gyu that bought vB for our domian. I pay for the server space. I read a tutorial using MS Access but it's not very conscise. Actually confusing. Is there anything that will make my life relatively easier when trying to learn MySql??? You guys are great and again thanks for the help
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.