Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-16-2006, 02:44 AM   PM User | #1
ace04
New Coder

 
Join Date: Jan 2006
Location: philippines
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
ace04 is an unknown quantity at this point
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?..
ace04 is offline   Reply With Quote
Old 02-16-2006, 11:37 AM   PM User | #2
mlse
Regular Coder

 
mlse's Avatar
 
Join Date: Mar 2005
Posts: 624
Thanks: 20
Thanked 19 Times in 18 Posts
mlse is on a distinguished road
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!
mlse is offline   Reply With Quote
Old 02-16-2006, 12:19 PM   PM User | #3
ronaldb66
Senior Coder

 
Join Date: Jun 2002
Location: The Netherlands, Baarn, Ut.
Posts: 4,253
Thanks: 0
Thanked 0 Times in 0 Posts
ronaldb66 is an unknown quantity at this point
Come again?

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

Quote:
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
ronaldb66 is offline   Reply With Quote
Old 02-21-2006, 08:46 AM   PM User | #4
ace04
New Coder

 
Join Date: Jan 2006
Location: philippines
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
ace04 is an unknown quantity at this point
yap!! absolutely.. that's what i mean...
ace04 is offline   Reply With Quote
Old 02-21-2006, 02:07 PM   PM User | #5
degsy
Senior Coder

 
Join Date: Nov 2002
Location: North-East, UK
Posts: 1,265
Thanks: 0
Thanked 0 Times in 0 Posts
degsy is on a distinguished road
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.
degsy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:55 AM.


Advertisement
Log in to turn off these ads.