foreach ループとセッション変数を使用して生成された結果ページがあります。
これはそれがどのように見えるかです
<?php
if(count($degree) > 0){
foreach ($degree as $key => $val){
$url = "http://www.concordiauniversity.com/".$val.'/'.$classname[$key];
echo "<form method='post' enctype='multipart/form-data' action='/classname_handler'><div class='control-group' align='center'><ul class='thumbnails'><a href=$url class='thumbnail'><img src=$url onerror=this.src='images.png' alt=Click the empty space here to see the class :) width=60 height=100></a><h4>$classname[$key]</h4><a href='/classname_handler' type='text' id='follower' name='follower' class='btn btn-large btn-block btn-primary' type='button'>follow class <i class='icon-hand-right icon-white'></i> $val <i class='icon-user icon-white'></i></a></ul></div></form>";
$_SESSION['degree'] = $degree;
$_SESSION['classname'] = $classname;
}
}
?>
私の質問は、各 $classname に設定されたセッションを取得して、フォロークラスボタンをクリックしたときにセッションがその特定のクラス専用になるようにする方法です。私が今持っている方法では、配列が返されます。