我希望以安全的方式从输入表单中获取密码。最初我使用的是$ _POST [],但我想要一种更安全的方法,这种方法相当简单有效。
GetElementById似乎不是一个很好的解决方案,但如果您认为不是,请告诉我,因为我想在其他地方使用它,如果是的话。
HTML
<form id="form1" name="form1" method="POST" action="getData">
<h1>Quick Query</h1>
<div class="floating-placeholder">
<input id="origin" name="origin" type="text" placeholder="Number" value="5"/>
<label for="origin"></label>
</div>
<div class="floating-placeholder">
<input id="destination" name="destination" type="text" placeholder="Number" value="4"/>
<label for="destination"></label>
</div>
<div>
<select name="transitType" id="transitType">
<option>drive</option>
<option>cycling</option>
<option>transit</option>
</select>
</div>
<label>
<input type="submit" />
</label>
</form>