$_SESSION
Is er een beperking op het aantal $_SESSION variabelen die men aanmaakt??
In page1 heb ik bv.:
echo("<form action=\"flight_reservation.php\" method=\"post\">");
echo("<TR><TD>Last Name:</TD><TD><input name='LastName' type='text' /></TD>");
echo("<TR><TD>First Name:</TD><TD><input name='FirstName' type='text' /></TD>");
echo("<TR><TD>Address:</TD><TD><input name='Address' type='text' /></TD>");
echo("<TR><TD>P.O. Box:</TD><TD><input name='POBox' type='text' /></TD>");
echo("<TR><TD>Zip Code:</TD><TD><input name='Zip' type='text' /></TD>");
echo("<TR><TD>City:</TD><TD><input name='City' type='text' /></TD>");
echo("<TR><TD>Country:</TD><TD><SELECT NAME ='Country' VALUE={$row['name']}>");
while($row=mysql_fetch_array($result2)){
echo("<option value= {$row['name']}>{$row['printable_name']} </option>");
}
echo("</SELECT>");
echo("</TD>");
echo("<TR><TD>Visa number:(XXXX-XXXX-XXXX-XXXX)</TD><TD><input name='VISA' type='text' /></TD>");
echo("<TR><TD><INPUT TYPE=SUBMIT VALUE=\"Make Reservation\"></TD><td></td>");
echo("</table></form>");
$_SESSION[‘LastName’]=$_POST['LastName'];
$_SESSION[‘FirstName’]=$_POST['FirstName'];
$_SESSION[‘Address’]=$_POST['Address'];
$_SESSION[‘POBox’]=$_POST['POBox'];
$_SESSION[‘Zip’]=$_POST['Zip'];
$_SESSION[‘City’]=$_POST['City'];
$_SESSION[‘City’]=$_POST['country'];
$_SESSION[‘POBox’]=$_POST['VISA'];
en in page 2 vul ik deze weer in als volgt:
$var1 = "$_SESSION[‘LastName’]";
$var2 = "$_SESSION[‘FirstName’]";
$var3 = "$_SESSION[‘Address’]";
$var4 = "$_SESSION[‘POBox’]";
$var5 = "$_SESSION[‘Zip’]";
$var6 = "$_SESSION[‘City’]";
$var7 = "$_SESSION[‘Country’]";
$var8 = "$_SESSION[‘Visa’]";
echo($var1);
echo($var2);
echo($var3);
echo($var4);
echo($var5);
echo($var6);
echo($var7);
echo($var8);
Maar niet alle variabelen geven de ingevulde string terug. Waarom?
Laat maar, tikfoutjes natuurlijk!!
print_r($_SESSION); es proberen ;-)
en waarom gebruik je echo("Hello World"); en niet echo "Hello World";
Tom Keim schreef op 22.05.2008 20:00:
Omdat en waarom gebruik je echo("Hello World"); en niet echo "Hello World";
veel meer extra werk is en waarbij veel meer fout kan gaan...
Dit is gewoon té simpel:
Of zou het toch slimmer en handiger zijn??