php - Set a session in a foreach loop unique to each button -


I have a results page that is generated by using an advanced loop and session variable

This is the same

   gt; {foreach ($ rate of $ key = & gt; $ val) {$ url = "http: // looks like www.concordiauniversity.com/".$val . '/'. $ Classname [$ key]; Echo "
$ classname [$ of] a Href = '/ classname_handler' type = 'text' id = 'follower' name = 'follower' class = 'btn btn-large btn-block btn-primary' type = 'button' & gt; class follow & lt; I on C = 'icon-hands-right icon-white' & gt; & lt; / i & gt; $ val & lt; i class = 'icon-user icon-white' & gt; & lt; / i & gt; & Lt; / a & gt; & lt; / ul & gt; & lt; / div & gt; & lt; / form & gt; "; $ _SESSION ['degree'] = $ degree; $ _SESSION ['classname'] = $ classname; }}? & Gt;

My question is how to set a session for each $ class name so that when I click the follow-up class button, the session is only for that specific class. The way I have now, I get an array back

I'm not completely sure that What you are trying to do here, but what I think in my session is that the variables are overwriting with each walk, use something like

  $ _SESSION ['degrees'] = $ Degree; Forex currency ($ rate of $ $ key = & gt; $ val) {$ url = "http://www.concordiauniversity.com/".$val.'/'.$classname[$key]; Echo "....."; }   

and then use the session to get your values ​​back in the actual class page

  $ _ session ['degree'] [KEY_FROM_URL]    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -