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. Link to comment https://forums.phpfreaks.com/topic/73087-question-about-passing-array-to-another-page/ 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? Link to comment https://forums.phpfreaks.com/topic/73087-question-about-passing-array-to-another-page/#findComment-368595 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.