<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ya LOL</title>
<script src="https://code.jquery.com/jquery-3.4.1.js"></script>
<script>
function getdata() {
var str = 1;
$.ajax({
type: "POST",
url: "menu.php",
data: {fstr:str},
success: function(data){
$('#lol').html(data);
}
})
}
</script>
</head>
<body>
<main>
<input type="text" name=str id=str>
<input type="button" name=but id=sub value=sub onclick="getdata()">
<?php //вот это нахрен отсюда!!! require('menu.php') ?>
<div id="lol"></div>
</main>
</body>
</html>
$response = $_POST["g-recaptcha-response"];
if (empty($response)) {
//false;
}
$url = 'https://www.google.com/recaptcha/api/siteverify';
$data = array(
'secret' => '',
'response' => $response
);
$options = [
'http' => [
'method' => 'POST',
'content' => http_build_query($data)
]
];
$context = stream_context_create($options);
$verify = file_get_contents($url, false, $context);
$captcha_success = json_decode($verify, true);
if (!$captcha_success->success) {
//false
}
$('.to-mob').each(function() {
$('.param .param_title').click(function() {
var parent = $(this).parent();
parent.find('.param_list').slideToggle();
$(".filter-wrap .param").not(parent).find('.param_list').slideUp();
});
$(this).clone().appendTo('#side-panel');
});
$('.param .param_title').click(function() {
var parent = $(this).parent();
parent.find('.param_list').slideToggle();
$(".filter-wrap .param").not(parent).find('.param_list').slideUp();
});
<a class="rez" style="display:none" download="" href="" target="_blank"></a>
jQuery.ajax({
type: "POST",
url: "report.php",
data: arr,
success: function(data){
var result = jQuery.parseJSON( data );
jQuery('.rez').attr('href', result.doc);
jQuery('.rez')[0].click();
}
});
$uniqid = uniqid();
$pdf = new PDF();
........
$path = "pdf/".$uniqid.".pdf";
$pdf->Output($path,'F');
$doc = 'pdf/'.$uniqid.'.pdf';
echo json_encode(array('doc' => $doc ));
jQuery(document).ready(function($){
$.ajax({
url: "wp-admin/admin-ajax.php",
data: {
action: 'myajax',
product_id: $product_id,
qty : $qty,
};
});
});
function myajax() {
$product_id= intval( $_POST['product_id'] );
$qty= intval( $_POST['qty'] );
global $woocommerce;
$woocommerce->cart->add_to_cart($product_id, $qty);
die();
}