我正在與下載計數器一個下載頁面,我的代碼:汽車executeing PHP代碼
<?
function getDownload($download_id) {
if ($download_id === 'SteamKey') {
$file = 'SteamKey.txt';
$count = file_exists($file) ? file_get_contents($file) : 0;
file_put_contents($file, ++$count);
$file2 = 'total.txt';
$count2 = file_exists($file2) ? file_get_contents($file2) : 0;
file_put_contents($file2, ++$count2);
header('Location: http://sh0t.ml/Beta/apps/FakeSteamKeyGen.zip');
}
}
?>
HTML:
<div class="row product-list">
<div style='background-image: url("/Beta/img/steamkeygen.png"); width: 500px; position: relative; height: 293px; margin-left: 10px;'>
<center>
<input style='position: absolute; bottom: 5px; width: 480px; margin-left: 10px;' onclick='<?php getDownload('SteamKey'); ?>' type='button' class='btn btn-info btn-lg btn-block'>Download</button>
</center>
</div>
</div>
當過的頁面被加載的getDownload('SteamKey');
被執行,請幫助!