0

我希望我的头衔不会让任何人混淆。让我先向您展示我的代码,然后解释我想做什么。

这是主要的探索页面

<?php

$ingame = "*";
require 'includes/header.php';
include 'includes/modzoideditables.php';
include 'includes/zoideditables.php';
include 'includes/offdefvalues.php';
$move = 1;
?>
<center>
Choose Your Destination Below
<BR><BR><a href="/gonorth.php">NORTH</a> <BR>
<a href="/goeast.php">EAST</a><BR>
<a href="/gosouth.php">SOUTH</a><BR>
<a href="/gowest.php">WEST</a><BR>
</center>

<BR><BR><center>You are Currently located at <?=$user['uCord1']?>,<?=$user['uCord2']?></center>
 <?
require 'includes/footer.php';

?>

这是北页

<?php

$ingame = "*";
require 'includes/header.php';
include 'includes/modzoideditables.php';
include 'includes/zoideditables.php';
include 'includes/offdefvalues.php';
$move = 1;
 $db->query( "UPDATE users SET uCord2=uCord2+$move WHERE uID='" . $user['uID'] . "'" );
?>
<center>
Choose Your Destination Below
<BR><BR><a href="/gonorth.php">NORTH</a> <BR>
<a href="/goeast.php">EAST</a><BR>
<a href="/gosouth.php">SOUTH</a><BR>
<a href="/gowest.php">WEST</a><BR>
</center>

<BR><BR><center>You are Currently located at <?=$user['uCord1']?>,<?=$user['uCord2']?></center>
 <?
require 'includes/footer.php';

?>

这是东页

<?php

$ingame = "*";
require 'includes/header.php';
include 'includes/modzoideditables.php';
include 'includes/zoideditables.php';
include 'includes/offdefvalues.php';
$move = 1;
 $db->query( "UPDATE users SET uCord1=uCord1+$move WHERE uID='" . $user['uID'] . "'" );
?>
<center>
Choose Your Destination Below
<BR><BR><a href="/gonorth.php">NORTH</a> <BR>
<a href="/goeast.php">EAST</a><BR>
<a href="/gosouth.php">SOUTH</a><BR>
<a href="/gowest.php">WEST</a><BR>
</center>

<BR><BR><center>You are Currently located at <?=$user['uCord1']?>,<?=$user['uCord2']?></center>
 <?
require 'includes/footer.php';

?>

南页

<?php

$ingame = "*";
require 'includes/header.php';
include 'includes/modzoideditables.php';
include 'includes/zoideditables.php';
include 'includes/offdefvalues.php';
$move = 1;
 $db->query( "UPDATE users SET uCord2=uCord2-$move WHERE uID='" . $user['uID'] . "'" );
?>
<center>
Choose Your Destination Below
<BR><BR><a href="/gonorth.php">NORTH</a> <BR>
<a href="/goeast.php">EAST</a><BR>
<a href="/gosouth.php">SOUTH</a><BR>
<a href="/gowest.php">WEST</a><BR>
</center>

<BR><BR><center>You are Currently located at <?=$user['uCord1']?>,<?=$user['uCord2']?></center>
 <?
require 'includes/footer.php';

?>

西页

<?php

$ingame = "*";
require 'includes/header.php';
include 'includes/modzoideditables.php';
include 'includes/zoideditables.php';
include 'includes/offdefvalues.php';
$move = 1;
$db->query( "UPDATE users SET uCord1=uCord1-$move WHERE uID='" . $user['uID'] . "'" );
?>
<center>
Choose Your Destination Below
<BR><BR><a href="/gonorth.php">NORTH</a> <BR>
<a href="/goeast.php">EAST</a><BR>
<a href="/gosouth.php">SOUTH</a><BR>
<a href="/gowest.php">WEST</a><BR>
</center>

<BR><BR><center>You are Currently located at <?=$user['uCord1']?>,<?=$user['uCord2']?></center>
 <?
require 'includes/footer.php';

?>

如您所见,非常简单,这里没有任何实际情况。除了事情之外,一切都按照我想要的方式工作。当它说

"You are Currently located at <?=$user['uCord1']?>,<?=$user['uCord2']?>"

它不显示用户的当前 DB 值,而是显示先前的值。所以如果他们再往北走。下一页将显示他们以前的坐标,而不是当前坐标。

对此问题的任何快速修复。基本上我希望在不使用任何额外页面的情况下显示任何文本之前进行数据库查询。

4

0 回答 0