Please help if ya can. I am using a form where I can add data to a database and update some info at the same time. But for some reason when the for is pressed and it loops the same page it is not picking up the IF statement. Here is some snipet of the code below.
include("extention.inc");
include("date.inc");
include("wars.inc");
if (!IsSet($mainfile)) { include ("mainfile.$phpEx");}
$message = "";
$oldclanid = $clanid;
$date = time();
$type = 4;
$map1 = 1;
$map2 = 2;
if ( isset( $actionflag ) && $actionflag=="creategame" )
{
foreach ( array( "months", "years", "days", "minutes" )
as $date_unit )
{
if ( ! isset( $form[$date_unit] ) )
{
$message .= "PANIC: Can't make sense of that date";
break;
}
}
$date = mktime( $form[hours], $form[minutes], 0, $form[months], $form[days], $form[years] );
if ( $date < time() )
$message .= "You've chosen a date in the past!";
if ( $message = "" )
{
updateclaninfo( $form[clan_abb], $form[clan_name], $form[clan_url], $form[clan_contact], $form[clan_icq], $form[clan_email], $clanid );
insertoldclangame( $form[map1], $form[map2], $oldclan_id, $form[leagues], $form[no_players], $date );
header( "Location: ../wars.php" );
}
}
include("header.$phpEx");
And below is some of the form
<form action="<?php print $PHP_SELF;?>">
<input type="hidden" name="actionflag" value="creategame">
<input type="hidden" name="clan_id" value="<?php echo "$oldclan_id;" ?>">
<table width="100%" border="0">
<tr><td width="26%">
<div align="left">Clan Abbrivation <font size="1"><b>(ie[NuTa])</b></font></div>
</td><td width="74%">
<input type="text" name="form[clan_abb]" value="<?php echo "$clan_abb"; ?>" size="10">
</td></tr><tr><td width="26%">
<div align="left">Clan Name</div>
</td><td width="74%">
<input type="text" name="" value="<?php echo "$clan_name"; ?>" size="50">
</td></tr><tr><td width="26%">
<div align="left">Clan URL</div>
</td><td width="74%">
bla bla.
I know it is passing the variable actionflag but is not processing the if statement. see below
http://192.168.0.1:1058/oldclannewgame.php?actionflag=creategame&clan_id=2bla bla bla
Any ideas ??
Please