$("#formphone").submit(function(e){
e.preventDefault();
var str=$(this).serialize();
console.log(str);
$.ajax({
type:'POST',
url:'/netcat/add.php?isNaked=1&ajax=1',
data:str,
success: function(data, status, xhr) {
console.log(data);
if(xhr.responseText!=1){
$('.messages_txt').html(xhr.responseText)
} else {
$('#pop-up button').click();
$('a#go').click();
setTimeout(function() {window.location.reload();}, 3000);
}
},
});
return false;
});
<p id="moto" style="position:absolute; top:100px; left:0px">1</p>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<!--<button onclick="let year = prompt('В каком году появилась спецификация ECMAScript-2015?', '');
if (year == 2015) alert( 'да!' );">ggt</button>-->
<script>
let 1 box = '0' ;
</script>
<p id="moto" style="position:absolute; top:100px; left:0px">1</p>
<button id="btn_modal_window" style="color: #fff;
text-decoration: none;
user-select: none;
background: rgb(212,75,56);
padding: .7em 1.5em;
outline: none;
border: 1px solid black;">Shoр</button>
<div id="my_modal" class="modal">
<div class="modal_content">
<span class="close_modal_window">x</span>
<h2 align="center">Shop</h2>
<script>
let q6 = '5';
alert(q6);
let i = 100;
//while (i) {
//alert ( i-- );
//}
</script>
<p>Ввести код
<button onclick="let year = prompt('', '');
if (year == 2015) {alert( 'Вы правы!' );q6 = '1000';alert(q6);}">ggt</button></p>
</div>
</div>
<style>
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0,0,0,0.6);
z-index: 1000;
}
.modal .modal_content {
background-color: #fefefe;
margin: 15% auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
z-index: 99999;
}
.modal .modal_content .close_modal_window {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
cursor: pointer;
}
</style>
<script>
var modal = document.getElementById("my_modal");
var btn = document.getElementById("btn_modal_window");
var span = document.getElementsByClassName("close_modal_window")[0];
btn.onclick = function () {
modal.style.display = "block";
}
span.onclick = function () {
modal.style.display = "none";
}
window.onclick = function (event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>
<!--<input type="button" value="Shop"
id="btn_modal_window">-->
<input type="button" value="|" onclick="car_down()" style="color: #fff;
text-decoration: none;
user-select: none;
background: rgb(212,75,56);
padding: .7em 1.5em;
outline: none;
border: 1px solid black;">
<input type="button" value="^" onclick="car_up()" style="color: #fff;
text-decoration: none;
user-select: none;
background: rgb(212,75,56);
padding: .7em 1.5em;
outline: none;
border: 1px solid black;">
<input type="button" value="<" onclick="car_left()" style="color: #fff;
text-decoration: none;
user-select: none;
background: rgb(212,75,56);
padding: .7em 1.5em;
outline: none;
border: 1px solid black;">
<input type="button" value=">" onclick="car_right()" style="color: #fff;
text-decoration: none;
user-select: none;
background: rgb(212,75,56);
padding: .7em 1.5em;
outline: none;
border: 1px solid black;">
<p>Money: </p><h2 id="q6"></h2>
<div id="qwerty"></div>
<script>
let money = '1';
alert(money);
let deg = '0';
alert(deg);
let windowWidth = window.innerWidth;
let windowHeight = window.innerHeight;
function car_down() {
x = document.getElementById("moto").offsetTop;
xn = x + 50;
if (xn > windowHeight) {
xn = windowHeight - 50;
}
document.getElementById("moto").style.top = xn + "px";
}
function car_up() {
x = document.getElementById("moto").offsetTop;
xn = x - 50;
if (xn < 50) {
xn = 50
}
document.getElementById("moto").style.top = xn + "px";
}
function car_left() {
x = document.getElementById("moto").offsetLeft;
xn = x - 50;
if (xn <= 0) {
xn = 0;
}
document.getElementById("moto").style.left = xn + "px"
}
function car_right() {
x = document.getElementById("moto").offsetLeft;
xn = x + 50;
if (xn >= windowWidth) {
xn = windowWidth - 50;
}
document.getElementById("moto").style.left = xn + "px"
}
</script>
</body>
</html>
<?php
if(isset($_FILES) && $_FILES['inputfile']['error'] == 0){ // Проверяем, загрузил ли пользователь файл
$destiation_dir = dirname(__FILE__) .'/'.$_FILES['inputfile']['name']; // Директория для размещения файла
move_uploaded_file($_FILES['inputfile']['tmp_name'], $destiation_dir ); // Перемещаем файл в желаемую директорию
echo 'File Uploaded'; // Оповещаем пользователя об успешной загрузке файла
}
else{
echo 'No File Uploaded'; // Оповещаем пользователя о том, что файл не был загружен
}
?>
<html>
<head>
<title>Basic File Upload</title>
</head>
<body>
<h1>Basic File Upload</h1>
<form method="post" action="basic.php" enctype="multipart/form-data">
<label for="inputfile">Upload File</label>
<input type="file" id="inputfile" name="inputfile"></br>
<input type="submit" value="Click To Upload">
</form>
</body>
</html>