Newbie needing basic help in php
Posted: Mon May 07, 2007 1:09 pm
feyd | Please use
PHP file...[/syntax]
Please help...
Lee
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hey guys, below is my software spec...
Win XP Pro
IE7
PHP5
Apache 2
I am running all files locally on the machine, they are not hosted anywhere...
As I said, I am completely new to html, php, mysql, and am learning from a simple book, my problem is this...
I have a simple html form that the user can insert their name and select a few options. When they click the submit button, the information is supposed to be passed to a PHP file that displays a little welcome message which includes their name and the options from the previous page. But the information is not getting passed for some reason.
Do I need to enable something on my IE7 to allow data to get passed at all. Below is the code
HTML file...
[syntax="html"]<html><head><title> Your Favourites </title></head>
<body>
<form action="fav.php" method="post">
<b> Please enter your name: </b> <br>
<input type="text" size="45" name="username"> <br><br>
<b> Please select your favourite wine </b><br>
<input type="radio" name="colour" Value="White"> White
<input type="radio" name="colour" Value="Rosé"> Rosé
<input type="radio" name="colour" Value="Red"> Red <br><br>
<b> Please enter your favourite dish </b><br>
<input type="text" size="45" name="dish"> <br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>PHP file...[/syntax]
Code: Select all
<html><head><title> Your Submission </title></head>
<body>
<?
if($username !=null)
{
echo("Thanks for your selection $username<hr>");
}
if( ($colour !=null) && ($dish !=null) )
{
$msg="You really enjoy $dish<br>";
$msg.="- especially with a nice $colour wine";
echo ($msg);
}
?>
</body>
</html>Lee
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]