abdfahim Posted October 13, 2007 Share Posted October 13, 2007 I want to pass an array to another php page. Now, I know this can be done with SESSION. But I want to pass array something like page.php?arr=$myarray. Is it possible? If yes, plz post example. Quote Link to comment Share on other sites More sharing options...
abdfahim Posted October 13, 2007 Author Share Posted October 13, 2007 Oops .. I should add some more details.. I cant possibly use Serialize function because the second php page is called from a javascript. I think I better post some prtion of my code .. <script LANGUAGE="JavaScript"> function myjavascript(){ var strURL = "second_page.php?kpi=" + document.sForm.kpi.value; //Now I will do some work .. But first I have to pass all the checked value of kpi to second_page.php } </script> <form name="sForm"> <?php $myarr=array(.........some elements....); while($i=0;$i<count($myarr);$i++){ echo "<input type=\"checkbox\" name=\"kpi[]\" value=\"".$myarr[$i]."\">".$myarr[$i]."<BR>"; } ?> <input type="button" onclick="javaScript:myjavascript();" value="Go"> </form> So, I have to pass all the checked elements of the form to second_page.php, from that javascript function. Is that possible? Quote Link to comment 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.