I have this error in my html:
Notice: Undefined index: send in C:\xampp\htdocs\liciteiro\search_clientes.php on line 3 false
i need to request data with mysql+ php to my html. i use method post;
i'm use this codes:
Jquery Post Code:
$(function(){ $("#send").click(function() { var json = $.parseJSON($("#json").val()); var url2 = $("#url2") .val(); $.post(url2,json,function(data){ $('div#status').html(data); }); });
HTML CODE:
<div id="form1" class="send">
<p>URL:<input type="text" name="url2" id="url2" /></p>
<p> JSON:<textarea name="json" id="json" cols="45" rows="5"></textarea></p>
<p><input type="submit" class="button" name="send" value="send" id="send" /></p>
</div>
<div id="status">
RETORNO:
<!-- <textarea name="comment" id="comment" cols="45" rows="5"></textarea> -->
</p>
</div>
PHP CODE:
include ('conection.php');
$data = $_POST['send'];
$arr = json_decode($data);
//$arr = json_decode($_POST['json']);
$result = mysql_query("SELECT * FROM clientes WHERE client_descricao='".$arr[0]['client_descricao']."' OR client_razaosocial ='".$arr[0]['client_razaosocial']."' OR client_endereco ='".$arr[0]['client_endereco']."' OR client_cidade ='".$arr[0]['client_cidade']."' OR client_estado ='".$arr[0]['client_estado']."' OR client_telefone ='".$arr[0]['client_telefone']."'")or die(mysql_error());
$json = mysql_fetch_array($result, MYSQL_ASSOC);
echo json_encode($json);
i need put data requested in div status, please help me.