Jump to content

Help with Html and php project


donny1298

Recommended Posts

<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..

Link to comment
https://forums.phpfreaks.com/topic/156342-help-with-html-and-php-project/
Share on other sites

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?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.