我正在制作一台发电机并且工作正常(付费)但是我试图制作一个免费的“试用”版本并且它搞砸了并且当我点击“生成”时它表示不存在表它说'表'stopnzet_scripts.generator'不存在'我试过四处寻找,但在代码中找不到多少。但这是我发现的可以帮助我的。
<?php
if($freegenerator == "" || $_SESSION['rank'] == 5){
$freegeneratorquery = "SELECT * FROM `freegenerators`";
}else{
$freegeneratorquery = "SELECT * FROM `freegenerators` WHERE `id` = ".$freegenerator;
}
$result = mysqli_query($con, $freegeneratorquery) or die(mysqli_error($con));
while ($row = mysqli_fetch_array($result)) {
echo '
<div class="col-lg-4">
<!--user info table start-->
<section class="panel">
<div class="panel-body">
<div class="task-thumb-details">
<h1>'.$row['name'].' Generator</h1>
</div>
<legend></legend>
<input type="text" id="freegenerator'.$row["id"].'" onclick="select_all(this)" class="text-center form-control" placeholder="username:password"></br>
<button id="generate'.$row["id"].'" class="btn btn-info btn-block">Generate</button></br>
<legend></legend>
<form id="flagform'.$row["id"].'" action="freegenerator.php" method="POST">
<input type="hidden" id="flag'.$row["id"].'" name="flagalt" value="">
<input type="hidden" name="freegenerator" value="'.$row["id"].'">
<div class="btn-group btn-group-justified">
<a id="copy'.$row["id"].'" data-clipboard-target="freegenerator'.$row["id"].'" title="Copy" class="btn btn-success">Copy</a>
<a href="javascript:void(0);" onclick=$(this).closest("form").submit(); title="Flag as invalid" class="btn btn-danger">Flag as invalid</a>
</div>
</form>
</div>
</section>
<!--user info table end-->
</div>
';
}
?>
返回页首php代码
<?php
include "inc/header.php";
$result = mysqli_query($con, "SELECT * FROM `subscriptions` WHERE `username` = '$username' AND `active` = '1' AND `expires` >= '$date'") or die(mysqli_error($con));
if (mysqli_num_rows($result) < 0 && $_SESSION['rank'] != "5") {
header('Location: purchase.php');
}
if (isset($_POST['flagalt']) && isset($_POST['freegenerator'])){
$alt = mysqli_real_escape_string($con, str_replace("\r\n", "", urldecode($_POST['flagalt'])));
$freegeneratorid = mysqli_real_escape_string($con, $_POST['freegenerator']);
mysqli_query($con, "UPDATE `freegenerator$freegeneratorid` SET `status` = '2' WHERE `alt` = '$alt'") or die(mysqli_error($con));
}
$totalalts = 0;
$result = mysqli_query($con, "SELECT * FROM `freegenerators`") or die(mysqli_error($con));
while($row = mysqli_fetch_assoc($result)) {
$result2 = mysqli_query($con, "SELECT * FROM `freegenerator$row[id]` WHERE `status` != '0'") or die(mysqli_error($con));
$totalalts = $totalalts + mysqli_num_rows($result2);
}
?>
freegenerator php code
<?php
if($freegenerator == "" || $_SESSION['rank'] == 5){
$freegeneratorquery = "SELECT * FROM `freegenerators`";
}else{
$freegeneratorquery = "SELECT * FROM `freegenerators` WHERE `id` = ".$freegenerator;
}
$result = mysqli_query($con, $freegeneratorquery) or die(mysqli_error($con));
while ($row = mysqli_fetch_array($result)) {
echo '
<div class="col-lg-4">
<!--user info table start-->
<section class="panel">
<div class="panel-body">
<div class="task-thumb-details">
<h1>'.$row['name'].' Generator</h1>
</div>
<legend></legend>
<input type="text" id="freegenerator'.$row["id"].'" onclick="select_all(this)" class="text-center form-control" placeholder="username:password"></br>
<button id="generate'.$row["id"].'" class="btn btn-info btn-block">Generate</button></br>
<legend></legend>
<form id="flagform'.$row["id"].'" action="freegenerator.php" method="POST">
<input type="hidden" id="flag'.$row["id"].'" name="flagalt" value="">
<input type="hidden" name="freegenerator" value="'.$row["id"].'">
<div class="btn-group btn-group-justified">
<a id="copy'.$row["id"].'" data-clipboard-target="freegenerator'.$row["id"].'" title="Copy" class="btn btn-success">Copy</a>
<a href="javascript:void(0);" onclick=$(this).closest("form").submit(); title="Flag as invalid" class="btn btn-danger">Flag as invalid</a>
</div>
</form>
</div>
</section>
<!--user info table end-->
</div>
';
}
?>