所以我的主頁上我有
<?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我嘗試使用發佈的想法作爲答案,但似乎並沒有爲我工作。
我不明白這個問題。 js在哪裏?以上都是PHP。 – mkaatman 2013-03-08 23:09:31
您是否嘗試過使用Ajax? – kabuto178 2013-03-08 23:09:40
@mkaatman該文件是<?php require_once()?>在我的.js.php文件中 – Datsik 2013-03-08 23:11:55