Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: PHP & Java help

  1. #1
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP & Java help

    hey guys new to the forum i know bits and pieces of programming but i cannot for the life of me get this code working i cannot put the whole code out there for infringment reasons so here is what i can show

    Thanks guys





    <?php
    require_once (dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'bootstrap.php');



    $chatroom_id = get_var("id");


    ?>




    <script type="text/javascript">

    var dc_chatroom_id = <?php echo $chatroom_id = document.getElementById('id'); ?>;
    <!-- if i take this out ^^^^^ and put just 1 thru 6 one of the chatrooms work i have initially 6 rooms so i need to find a way to make this work. --!>


    </script>







    <div data-role="navbar" data-theme="a">

    <ul>
    <li id="1"><a href="#room" data-role = 'button' data-transition="fade" data-theme="a">The Hangout</a> </li>
    </ul>


    <ul>
    <li id="2"><a href="#room" data-role = 'button' data-transition="fade" data-theme="a">Electronics Chat</a></li>


    </ul>

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,763
    Thanks
    23
    Thanked 548 Times in 547 Posts
    This line makes absolutely no sense:
    Code:
    var dc_chatroom_id = <?php echo $chatroom_id = document.getElementById('id'); ?>;
    PHP (echo $chatroom_id) can not read dom elements (document.getElementById('id')
    Evolution - The non-random survival of random variants.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •