html传值给php

html传值给php,第1张

<html>

<head>

<meta http-equiv="Content-Type" content="text/html charset=utf-8" />

<title>无标题文档</title>

</head>

<body>

<form action="" method="get">

Name: <input type="text" name="name" />

<input type="submit" />

</form>

<?php

$name=$_GET['name']

echo "欢迎你:".$name

?>

</body>

</html>

通过表单,例如:

<form action="form_action.php method="get">

  <p>First name: <input type="text" name="fname" /></p>

  <p>Last name: <input type="text" name="lname" /></p>

  <input type="submit" value="Submit" />

</form>

其中的input 中的 name 就可以被PHP接收


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/7005813.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-31
下一篇 2023-03-31

发表评论

登录后才能评论

评论列表(0条)

保存