I've had a productive time searching and reading posts on doing this, but I've given in and I'm going to ask.
Here's the first file:
<?php
session_start();
print "<html>";
print "<body bgcolor='aqua'>";
$aArray = array("One", "Two", "Three", "Four", "Five", "Six");
print "<a href='addable.php?aArray=$aArray'>Test Addable</a>";
print "</body>";
print "</html>";
?>
in which I declare an array and pass it via a URL (fingers crossed) to here:
<?php
session_start();
print "<html>";
print "<body bgcolor='aqua'>";
$aArray= $_GET['aArray'];
for( $i=0; $i<count($aArray); $i++){
print $aArray[$i]."<br>";
}
print "</body>";
print "</html>";
?>
and it doesn't work.
I want to avoid the SESSION store and the POST, as I'm relying on them too much - it will get confusing if I add more to them as a form on my page uses the post/session a lot so form controls/elements don't upset each other.
As far as I could tell from the search, my options are:
$SESSION
$POST
implode()
explode()
serialize()
unserialize()
list()
preg_split()
urlencode()
But for some reason I just can't get any of it to work.
I'm looking for the simplest most old-fashioned way of passing an array through a URL to another page so it feels like I am 'passing an array', to a function, although its you know, to another page that needs the array.
I'd really appreciate solutions.