dzhax Posted August 20, 2009 Report Share Posted August 20, 2009 (edited) 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. Edited August 20, 2009 by dzhax Link to comment Share on other sites More sharing options...
Citydev Posted August 20, 2009 Report 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 Report Share Posted August 20, 2009 (edited) 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. Edited August 20, 2009 by dzhax Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now