index
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function autoFill() {
var f=if1.document.forms[0];
f.txtName.value='Zanne';
f.submit();
}
</script>
</head>
<body>
<div>
<button type="button" onclick="autoFill();">autoFill</button>
</div>
<iframe name="if1" id="if1" src="form.php" width="100%" height="100%"></iframe>
</body>
</html>
form
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<?php
if($_POST['txtName']) {
echo "Your name is " . $_POST['txtName'];
exit;
}
echo <<<HDOC
<form method="post" action="form.php">
<div>
<input type="text" name="txtName">
<input type="submit" value="Submit">
</div>
</form>
HDOC;
?>
</body>
</html>
Bookmarks