...

View Full Version : is it possible to have insertion from another page?



ace04
02-16-2006, 03:44 AM
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?..

mlse
02-16-2006, 12:37 PM
You can do the following thing in page 1 (for example):



<html>
.
.
.
<div>
<?php include("page2.php"); ?>
</div>
.
.
.
</html>

ronaldb66
02-16-2006, 01:19 PM
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?

ace04
02-21-2006, 09:46 AM
yap!! absolutely.. that's what i mean...

degsy
02-21-2006, 03:07 PM
page1.php


<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


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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum