Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default how can i add session variable with it file path ?

    hello.
    while im trying to make a slider for a multilingual site , I like to know how i can use $_SESSION['language'] as part of a path to image. ?

    i created folders called english french . this way i will have the corresponding images in each folder and as site language change so would path to the folder.

    any suggestion would be great.
    in order to show the slider where i want and how i want in main page i created this code .

    PHP Code:
      <?php
        
    if ($this_is_home_page) {
     echo 
    '<div class="brns">';
      echo 
    '<div id="tj_container" class="tj_container" style="visibility: visible;">';
        echo 
    '<div class="tj_nav">';
          echo 
    '<span id="tj_prev" class="tj_prev">Previous</span>';
          echo 
    '<span id="tj_next" class="tj_next">Next</span>';
        echo 
    "</div>";
        echo 
    '<div class ="tj_wrapper">';
        
    $language =$_SESSION['language'];
        echo  
    '<ul class="tj_gallery" style="position: relative;">';
                                 echo 
    '<li><a href="#"><img src="images/banners/banner1.jpg" alt="image01" /></a></li>';
                                echo 
    '<li><a href="#"><img src="images/banners/banner2.jpg" alt="image02" /></a></li>';
                                echo 
    '<li><a href="#"><img src="images/banners/banner3.jpg" alt="image03" /></a></li>';
                                echo 
    '<li><a href="#"><img src="images/banners/banner4.jpg" alt="image04" /></a></li>';
                                echo 
    '<li><a href="#"><img src="images/banners/banner5.jpg" alt="image05" /></a></li>';
                                echo 
    '<li><a href="#"><img src="images/banners/banner6.jpg" alt="image06" /></a></li>';
                                echo 
    '<li><a href="#"><img src="images/banners/banner7.jpg" alt="image07" /></a></li>';
                                echo 
    '<li><a href="#"><img src="images/banners/banner8.jpg" alt="image08" /></a></li>';
                                echo 
    '<li><a href="#"><img src="images/banners/banner9.jpg" alt="image09" /></a></li>';
         echo 
    "</ul>";
         echo 
    '<div class="bottom"></div>';
        echo 
    "</div>";
     echo 
    " </div>";
    echo 
    "</div>";
         
    ?> 
     <?php ?>
    Thanks.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: how can i add session variable with it file path ?

    Assuming that the folders that you've created with the english/french banners are images/banners/english and images/banners/french, here's what you would do for your first banner file (and then clone for the other filenames):

    Code:
    echo '<li><a href="#"><img src="images/banners/' . $_SESSION['language'] . '/banner1.jpg"
    You might also want to use language defines instead of hard-coding "Next" and "Previous"!

  3. #3
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: how can i add session variable with it file path ?

    Thank you . it worked
    I m still working on it . will translate all those ..

    Thanks again.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: how can i add session variable with it file path ?

    No problem, glad to help.

 

 

Similar Threads

  1. v154 Naming a global variable the same as a SESSION, GET or POST variable
    By torvista in forum General Questions
    Replies: 5
    Last Post: 6 Dec 2015, 11:11 AM
  2. v150 Can I add another variable to the session?
    By tifischer in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Jul 2013, 08:29 PM
  3. how to add a new session variable?
    By delia in forum General Questions
    Replies: 11
    Last Post: 13 Oct 2011, 02:51 PM
  4. Add a new session variable and save to order?
    By Cindy2010 in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 19 Jan 2011, 09:54 AM
  5. How do i add a new session variable?
    By rosebabu in forum General Questions
    Replies: 0
    Last Post: 7 May 2008, 03:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR