HI,
i am a beginner to PHP and am stuck!
the thing is that i am using Windows 2000,PHP4.3.9 and Apache 1.3
and am using mozilla firefox 1.0 browser
by default in PHP.ini, the option for global variables is set to off
register_globals = Off
ok now the problem is that...i am trying to run the following code
TEXT.HTML
<HTML>
<HEAD></HEAD>
<BODY>
<FORM METHOD=GET ACTION="text.php">
What price of car are you looking to buy?
<BR>
<BR>
<SELECT NAME="Price">
<OPTION>Under $5,000</OPTION>
<OPTION>$5,000-$10,000</OPTION>
<OPTION>$10,000-$25,000</OPTION>
<OPTION>Over $25,000</OPTION>
</SELECT>
<BR>
<BR>
What size of engine would you consider?
<BR>
<BR>
<SELECT NAME="EngineSize[]" MULTIPLE>
<OPTION>1.0L</OPTION>
<OPTION>1.4L</OPTION>
<OPTION>1.6L</OPTION>
<OPTION>2.0L</OPTION>
</SELECT>
<BR>
<BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>
and TEXT.PHP
<HTML>
<HEAD></HEAD>
<BODY>
<?php
echo "Price Range: $Price";
echo "<BR>Engine Size(s): $EngineSize[0]";
echo "$EngineSize[1]";
echo "$EngineSize[2]";
echo "$EngineSize[3]";
?>
</BODY>
</HTML>
ok so as the GLOBAL VARIABLE IS SET TO "off".....
i modified the following line from TEXT.PHP
echo "Price Range: $Price"; to
echo "Price Range: ";
echo $_REQUEST["$Price"];
that does it for that variable "Price".....
but if you look at the code in TEXT.HTML, the value for the LIST BOX selection is set to multiple, meaning that i can select more than one value.....so i have to store it in an array!
<SELECT NAME="EngineSize[]" MULTIPLE>
once again as GLOBAL VARIABLES are off, i tried to modify the following line in TEXT.PHP
echo "<BR>Engine Size(s): $EngineSize[0]";
echo "$EngineSize[1]";
echo "$EngineSize[2]";
echo "$EngineSize[3]";
to
echo "<BR>Engine Size(s): ";
echo $REQUEST["$EngineSize[0]"];
echo $REQUEST["$EngineSize[1]"];
echo $REQUEST["$EngineSize[2]"];
echo $REQUEST["$EngineSize[3]"];
but it does not work....i cant think ofany other way out???
can someone please help me....???
thanks
SHUMAIS UL HAQ 🙂