B
答案 0 :(得分:0)
尝试将它放在你的html体内。
<script>
if(typeof window.history.pushState == 'function') {
window.history.pushState({}, "Hide", '<?php echo $_SERVER['PHP_SELF'];?>');
}
</script>
答案 1 :(得分:0)
您可以将代码更改为以下内容。
<?php
if(isset($_POST['status'])) {
$thanks = 'Hi, Thank you for this single click!';
}
?>
<html>
<form method="post" action="">
<input type="hidden" name="status" value="data" />
<button type="submit">Giving Thanks</button>
</form>
<?php if(!empty($thanks)) : ?>
<h4><?php echo $thanks;?></h4>
<?php endif; ?>
</html>