Please help, Radio buttons are not showing on my page + error message

The error message is:
Notice: Undefined index: interest in C:\xampp\New folder\htdocs\ShowPets.php on line 25
The code of the page not showing radio buttons is:

[php]<?php
/* Program: PetCatalog.php

  • Desc: Displays a list of pet categories from the
    PetType table. Includes descriptions.
  •      Displays radio buttons for user to check.
    

*/
?>

Pet Types <?php include("misc.inc"); #12

$cxn = mysqli_connect($host,$user,$passwd,$dbname) #14
or die (“couldn’t connect to server”);

/* Select all categories from PetType table */
$query = “SELECT * FROM PetType ORDER BY petType”; #18
$result = mysqli_query($cxn,$query)
or die (“Couldn’t execute query.”); #20

/* Display text before form */
echo "

\n

Pet Catalog

\n

The following animal friends are waiting for you.

\n

Find just what you want and hurry in to the store to pick up your new friend.

Which pet are you interested in?

\n";

/* Create form containing selection list */
echo “\n”; #33
echo “

”;

$counter=1; #35
while($row = mysqli_fetch_assoc($result)) #36
{
extract($row); #38
echo “

<td valign=‘top’ width=‘15%’
style=‘font-weight: bold;
font-size: 1.2em’\n”;
echo “<input type=‘radio’ name=‘interest’
value=’$petType’\n”; #43
if( $counter == 1 ) #44
{
echo “checked”;
}
echo “>$petType”; #48
echo “”; #49
$counter++; #50
}
echo “
$typeDescription
”;
echo "


\n"; #54
?>

[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service