Hi..
I am new to php. I want to try simple application. My form contains two empty text boxes and one button name copy. Can anybody tel me the php script for copying data from one textbox to other? Suppose I typed "Hello world!" in texbox1 and clicked copy button then textbox2 shoul also display "Hello world!"
Please help.
Assigning data using PHP
Moderator: General Moderators
Re: Assigning data using PHP
What would be the purpose of doing such a thing?
Re: Assigning data using PHP
Code: Select all
<?php
if(isset($_POST['submit']))
{
$txtvalue = $_POST['txt1'];
}
?>
<form method="post" action="copy.php">
<input type='text' name='txt1' value='<?php echo $txtvalue;?>'/>
<input type='text' name='txt2' value='<?php echo $txtvalue;?>'/>
<input type='submit' name='submit' value='copy'/>
</form>hope it helps u