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 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2006
    Location
    philippines
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile is it possible to have insertion from another page?

    can anybody help me about this?..
    i have a page named "page1"
    then i've inserted data's
    and i also have "page2" and the submit button is located here
    is it possible to have insertion from other page?..

  • #2
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    You can do the following thing in page 1 (for example):

    Code:
      <html>
        .
        .
        .
        <div>
          <?php include("page2.php"); ?>
        </div>
        .
        .
        .
      </html>
    Die Welt ist ein Irrenhaus und hier ist die Zentrale!

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Come again?

    To prevent a wild goose chase, you'll need to clarify yourself a bit more:
    then i've inserted data's
    Where did you insert data? How? In what?

    the submit button is located here
    I guess "page2" contains a form, then, and you want to somehow process the form's data; do you want to store it? Display it on another page?
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #4
    New Coder
    Join Date
    Jan 2006
    Location
    philippines
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yap!! absolutely.. that's what i mean...

  • #5
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    page1.php
    PHP Code:
    <form name="form1" method="post" action="page2.php">
      <
    table width="200" border="1" cellspacing="0" cellpadding="2">
        <
    tr>
          <
    td>Name</td>
          <
    td><input name="txt_name" type="text" id="txt_name"></td>
        </
    tr>
        <
    tr>
          <
    td>Comments</td>
          <
    td><textarea name="txt_comments" id="txt_comments"></textarea></td>
        </
    tr>
        <
    tr>
          <
    td colspan="2"><input type="submit" name="Submit" value="Submit"></td>
        </
    tr>
      </
    table
    page2.php
    PHP Code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    </head>

    <body>

    <?php
    if(isset($_POST['Submit'])){
        echo 
    'Thanks for your comments!<br>';
        echo 
    'Name: ' $_POST['txt_name'];
        echo 
    '<br>Comments: ' $_POST['txt_comments'];
    }
    ?> 
    </body>
    </html>
    That is a really basic example. You would probably want to put in some validation and error checking.


  •  

    Posting Permissions

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