<!DOCTYPE html>
<html>
<head>
<title>JS</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css.css">
<script type="text/javascript" src="jquery-3.2.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#but').click(function() {
var state = { 'page_id': 1, 'user_id': 5 };
var title = 'Hello World';
var url = '?page=two';
history.pushState(state, title, url);
});
});
</script>
</head>
<body>
<div id="but">ЖМИ!</div>
<?php
$page = $_GET['page'];
if ($page == "two") {
echo "two";
}
?>
</body>
</html>