Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.