我已经提交了带有passport_mrz1和passport_mrz2值的表单,如何获取passport_mrz1值?
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<h1>Passport Input</h1>
<form action="" method="post" accept-charset="UTF-8">
<label>passport_mrz1:
<input name="passport_mrz1" type="text" value="P<USAWILLIAMS<<JUSTIN<<<<<<<<<<<<<<<<<<<<<<<" /></label>
<br/>
<label>passport_mrz2
<input name="passport_mrz2" type="text" value="99003853<1USA1101018M1207046110101111<<<<<94"/></label>
</br>
<input type="submit" value="submit this form" />
</form>
</body>
</html>发布于 2019-01-24 21:03:55
您可以使用POST方法将数据传递给PHP脚本。我添加了按钮名称clicked,用于在单击按钮时执行post条件。
?php
if (isset($_POST['clicked'])) {
echo $_POST['passport_mrz1'];
}
?>HTML是:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<h1>Passport Input</h1>
<form action="" method="post" accept-charset="UTF-8">
<label>passport_mrz1:
<input name="passport_mrz1" type="text" value="P" ><USAWILLIAMS<<JUSTIN<<<<<<<<<<<<<<<<<<<<<<<" /></label>
<br/>
<label>passport_mrz2
<input name="passport_mrz2" type="text" value="99003853<1USA1101018M1207046110101111<<<<<94"/></label>
</br>
<input type="submit" value="submit this form" name="clicked" />
</form>
</body>
https://stackoverflow.com/questions/54347166
复制相似问题