dzhax Posted August 20, 2009 Share Posted August 20, 2009 I have this javascript <script type="text/javascript"> showhide(!is_group_hidden(1),1); </script> I need to change the ones in (1),1 to be dyanmic or changed with php but i can not seem to get it to work.I am databasing my website and making each section show up with a <?php while(...){ statment. At the end of each while (before the closing } ) i have the above script. For each recuring section the 1's need to be changed to 2's then 3's then 4's.I tried: <script type="text/javascript"> showhide(!is_group_hidden(<?php echo $p1['id'] ?>),<?php echo $p1['id'] ?>); </script> But that does nothing. It wont even work for the first one anymore.Any help? Or maybe I should repost in PHP. Not sure. Link to comment Share on other sites More sharing options...
Citydev Posted August 20, 2009 Share Posted August 20, 2009 I'm not sure what you want to do but just to check - you do realise that php cannot be dynamic on the web page. It is fully resolved and disappears before the page leaves the server? The javascript has no php variables at the time the script is parsed. Link to comment Share on other sites More sharing options...
dzhax Posted August 20, 2009 Author Share Posted August 20, 2009 NVM I just echoed the script with php and it made it print out as if it were hard coded. Thanks for your help on that. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.