所以在我的主页上我有
<?php
require_once('config.inc.php');
require_once($rootdir . $dirsubfolder . 'navbar.php');
?>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?libraries=geometry&sensor=true"></script>
<script src="php/findme.php"></script>
<div class="hero hero-unit" style="padding: 0; padding-top: 3%;">
<div id="search" class='input-append'><input id="setNewDistance" class="span3" type="text" placeholder="Set Distance In Meters">
<button class='btn btn-info' id="changeDistance" type="submit">Search
</button></div>
<p class='alert-info' id="stopsfoundtext"></p>
<div id="gmaps"></div>
</div>
<?php
require_once($rootdir . $dirsubfolder . 'footer.php');
?>
然后在 Findme.php 我有
<?php
/* Include neccesary files */
require_once('config.inc.php');
$gPlantSite = $_GET['plantsite'];
/* Connect to Database */
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_BASE);
/* Prepare Database statement */
if ($stmt = $mysqli -> prepare("SELECT route_id, Latitude, Longitude, Title, Weekday_Day, Weekend_Day, ADO_Day, Weekday_Night,
Weekend_Night, ADO_Night, Direction_Of_Bus,
What_Shift FROM Routes WHERE Plant_Site = ?")) {
/* Bind param to search for */
$stmt -> bind_param('s', $gPlantSite);
/* Execute and hope it works */
$stmt -> execute();
/* Bind the results to variables */
$stmt -> bind_result($gRoute_Id, $gLatitude, $gLongitude, $gTitle, $gWeekdayDay, $gWeekendDay, $ADODay,
$WeekdayNight, $WeekendNight, $ADONight, $gDirectionOfBus, $gwhatShift);
/* Leave connection open so that it may be queryd on the client side */
include "../js/findme.js.php";
}
?>
但它似乎仍然没有从 php 文件中获取 $_GET,任何人都知道我在这里没有想法
我只需要它来获得我尝试使用发布的想法作为答案的 $_GET ,但这似乎对我不起作用。