donny1298 Posted May 1, 2009 Share Posted May 1, 2009 <html><head> <title> Assignment 3</title> </head> <body> <h1 align="center">Favorite Car/Numbers Form</h1> <p>Please fill in the box below and pick your favorite Car:</p> <form method="post" action="assignment3.php"> Your name: <input type="text" name="name"><br><br> <input type="radio" name="Cars" value="Ferrari">Ferrari<br> <input type="radio" name="Cars" value="Mercedes">Mercedes<br> <input type="radio" name="Cars" value="Porche">Porche<br> <input type="radio" name="Cars" value="Aston Martin">Aston Martin<br> <input type="radio" name="Cars" value="Lamborghini">Lamborghini<br><br> Please Enter four Numbers:</br> 1st:<input type="text" size="4" maxlenght="7" numbers="number1"></br> 2nd:<input type="text" size="4" maxlenght="7" numbers="number2"></br> 3rd:<input type="text" size="4" maxlenght="7" numbers="number3"></br> 4th:<input type="text" size="4" maxlenght="7" numbers="number4"></br> <br><input type="submit" value="Submit!"> <input type="reset" value="Reset"> </form> </body> </html> ___________________________________________________________________________ <html><head><title> Assignment3 Response Page</title></head> <body> <?php $name = $_POST["name"]; print ("Hello, my name is: $name."); $Cars = $_POST["Cars"]; print ("\n<br>My favorite Car is $Cars"); $number1 = $_POST["number1"]; $number2 = $_POST["number2"]; $number3 = $_POST["number3"]; $number4 = $_POST["number4"]; $average = ($number1 + $number2 + $number3 + $number4) / 4; print("The Average of your favorite numbers is $average."); ?> </body> </html> --------------------------------------------------------------------------------------------- Here is my Project...i've been trying to get this right but kept getting Notice on the response php page in line 11 - 14...please help thanks in advance.... just started both html and php recently so am a newbie.. Quote Link to comment https://forums.phpfreaks.com/topic/156342-help-with-html-and-php-project/ Share on other sites More sharing options...
mikesta707 Posted May 1, 2009 Share Posted May 1, 2009 next time you post code wrap them in code tags... And you need to explain what the problem is.. As far as I can tell that code looks ok.. Whats happening when you run the code. What does the page say when you submit the form? What does the notice say? Quote Link to comment https://forums.phpfreaks.com/topic/156342-help-with-html-and-php-project/#findComment-823152 Share on other sites More sharing options...
donny1298 Posted May 1, 2009 Author Share Posted May 1, 2009 this is the problem ....... Notice: Undefined index: number1 on line 11 Notice: Undefined index: number2 on line 12 Notice: Undefined index: number3 on line 13 Notice: Undefined index: number4 on line 14 Quote Link to comment https://forums.phpfreaks.com/topic/156342-help-with-html-and-php-project/#findComment-823160 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.