html提交按钮未处理action.php
我试图以html形式调用php文件,如代码所示,但发送按钮不起作用,有什么想法吗html提交按钮未处理action.php,php,html,button,action,Php,Html,Button,Action,我试图以html形式调用php文件,如代码所示,但发送按钮不起作用,有什么想法吗 <form id="contact-form" method="post" action="form_send.php"> <fieldset> <label class="name"> <input type="text" value="Your Name" onF
<form id="contact-form" method="post" action="form_send.php">
<fieldset>
<label class="name">
<input type="text" value="Your Name" onFocus="if(this.value=='Your Name'){this.value=''}" onBlur="if(this.value==''){this.value='Your Name'}">
</label>
<label class="phone">
<input type="text" value="Telephone" onFocus="if(this.value=='Telephone'){this.value=''}" onBlur="if(this.value==''){this.value='Telephone'}">
</label>
<label class="email">
<input type="email" value="Email" onFocus="if(this.value=='Email'){this.value=''}" onBlur="if(this.value==''){this.value='Email'}">
</label>
<label class="message">
<textarea onFocus="if(this.value=='Message'){this.value=''}" onBlur="if(this.value==''){this.value='Message'}">Message</textarea>
</label>
<div class="btns"> <a class="button" onclick="clearFunction()" >Clear</a> <a class="button" type="submit" name="submit" value="Send Form" >Send</a> </div>
</fieldset>
</form>
消息
清除发送
您正在使用
标记提交表单
将
Send
替换为您没有在表单中命名任何输入
<input **name='name'** value='Your name'>
<input **name='phone'** value='Phone'>
等等。
在提交之前不要忘记清理数据。…(反SQL注入)
而不是你的OnBlur和OnFocus解决方案:placeholder='your name'
尝试Send
而不是href
发送按钮不起作用
所以你希望我们想象会发生什么?@Fred ii-谢谢你的支持,现在开始工作:)欢迎你,谢谢你的帮助,是的,我使用css作为按钮样式你使用的是超链接标记而不是css
if(isset($_POST['submit'])){
$name=$_POST['name'];
$phone=$_POST['phone'];
$xxx=$_POST['xxx'];
echo $name, $phone; //echoing data.
}