App\Application
, если туда никто не лазил — можно сравнить с оригиналом. А раз туда кто-то лазил, то к нему и вопросы. <form name="formName" action="data" onsubmit="sendForm(event)">
<input type="text" name="input_1">
<input type="text" name="input_2">
<button type="submit">отправить</button>
</form>
function sendForm(event){
event.preventDefault;
event.stopPropagation();
let form = document.forms.formName;
let formData = new FormData(form);
formData.append = ("action","insert");
fetch(url,{
method: "POST",
body: formData
}).then(function(response){
return response.json();
}).then(function(json){
console.log(json);
})
}
<input type="hidden" name="label" value="<?php echo $uid; ?>;<?php echo $tariff; ?>;<?php echo $publications; ?>">
<input type="hidden" name="label" value="99999;10;90">
$label_arr = explode(";", $label);
echo $label_arr[0]; // uid - 99999
echo $label_arr[1]; // tariff - 10
echo $label_arr[1]; // publications - 90
function getHashParams(link) {
return (link.match(/([^#=&]+)(=([^&]*))/g) || []).reduce(function (a, b) {
return ((a[b.slice(0, b.indexOf('='))] = b.slice(b.indexOf('=') + 1)), a);
}, {});
}
getHashParams('https://oauth.vk.com/blank.html#access_token=f95b38f461921538c204e7218e43cdc9bc40fdbf378c1adb68967c2f8b84603397f9226b7&expires_in=0&user_id=11111111')
//> {access_token: "f95b38f461921538c204e7218e43cdc9bc40fdbf378c1adb68967c2f8b84603397f9226b7", expires_in: "0", user_id: "11111111"}
<?php
//yandex http-notification
$secret='XXXXXXXXXXXXXXXXXXXXXXX';
if ($_POST) {
$params='notification_type&operation_id&amount¤cy&datetime&sender&codepro';
$params=explode('&',$params);
$forHASH=array();
foreach($params as $key=>$p) {
if (isset($_POST[$p])) array_push($forHASH,$_POST[$p]);
}
if ($secret!="") array_push($forHASH,$secret);
if (isset($_POST['label'])) array_push($forHASH,$_POST['label']);
$forHASH=implode('&',$forHASH);
if ($_POST['sha1_hash']===sha1($forHASH) && $_POST['codepro']!=='true') { //transact ok.
////////////////////////////////
/////// Платёж прошел /////////
////////////////////////////////
$status="Успешно!";
$id=$_POST['label'];
$money=$_POST['amount'];
$tranid=$_POST["operation_id"];
$flow="in";
$paysystem="ym";
$ymfrom=$_POST['sender'];
/*что-то делаем....*/
////////////////////////////////
}
}