How to add PHP code to a URL
<p>What php code should I use and how should I add it to the <strong>NEXT ARTICLE</strong> url link below, that will cause the next article in the multidimensional array to be echoed back subsequently?</p>

<p>I intend to echo back one article after another sequentially.</p>

<p>Thank you!</p>

<p>(form.php)</p>

<pre><code>&lt;form action="process.php" method="get"&gt;
    Group:
    &lt;select name="group"&gt;
        &lt;option value="group1"&gt;Group1&lt;/option&gt;
        &lt;option value="group2"&gt;Group2&lt;/option&gt;
    &lt;/select&gt;

    Chapter:
    &lt;input type="text" name="chapter"&gt;

    Article:
    &lt;input type="text" name="article"&gt;

    &lt;input type="submit" value="Go to Article"&gt;    

&lt;/form&gt;
</code></pre>

<p>(process.php)</p>

<pre><code>&lt;?php

session_start();

$laws=array(
       "group1"=&gt;array(
                      "1"=&gt;array(
                                "1"=&gt;"This is article (1) in chapter (1) of (group1)",
                                "2"=&gt;"This is article (2) in chapter (1) of (group1)",
                                "3"=&gt;"This is article (3) in chapter (1) of (group1)",
                                ),
                      "2"=&gt;array(
                                "1"=&gt;"This is article (1) in chapter (2) of (group1)",
                                "2"=&gt;"This is article (2) in chapter (2) of (group1)",
                                "3"=&gt;"This is article (3) in chapter (2) of (group1)",
                                ),
                       ),
       "group2"=&gt;array(
                      "1"=&gt;array(
                                "1"=&gt;"This is article (1) in chapter (1) of (group2)",
                                "2"=&gt;"This is article (2) in chapter (1) of (group2)",
                                "3"=&gt;"This is article (3) in chapter (1) of (group2)",
                                ),
                      "2"=&gt;array(
                                "1"=&gt;"This is article (1) in chapter (2) of (group2)",
                                "2"=&gt;"This is article (2) in chapter (2) of (group2)",
                                "3"=&gt;"This is article (3) in chapter (2) of (group2)",
                                ),

       )
       );

$grp= $_GET['group'];
$chap = $_GET['chapter'];
$art = $_GET['article'];

if(isset($laws[$grp]) &amp;&amp; isset($laws[$grp][$chap]) &amp;&amp; isset($laws[$grp][$chap][$art])){
$_SESSION['group'] = $grp;
$_SESSION['chapter'] = $chap;
$_SESSION['article'] = $art;    
}else{
$_SESSION['group'] = 'group1';
$_SESSION['chapter'] = '1';
$_SESSION['article'] = '1';   
}

$group = $_SESSION['group'];
$chapter = $_SESSION['chapter'];
$article = $_SESSION['article'];


echo $laws[$group][$chapter][$article]; // ALL NEXT ARTICLES TO BE ECHOED HERE!!!!!

?&gt;

&lt;a href="process.php" style="text-decoration: none;"&gt;NEXT ARTICLE&lt;/a&gt;
</code></pre>
