sazzie Posted January 30, 2007 Share Posted January 30, 2007 Hi guys,I have a form defined below:[code]<form method="post" action=" <?php echo $_SERVER["PHP_SELF"];?> "><select name="month" ><?php$months = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");for( $x = 1; $x <= count($months); $x++ ){ echo "<option value=\"$x\""; if( $x == $month ) { echo "selected"; $m = $month; } echo ">".$months[$x-1]."</option>";}?></select></form>[/code]All I want to do is to be able to use a seperate hyperlinked image on my webpage to scroll through the months in my array. So in addition to being able to select any month in my dropdown list, I want an arrow to scroll through one month per click. ???I figure that means begin able to set the value of month, possibly as a post variable(don't know if its even possible), outside of the form and refreshing the page.I have never done anything like this before. Can anyone offer and insight into this?Thanks ;) Link to comment https://forums.phpfreaks.com/topic/36302-setting-form-variable-outside-form/ Share on other sites More sharing options...
Fallen_angel Posted January 30, 2007 Share Posted January 30, 2007 you could use get instead of post then at the top of the page have something like [code]$id = $_GET['id'];[/code]then the variable is set in the url , for example for january you could have www.yoursite.com/page.php?id=januaryhope that helps Link to comment https://forums.phpfreaks.com/topic/36302-setting-form-variable-outside-form/#findComment-172616 Share on other sites More sharing options...
sazzie Posted January 30, 2007 Author Share Posted January 30, 2007 I am sure i'm missing something but I don't see how using get instead of post will help influence the value of my drop down list.I need a way to change the value of month without using the list. This is so I can scroll through my months as well as select from the list. Link to comment https://forums.phpfreaks.com/topic/36302-setting-form-variable-outside-form/#findComment-172674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.