0

私の肩書で誰かを混同しないことを願っています。最初に私のコードを見せてから、私がやりたいことを説明しましょう。

HEREはメインのEXPLORE PAGEです

<?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 値は表示されず、以前の値が表示されます。彼らが再び北に行くとしたら。次のページには、現在ではなく以前の座標が表示されます。

この問題の簡単な修正。基本的に、余分なページを使用せずにテキストを表示する前に、DB クエリを実行したいと考えています。

4

0 に答える 0