2 Replies - 838 Views - Last Post: 31 December 2012 - 02:44 AM Rate Topic: -----

#1 ESL_Teacher  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-October 07

concantenate $_SESSION variable and hyperlink

Posted 30 December 2012 - 11:38 PM

Hi,
I'm an EFL teacher who programs a wee bit. I am trying to concatenate a PHP $_SESSION and an existing link in an options value. Is this even possible? I've tried and tried but no luck. Here is my code. Any assistance would be greatly appreciated.

$_SESSION['coursename']=$_POST['coursename'];//my session variable



and this is where I wabt to concatenate the $_SESSION variable to an existing url

echo '<option value= "SpeakingDataEntry.php">Speaking</option>';
//it's part of an options dropdown list

I want the link to be:

echo '<option value= "$_SESSION['coursename'] . SpeakingDataEntry.php">Speaking</option>';


Thanks in advance.

EFL_Teacher

Is This A Good Question/Topic? 0
  • +

Replies To: concantenate $_SESSION variable and hyperlink

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10803
  • View blog
  • Posts: 40,273
  • Joined: 27-December 08

Re: concantenate $_SESSION variable and hyperlink

Posted 30 December 2012 - 11:48 PM

You could do:
echo '<option value= ' . $_SESSION['coursename'] . '"SpeakingDataEntry.php">Speaking</option>';


Was This Post Helpful? 0
  • +
  • -

#3 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3576
  • View blog
  • Posts: 10,441
  • Joined: 08-June 10

Re: concantenate $_SESSION variable and hyperlink

Posted 31 December 2012 - 02:44 AM

see also the Manual’s section about Strings. there’s everything you need to know about strings (and how strings are parsed).
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1