jQuery中的SQL语法验证 [英] SQL syntax validation in jQuery

查看:102
本文介绍了jQuery中的SQL语法验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨:

我的代码之友PHP部分工作正常,但只打印了jQuery消息否

感谢您的提示。



  function  signin(){
var user = document .getElementById(' txtuser')值;
var pass = document .getElementById(' txtpass')。value;
$ .post(' vorod.php',{txtuser:user,txtpass:pass },
function (data)
{

if (data [' success'])
alert( ok);
else alert( noo);
// location.replace('/ h_free_software / index.php');

});
}





php code:

 <?php  
$ json_ret = array(' success' => false);
include( send.php);
$ obj = new classconnect();
$ obj-> funcconnect();
$ _user = $ _ POST [txtuser];
$ _pass = $ _ POST [txtpass];
$ querylog = mysql_query( SELECT * FROM _tbvorod WHERE`_use_r` ='{$ _ user}'AND _pas_s = '{$ _通}');
if($ querylog){
$ _SESSION [admin] = $ _ user;
$ json_ret [' success'] = true;
}




?>

< br $>


另一种告诉我是否感激你的方法

解决方案

.post(' vorod.php',{txtuser:user,txtpass:pass},
函数(数据)
{

if (data [' success'])
alert( ok);
else alert( noo);
// location。 replace('/ h_free_software / index.php');

});
}





php code:

 <?php  


json_ret = array(' success' => false);
include( send.php);


< blockquote> obj = new classconnect();


Hi:
Friends of my code PHP part is working properly, but the jQuery only message is printed No
Thanks for the tips here.

function signin(){
	var user=document.getElementById('txtuser').value;
	var pass=document.getElementById('txtpass').value;
	$.post('vorod.php',{txtuser:user,txtpass:pass},
	function(data)
	{

	if(data['success'])
	alert ("ok");
	else alert ("noo");
		//location.replace('/h_free_software/index.php');
	
	});
	}



php code:

<?php
$json_ret = array('success'=>false);
include ("send.php");
$obj=new classconnect();
$obj->funcconnect();
$_user=$_POST[txtuser];
$_pass=$_POST[txtpass];
$querylog=mysql_query("SELECT * FROM  _tbvorod WHERE `_use_r`='{$_user}' AND _pas_s='{$_pass}'");
if($querylog){
   $_SESSION[admin]=$_user;
   $json_ret['success'] = true;
	}
	
	


?>



Another way to tell if I am grateful to you

解决方案

.post('vorod.php',{txtuser:user,txtpass:pass}, function(data) { if(data['success']) alert ("ok"); else alert ("noo"); //location.replace('/h_free_software/index.php'); }); }



php code:

<?php


json_ret = array('success'=>false); include ("send.php");


obj=new classconnect();


这篇关于jQuery中的SQL语法验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆