judikrd Posted June 21, 2006 Share Posted June 21, 2006 Hi...I'm fairly new to PHP and don't understand why sometimes I have access to a $_POST variable, and sometimes not. Here's my specific question:I'd like my web page to call another page after the user has chosen an item from a SELECT statement. Here's what I've got:<form name="select" method="post"><select name="groupChoice" id="groupChoice"><?php for ($j=1; $j<=$i; $j++) {echo '<option value =', $keyn[$j], '>', $selectGr[$j], '</option>';} ?></select> <br><p><a href="combSelect.php?keyn=<?php echo $_POST['groupChoice'] ?>">Click here to buy </a>But when a user clicks on the HREF link, there's a blank where the result of <?php echo $_POST['groupChoice'] ?> should be.So I'm thinking that I need to use a Submit button for the $_POST variable to get a value, right? I tried using onclick="document.location = 'combSelect2.php?keyn=<?php echo $_POST['groupChoice'] ?>' " instead, but the page never went to a new page...How can I send the user to the correct web page based on their choice in the Select?Thanks so much for any insights you can give me!! Link to comment https://forums.phpfreaks.com/topic/12512-call-to-a-web-page-based-on-select-statement/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.