#1
  1. PHP user-in-training
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2001
    Location
    Sacramento Calif. USA
    Posts
    677
    Rep Power
    0

    PHP variable into a DHTML page .JS


    I have been using Milonic's fine DHTML menu's for a while. And love them.

    http://www.milonic.co.uk/menu/

    But I would love to figure out how to pass PHP variables into the DHTML pages.

    I saw on one of his scripts where he was able to, so I realized it must be possible.

    Does anyone here know where to direct me to figure this out?
  2. #2
  3. phpkid ~~~~~~ :o)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Nov 2000
    Location
    NJ, USA
    Posts
    2,534
    Rep Power
    16
    I don't get what you want to achieve.

    JD
    _____________________________
    d.k.jariwala (JD)
    ~ simple thought, simple act ~
    I blog @ http://jdk.phpkid.org
  4. #3
  5. Is a Psycho
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    In your computer
    Posts
    231
    Rep Power
    14
    Well one way (if this is what you meant):

    PHP Code:
    <?php
      
    // Globals, DB connection, etc (snipped)
      // Database Query snipped
    ?>

    <html>
    <head>

    <script language="javascript">
    <!-- DHTML Menu Script (Example with DHTML crap)
    var myDHTMLarray = new Array();

    <?php
      
    // add javascript array data and set $mycounter to zero
      
    $mycounter 0;

      while (
    $row mysql_fetch_array($result) {
        echo 
    "myDHTMLarray[".$mycounter."] = \"".$row["menu_item"]."\";";

        
    $mycounter++;
      }
    ?>
    //-->
    </script>

    </head>
    <body>

    <!-- you figure out the rest -->

    </body>
    </html>
    I know it isn't much (I really shouldn't be posting when I am tired), but you get the idea...
    deepspring

    - "Netscape 4 users are like lemmings... You can't help but laugh when one falls off a cliff"

IMN logo majestic logo threadwatch logo seochat tools logo