Re: quick php and forms question

Got the problem sorted, thanks! Now it doesn't like my "die()" call (inside a loop) and it is messing up my arrays completely. I have never had good luck with this language though, and if I cannot get the other problems fixed, I will write more specific questions to the list. Thanks again.


Have a great day,
Alex

----- Original Message -----
From: "E.J.  Zufelt" <everett@xxxxxxxxx
To: <programmingblind@xxxxxxxxxxxxx
Date sent: Tue, 2 Dec 2008 14:38:32 -0400
Subject: Re: quick php and forms question

Good afternoon Alex,
Please find an example below. I had this code saved in a file
named
select.php.

Summary:

This code is for a simple html page with a select box and a
submit button.

2. When the user submits the form the form is posted back to the
same page.

3. You'll notice that there is a php code segment between the
first level
heading and the form. This code first checks to see if the form
field that
we are using has a value and then echos the result to the
browser.

4.  If you are still getting a parse error then you may have some
configuration problem with your php or server.

select.php :

<html
<head
<title>Select PHP Example</title

</head
<body
<h1>Select PHP Example</h1

<?php

if (isset($_POST['lstSelect']))
{
echo "<div>";
echo "The value is: " .  $_POST['lstSelect'];
echo "</div>";
}
?

<form name="frmExample" action="select.php" method="post"
<select name="lstSelect"
<option value="1">Apple</option
<option value="2">Pear</option
<option value="3">Orange</option
</select
<input type="submit" value="Show Select Value" /
</form
</body
</html

__________
View the list's information and change your settings at
http://www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at http://www.freelists.org/list/programmingblind

Other related posts: