1. #1
    Ext User
    Join Date
    Jun 2008
    Posts
    6
    Vote Rating
    0
    EuMendoza is on a distinguished road

      0  

    Default How can I get the value $_SESSION["id"]

    How can I get the value $_SESSION["id"]


    I need to use the value $_SESSION["id"] that is in the file "pepe.php", in the "var number" that is in "pepe.js". Sorry, I have a bad english level. Thanks.

  2. #2
    Sencha User
    Join Date
    Jun 2008
    Posts
    69
    Vote Rating
    0
    pouniok is on a distinguished road

      0  

    Default


    Hi,

    You can do like this :

    write this in pepe.php before including pepe.js :

    Code:
    <script type="text/javascript">
        var number = <?php echo $_SESSION["id"]; ?>; // add quotes if the id isn't a real number
    </script>
    <script type="text/javascript" src="pepe.js"></script>
    So you can access number as a global variable in pepe.js


    Or rename pepe.js in whatever.php, include it with <?php include() ?> in pepe.php.
    Then you could call php code with in your JS.

  3. #3
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    or you could make an ajax call back to a php page that would return that value.
    I really hate the idea of code that generates more code (php generating javascript)...

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi