HTML Forms(表單)

html裡面有一個元素”<from>”是用來傳送資料的 會傳送from內的元素有name屬性的資料

最常用的input 可以參考
https://timshyue.tk/html-input-%e8%bc%b8%e5%85%a5%e6%a1%86-type/

動作屬性:

action 將資料送交到指定位置
例如: action=”/test.php”
完整範例 <form action=”/test.php“>

方法屬性

  • method="get" 用get的方式傳送(將資料放在網址上)風險較高
  • method="POST" 用POST的方式傳送,可以具有隱密性與大量資料的效果

範例一:

<form>
 名字:<br>
  <input type="text" name="name"><br>
  電話:<br>
  <input type="text" name="phone">
</form>

參考:https://www.w3schools.com/html/html_forms.asp