我正在bluemix devOps中构建验证表单。我正在使用jQuery并使用php来检查数据库中是否已有现有的电子邮件地址。使用此代码:
if(error == 0){
$.post('validateEmail.php', {uEmail:email}, function(data){
alert(data);
if(parseInt(data) > 0){
$("input[name='email']").after("<div class='emailInput validationError'>"+span_error_start+errormsg[8]+span_error_end+"</div>").addClass("input_error");
}
else{
$(".myForm").submit();
}
所以当数据库中已经有一封电子邮件给我一个其他时它给我一个0当我提醒数据我得到这个:
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
with a 1 or a 0.
因为它给了我这个文本我的IF语句不起作用。有人知道这个错误吗?
答案 0 :(得分:0)
我发现了这个问题,我为我的数据库连接包含了一个php,并且该文件出现了正文。所以我删除了那个文本,代码也运行了!