#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    26
    Rep Power
    0

    need to pass PHP value to a javascript


    Hi All,

    I am using a javascript menu system but I want to be able to build one of the javascript menus using php.

    I have a script that pulls the last 10 items from a database and displays them, want i want is to move these ten items into a custom javascript which creates dropdown menus but cant figure out how to pass the values into the javascript.

    anyone help me ?
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    25
    <script type='text/javascript'>
    var myJavacsriptValue = "<?php echo str_replace("\"","\\\"",$myPhpValue); ?>"

    </script>

IMN logo majestic logo threadwatch logo seochat tools logo