Page 1 of 1

Use php value inside java script function

Posted: Thu Jan 29, 2009 5:21 am
by mit

Code: Select all

<?php
          for ($i=0; $i<sizeof($res) ;$i++){
            $uploadid = $res[$i]['id'];
 
echo ("<Script Language=JavaScript>
function load() {
var load = window.open('viewgallery.php?uploadid=$uploadid','','scrollbars=no,menubar=no,height=580,width=520,resizable=yes,toolbar=no,location=no,status=no');
       }
      </Script>");
            ?>
   

I need to call $uploadid inside the function load , upload id has got few values ,that s why i need to put function inside php codes.but this way is not working,any help

Re: Use php value inside java script function

Posted: Thu Jan 29, 2009 7:44 am
by HCBen
You're missing the close bracket for the for loop.