I am getting this error Notice: Undefined index: name in E:\xampp\htdocs\index.php on line 60 Here the code that I have, please help me out to get rid of this error. I am new to coding
<?php
$root = '';
$path = 'images/';
$bhatti = array(
'1'=>'Katrina wants to meet you',
'2'=>'Kareena wants to meet you',
'3'=>'Aishwarya wants to meet you',
'4'=>'Shahrukh wants to meet you',
'5'=>'Aamir wants to meet you',
'6'=>'Shahid kapoor wants to meet you',
'7'=>'Parineeti wants to meet you',
'9'=>'Priyanka wants to meet you',
'10'=>'She wants to meet you',
'11'=>'Kristen wants to meet you',
'12'=>'Shriya wants to meet you',
'13'=>'Sonakshi wants to meet you',
'14'=>'Deepika wants to meet you',
'15'=>'Cameron wants to meet you',
'16'=>'Ajay wants to meet you',
'17'=>'wants to meet you',
'c'=>' wants to meet you'
);
$img = $bhatti[array_rand($bhatti,1)];
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="diabetes, about diabetes,alcohol and diabetes,heart attack,Rheums" />
<meta name="description" content="Click here to know the reason">
<meta property="og:description" content="<?php echo $img; ?>"/>
<meta property="og:type" content="article" />
<meta property="og:title" content="<?php echo $img; ?>" />
<meta property="og:image" content="http://<?php echo $_SERVER['SERVER_NAME']."/"; echo $path . rawurlencode($img); ?>.jpg" />
<meta property="og:image:width" content="300" />
<meta property="og:image:height" content="300" />
<meta property="og:image:type" content="image/jpg" />
</head>
<body>
<?php if($_GET['name']){ ?>
<div><img src="<?php echo $path . $img ?>.jpg" alt="" /></div>
<?php }else{?>
<div><img src="oops.png" alt="" /></div>
<?php } ?>
<p>Developed by <a href="https://www.Facebook.com/Ali42726"> Ali Hasan </a>.</p>
<p>Thank you for visiting </p>
</body>
</html>
I am writing this to show a random image every time a user enters, and display image title as the page name.