我正在用 JQuery 开发一个 web 表单并通过 post 发送到 PHP 页面。
它看起来像这样:
$('#form-signup').submit(function(e)
{
$.ajax(
{
type: 'POST',
data: { name: $('#name').val() },
url: 'signup_backend.php',
success: function(data, textStatus, jqXHR)
{
},
error: function(jqXHR, textStatus, errorThrown)
{
alert('error');
}
});
我的网络表单如下所示:
<form id="form-signup" action="">
<fieldset>
<label for="name">Nome</label>
<input type="text" id="name" name="name" value="<?=$name?>"><span class="required">*</span>
</fieldset>
<fieldset>
<label for="email">Email</label>
<input type="email" id="email" name="email" value="<?=$email?>"><span class="required">*</span>
</fieldset>
<fieldset>
<label for="tel">Telefone</label><input type="tel" id="tel" name="tel" value="<?=$tel?>"><span class="required">*</span>
</fieldset>
<fieldset>
<div>
<label class="blocker">Tipo de anunciante</label><span class="required">*</span>
</div>
<input type="radio" name="advertiser" id="advertiser_1">
<label for="advertiser_1" class="aleft">Particular</label>
<input type="radio" name="advertiser" id="advertiser_2">
<label for="advertiser_2" class="aleft">Imobiliária</label>
</fieldset>
<fieldset>
<label for="password">Senha</label>
<input type="password" id="password" name="password" value="<?=$password?>"><span class="required">*</span>
</fieldset>
<fieldset>
<label for="check-password">Confirmação da senha</label>
<input type="password" id="check-password" name="check_password" value="<?=$check_password?>"><span class="required">*</span>
</fieldset>
<fieldset>
<input type="submit" value="Enviar" id="sub">
</fieldset>
</form>
当我收到退货时,我的地址显示如下:
http://localhost:8888/guia/web/adm/signup.php?name=John&email=&tel=&password=&check_password=
有没有办法避免我的地址栏中的这些数据?
多谢你们