Jump to content

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?

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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