Hello out there. I'm having a problem with setting values on a form when it opens. I have set a hidden value (stage) in a form and after this is set everything is fine. However, the statement if (!IsSet($stage)) is not executed until after the stage has been set. All I get the first time I see my form is OriginCity <?php print( ">
Any advice???
Example code:
</head>
<body bgcolor="#FFFFFF">
<?php
/* if first time set values on form to blank */
if (!IsSet($stage))
{
$OriginCity = "";
$DestinationCity = "";
}
else
{
$OriginCity = strtoupper($OriginCity);
$DestinationCity = strtoupper($DestinationCity);
}
?>
<div align="left">
<p align="left"> </p>
<p align="left"> </p>
<form method="post" action="http://gva-ntora6:80/Peter/ProrateCargoFactorDetails.php" name="factor">
<table width="100%" border="0" height="119">
<tr>
<td colspan="3" height="49"><font color="#003366">To obtain a Cargo Prorate
Factor please enter an Origin and Destination three character alpha
code and press SUBMIT</font></td>
</tr>
<tr>
<td width="13%" height="31"><font color="#003366">Origin City</font></td>
<td width="20%" height="31">
<input type="text" name="OriginCity" maxlength="3" value=http://www.phpbuilder.com/board/archive/index.php/"<?php print("$OriginCity"); ?>">
</td>
<td width="67%" height="31"> </td>
</tr>
<tr>
<td width="13%"><font color="#003366">Destination City</font></td>
<td width="20%">
<input type="text" name="DestinationCity" maxlength="3" value="<?php print("$DestinationCity"); ?>">
</td>
<td width="67%">
<input type="hidden" name="stage" value=1>
<input type="submit" name="Submit" value="Submit">
</td>
</tr>
</table></form>
</div>
Any advice???
Example code:
</head>
<body bgcolor="#FFFFFF">
<?php
/* if first time set values on form to blank */
if (!IsSet($stage))
{
$OriginCity = "";
$DestinationCity = "";
}
else
{
$OriginCity = strtoupper($OriginCity);
$DestinationCity = strtoupper($DestinationCity);
}
?>
<div align="left">
<p align="left"> </p>
<p align="left"> </p>
<form method="post" action="http://gva-ntora6:80/Peter/ProrateCargoFactorDetails.php" name="factor">
<table width="100%" border="0" height="119">
<tr>
<td colspan="3" height="49"><font color="#003366">To obtain a Cargo Prorate
Factor please enter an Origin and Destination three character alpha
code and press SUBMIT</font></td>
</tr>
<tr>
<td width="13%" height="31"><font color="#003366">Origin City</font></td>
<td width="20%" height="31">
<input type="text" name="OriginCity" maxlength="3" value=http://www.phpbuilder.com/board/archive/index.php/"<?php print("$OriginCity"); ?>">
</td>
<td width="67%" height="31"> </td>
</tr>
<tr>
<td width="13%"><font color="#003366">Destination City</font></td>
<td width="20%">
<input type="text" name="DestinationCity" maxlength="3" value="<?php print("$DestinationCity"); ?>">
</td>
<td width="67%">
<input type="hidden" name="stage" value=1>
<input type="submit" name="Submit" value="Submit">
</td>
</tr>
</table></form>
</div>