Lamez Posted January 17, 2008 Share Posted January 17, 2008 How do I call a variable from another page and put into a form? exmaple: var.php: <?php $_1a = "Team A"; ?> form.php: <?php include ("var.php"); <form name="form1" method="post" action=""> <select name="select"> <option><?php echo $_1a; ?></option> <option>Team B</option> </select> </form> I tried this, and I go nothing as a output Quote Link to comment https://forums.phpfreaks.com/topic/86421-solved-variables-question-easy-solve/ Share on other sites More sharing options...
Ken2k7 Posted January 17, 2008 Share Posted January 17, 2008 <?php include ("var.php"); ?> <form name="form1" method="post"> <select name="select"> <option><?php echo $_1a; ?></option> <option>Team B</option> </select> </form> Quote Link to comment https://forums.phpfreaks.com/topic/86421-solved-variables-question-easy-solve/#findComment-441653 Share on other sites More sharing options...
Lamez Posted January 17, 2008 Author Share Posted January 17, 2008 oops forgot to close my php block, but that still gives me nothing when I call form.php Quote Link to comment https://forums.phpfreaks.com/topic/86421-solved-variables-question-easy-solve/#findComment-441654 Share on other sites More sharing options...
Ken2k7 Posted January 17, 2008 Share Posted January 17, 2008 o.O Uh...ohk. It should work. I tested it and it works for me. Quote Link to comment https://forums.phpfreaks.com/topic/86421-solved-variables-question-easy-solve/#findComment-441656 Share on other sites More sharing options...
Lamez Posted January 17, 2008 Author Share Posted January 17, 2008 oh I know what I did, silly me! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/86421-solved-variables-question-easy-solve/#findComment-441664 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.