Jump to content

Placing a page in a div


colap

Recommended Posts

If i click a button then a new page will come in a div.

Is it possible with php?

I have tried this but it doesn't work.

<?php
if(isset($_POST['nmdiv'])) {
    echo "<div class=\"cldiv1\" id=\"iddiv1\"><?php include(\"copyright.php\")?></div>";
}
?>
<html>
    <head>
        <title>phptest</title>
        <script type="text/javascript" language="javascript">
            function makediv(){
                var tmp=document.getElementById("iddiv1");
                tmp.style.border="solid";
                tmp.style.position="absolute";
                tmp.style.left="300px";
                tmp.style.top="100px";
                tmp.style.width="400px";
                tmp.style.height="200px";             
            }
        </script>
    </head>
    <body>
        <form method="post">
            <input type="button" name="nmdiv" value="click" onclick="makediv()"/>
        </form>
    </body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/177164-placing-a-page-in-a-div/
Share on other sites

Sure you can!

 

Put this beween <head></head>

<style type="text/css">

#Div1 {

left:431px;

top:30px;

}

</style>

<?php echo "<div id='Div1'>Hello world!!</div>";?>

 

Is that what you mean??

No, i want to put/place a web page in that div,not only "Hell world".

And it will happen after clicking the button.

 

Can someone give some clue for that?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.