0
I’m having problems with jquery because it rather print on the screen only echo of my php it is printing all index on the screen how to solve this ?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
function enviar(){
var bin = $("#bin_id").val();
var linhaenviar = bin.split("\n");
var index = 0;
linhaenviar.forEach(function(value){
setTimeout(
function(){
$.ajax({
url: 'index.php',
type: 'POST',
dataType: 'html',
data: "bin=" + value,
success: function(resultado){
document.write(resultado + "<br>");
}
})
}, 10 * index);
index = index + 3;
})
}
</script>
<?php
error_reporting(0);
if ($_POST['ip']) {
$bin = substr($_POST['ip'], 0, 90);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "fonte dps testes");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, "fonte dos testes" );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$s = curl_exec($ch);
$pop = preg_match( '/<p>(.*)<\/p>/si' , $s , $match);
$vdd = ' ';
if($pop >= "1")
{ $vdd = "<b><font color='red'>#DIE_IPS </font></b>"; }
else { $vdd = "<b><font color='green'>#LIVE_IPS </font></b>"; }
$tudo = " [".$ip." ".$vdd."] ";
echo "<br><br><center>".$vdd." ".$ip."</center>";
}else{}
?>
You can show how your PHP code is ?
– GeekSilva
Please also show your PHP,
– Rafael Augusto
I edited the question there is php
– Bruno Lazarine
@Brunolazarine PHP is bundled with HTML? or in the file, it only has this PHP code?
– Rafael Augusto
This together and I want to print only the result of php
– Bruno Lazarine
To print only PHP echo, it must be in a file without the presence of HTML
– GeekSilva
More I wish it to be printin the index at the bottom of textarea without redirection as I do ?
– Bruno Lazarine
Use Jquery with a selector. For example if below the textarea you have a div whose id is Response, do : $("#Response"). html(result); This code goes inside the Success in the $.ajax call
– GeekSilva
Thank you for giving me a light, but how I would inplementaria this change in my code ?
– Bruno Lazarine