Passing var from php to javascript

Posted by marc-andre menard on Stack Overflow See other posts from Stack Overflow or by marc-andre menard
Published on 2010-03-23T11:01:22Z Indexed on 2010/03/23 11:03 UTC
Read the original article Hit count: 323

Filed under:
|

I try to do something pretty strait... getting php value to javascript

here is the page

here is the code..

<script language="javascript">  
    <?php $imagepath = $_REQUEST["path"]; ?>
    var whatisthepath = <?php $imagepath; ?>
    alert (whatisthepath);
</script>

ALWAYS getting UNDEFINE.... why ?

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript