国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

PHP ??

PHP ?? ??

???? ? ?? ??? ? ? ??? HTML ??? ??? ? PHP? ???? HTML ???? ?? ??? PHP ?????? ??? ? ?? ??? ??? ? ??? ????.

?

?? ??? ? ?? ?? ??? ??? ?? ??? ?? HTML ??? ???? ????.

form.html ?? ??? ??? ????.

<html>
<head>
<meta charset="utf-8">
<title>php中文網(wǎng)(php.cn)</title>
</head>
<body>
 
<form action="welcome.php" method="post">
名字: <input type="text" name="fname">
年齡: <input type="text" name="age">
<input type="submit" value="提交">
</form>
 
</body>
</html>

???? ?? ??? ???? ?? ??? ???? 'welcome.html'??? ??? PHP ??? ?? ???? ?????. php" :

welcome.php ??? ??? ????:

歡迎 <?php echo $_POST["fname"]; ?>!<br>
你的年齡是 <?php echo $_POST["age"]; ?>  歲。

?? ??? ??

??? ??? ??? ??? ????? ?? ?? ???? ???? ???. ????). ???? ??? ??? ? ???? ??? ??? ?????.

??? ??? ??????? ???? ?? ?? ?? ??? ?? ??? ???? ???. ???? ??? ???? ???? ?? ??? ?? ???? ???? ?? ??? ????? ???? ????. ??? ?? ???? ??? ?? ????? ?? ???? ?? ? ????. ???? ??? ?? ?? ? ?? ????.

GET ??? ???? ??? ??? ? ???? "Hello XXX"? ???? hello.html??? html ??? ???? ??? ?????.

<!DOCTYPE html>
 <html>
 <head lang="en">
     <meta charset="UTF-8">
     <title>歡迎</title>
 </head>
 <body>
 <form action="hello.php" method="get">
     姓名<input name="name" type="text"/>
     <input type="submit"/>
 </form>
 </body>
 </html>

PHP ?? hello.php ??

<?php
 
 header("Content-type: text/html; charset=utf-8");
 if(isset($_GET['name'])&&$_GET['name']){//如果有值且不為空
     echo 'Hello '.$_GET['name'];
 }else{
     echo 'Please input name';
 }

POST ?? ??, ??? ?? ?? ??, HTML ?? ?? add.html

<!DOCTYPE html>
 <html>
 <head lang="en">
     <meta charset="UTF-8">
     <title>相加</title>
 </head>
 <body>
 <form action="add.php" method="post">
     <input name="num1" type="text"/>
     +
     <input name="num2" type="text"/>
     <input type="submit" value="相加"/>
 </form>
 </body>
 </html>

PHP ?? ?? add. ??>

<?php
 if($_POST['num1']&&$_POST['num2']){
     echo $_POST['num1']+$_POST['num2'];
 }else{
     echo '請(qǐng)不要空值';
 }

Post ??? http ?? ??? ?? ???? ??? ?? ??? ????

 form action=""? ??? ????, ??? ???? ??, ? ??? ???? ?? ??

???? ??
||
<html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> </head> <body> <form action="welcome.php" method="post"> 名字: <input type="text" name="fname"> 年齡: <input type="text" name="age"> <input type="submit" value="提交"> </form> </body> </html>