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 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> 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 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. 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! 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
Archived
This topic is now archived and is closed to further replies.