Hey there again,
I have made a form which allows users to train soldiers depending on whether or not they have the resources. The content concerned is set out like this:
-- Header --
-- Info Bar (how much gold etc available) --
-- Form --
-- Footer --
Here is a screen shot:
Now when I submit the form, it updates everything except for the Info Bar. Obviously when you refresh the page, the Info Bar is correct, but submitting the form doesn't effect the Info Bar at all. I do not want to have the Info Bar in the form!
Is there anyway which I could submit the form (without including the Info Bar in the form) and have that line of code updated?
Thanks for your time!
[PHP]<?php include("../main/header.php"); ?>
<?php include('../age_0/forms/army_form.php') ; ?>
<?php
if ($_SESSION['user_name'] == NULL)
{
echo("<p class=\"error\" >You have not filled in your username/password. </p><br />");
} else {
?>
<?php
if ($tansaction_co nfirmed == TRUE) { echo ('<b>Transactio n completed!</b>'); }
?>
<?php include('../age_0/army_files/user_race_data. php'); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#00000 0">
<tr>
<td class="TL_2">&n bsp;</td>
<td class="T_2">&nb sp;</td>
<td class="TR_2">&n bsp;</td>
</tr>
<tr>
<td class="L_2">&nb sp;</td>
<td>
<?php include('../age_0/army_files/unit_table.php' ); ?>
</td>
<td class="R_2">&nb sp;</td>
</tr>
<tr>
<td class="BL_2">&n bsp;</td>
<td class="B_2">&nb sp;</td>
<td class="BR_2">&n bsp;</td>
</tr>
</table>[/PHP]
[PHP]<?php
if ( ($_SERVER['REQUEST_METHOD '] == 'POST') && isset($_POST['disband_s_f']) && isset($_POST['disband_s_r']) && isset($_POST['disband_s_m']) && isset($_POST['recruit_s_f']) && isset($_POST['recruit_s_r']) && isset($_POST['recruit_s_m']) )
{
if ($_SESSION['user_name'] == NULL)
{
echo("<p class=\"error\" >You have not logged in yet. Click <a href=\"../age_0/login.php\">her e</a> to login. </p><br />");
} else {
/*-----------------------------------------------------------------------------------------------------------------------
mySQL Connect Code
-----------------------------------------------------------------------------------------------------------------------*/
...
/*-----------------------------------------------------------------------------------------------------------------------
Data Collection Code
-----------------------------------------------------------------------------------------------------------------------*/
...
/*-----------------------------------------------------------------------------------------------------------------------
Buy Code
-----------------------------------------------------------------------------------------------------------------------*/
$new_stats_s_f = ( $_SESSION['stats_s_f'] + $_POST['recruit_s_f'] );
...
mysql_query("UP DATE supwar_stats SET stats_s_f='$new _stats_s_f' WHERE stats_name='$us er_name'") or die('I cannot update Stats Table because: ' . mysql_error());
...
...
$_SESSION['stats_s_f'] = $new_stats_s_f;
...
$_SESSION['stats_food'] = $new_stats_food ;
$transaction_co nfirmed = TRUE;
//-----------------------------------------------------------------------------------------------------------------------
}
}
}
?>[/PHP]