PHP form example problem. HTML within conditional.

I’m trying to understand why this PHP code does not work with my PHP installation. MY php doesn’t like the break in php code immediately following the open parenthesis {. All that shows up is a blank page when displaying the php page.

This is just a php form example from:
http://www.tizag.com/phpT/examples/formfinale.php

Thanks.

[code]<?php
$Fname = $_POST[“Fname”];
$Lname = $_POST[“Lname”];
$gender = $_POST[“gender”];
$food = $_POST[“food”];
$quote = $_POST[“quote”];
$education = $_POST[“education”];
$TofD = $_POST[“TofD”];
if (!isset($_POST[‘submit’])) { // PHP DOES NOT LIKE THIS BREAK IN CODE
?>

Personal INFO First Name:
Last Name:
Gender:
Male:
Female:
Please choose type of residence:
Steak:
Pizza:
Chicken:
Enter your favorite quote!
Select a Level of Education:
Jr.High HighSchool College
Select your favorite time of day:
Morning Day Night
<? // Conditional statement continues here } else { echo "Hello, ".$Fname." ".$Lname.".
"; echo "You are ".$gender.", and you like "; foreach ($food as $f) { echo $f."
"; } echo "".$quote."
"; echo "You're favorite time is ".$TofD.", and you passed ".$education."!
"; } ?> [/code]

Lol why do you define everything except $_POST[‘submit’]?
Anyway are you sure that submit is set?
If it isnt set so if it is empty it will stop executing the rest of the code
Else are you sure you Apache is installed right?

Oh huh it says if not set
So submit must be empty to execute that lol it should show up the first time you load it at least
So be sure to use apache and stuff and your file needs to have a php extension

Sponsor our Newsletter | Privacy Policy | Terms of Service