【发布时间】:2015-01-15 09:43:34
【问题描述】:
我想在输入文本字段中显示我的数据。但是我试了很多次,都不知道怎么走。任何人都可以帮忙吗? 这是我的代码
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Your Profile</h1>
<form action="exercise2.php" method="post">
<p>Firstname:
<input type="text" name="fname">
</p>
<p>Lastname:
<input type="text" name="lname">
</p>
<p>Address :
<input type="text" name="address">
</p>
<p>Birthday:
<input type="text" name="birthday" id="inputField">
</p>
<p>
<input type="submit" value="save">
</p>
</form>
<link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.min.css" />
<script type="text/javascript" src="jsDatePick.min.1.3.js"></script>
<script type="text/javascript">
window.onload = function(){
new JsDatePick({
useMode:2,
target:"inputField",
dateFormat:"%d-%M-%Y"
});
};
</script>
</body>
</html>
和我的 php 代码:
<?PHP
$first_name = $_POST["fname"];
$last_name = $_POST["lname"];
$address = $_POST["address"];
$birthday = $_POST["birthday"];
list($bd,$bm,$by)=explode('-',$birthday);
$age=date('Y')-$by;
echo $first_name;
echo "<br>";
echo $last_name;
echo "<br>";
echo $address;
echo "<br>";
echo $birthday;
echo "<br>";
echo $age;
?>
我希望我的 php 代码中的所有数据都可以显示在输入文本字段中。
谢谢
【问题讨论】: