1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

create dynamic div php from a select and show it with display javascript style

Discussion in 'PHP' started by ohyeah136, Oct 31, 2008.

  1. #1
    hi im a student who is learning php

    i would like to know how to create some dynamic div from a select sql request

    and showing it with javascript with the style display

    ty in advance

    im having a hard time to know how to do it

    p.s. my button must be in php

    ty if anyone can help me
     
    ohyeah136, Oct 31, 2008 IP
  2. ohyeah136

    ohyeah136 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    atm in this code there is no select sql request im just testing the stuff but i have some trouble already :( hehe help plz

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled 1</title>
    <script language="javascript">

    function showdiv(id)
    {
    if (document.getElementById)
    document.getElementById(id).style.display = 'block';
    }

    function hidediv(id)
    {
    if (document.getElementById)
    document.getElementById(id).style.display = 'none';
    }



    </script>
    </head>
    <body>
    <?php

    echo '<div class="page" id="page1" style="width: 212px; height: 441px; left: -7px; top: 198px; display:none;">';
    echo "test";
    echo '</div>';

    echo '<input type="button" value="<<" onClick="showdiv(page1)"/>';



    ?>
    </body>
    </html>
     
    ohyeah136, Nov 1, 2008 IP