using the value of session variable

Discussion in 'PHP' started by rrn, Apr 15, 2009.

  1. #1
    in my website (php , htm l , sql)
    i have used the following php code to derive the basename of page



    session_start(); 
    $pagename=pathinfo($_SERVER["PHP_SELF"]); $pagename=$pagename["basename"]; 
    $_SESSION['page']=$pagename;
    
    PHP:
    if i am on the page www.test.com/index.php
    $_SESSION['page'] has the value index.php.

    i want to use that value in the '----------- ' html code shown below



    <a href="/ar/---------------"><img src="arabic.gif" border="0" /></a>
    HTML:
    how can i do that?
    please help
     
    rrn, Apr 15, 2009 IP
  2. jimbursch

    jimbursch Peon

    Messages:
    33
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <a href="/ar/<?php echo $_SESSION['page']; ?> "><img src="arabic.gif" border="0" /></a>
    HTML:
     
    jimbursch, Apr 15, 2009 IP