我是 PHP 的新手,我发现简单的数字类型表单输入在 .html 和 .php 文件中的工作方式不同。
代码:
.php 文件:
<form>
<input type="number" name="num1" placeholder = "Number 1">
<input type="text" name="num2" placeholder = "Number 2">
<select name="operator" id="opr1">
<option>Add</option>
<option>Subtract</option>
<option>Multiply</option>
<option>Devide</option>
</select>
<br>
<button name="submit" value = "submit">Calculate</button>
</form>
.html 文件:
<form action="contactform.php" method="GET">
<label for=""></label>
<input type="number" name="number1" step="0.0001" placeholder="number1">
Male:<input type="radio" name="gender" value="Male" checked>
Female:<input type="radio" name="gender" value="Female">
Other:<input type="radio" name="gender" value="Other">
<input type="password" name="pwd" value="">
<textarea name="message" cols="30" rows="10" placeholder="write a message"></textarea>
<select name="carSelect" id="">
<option value="ford">Ford</option>
<option value="volvo">Volvo</option>
<option value="opel">Opel</option>
</select>
<br>
<button type="submit" name="submit">Submit</button>
</form>
结果... php(奇怪的符号而不是数字):
.html 一切正常:
智慧大石
莫回无
繁星coding