The question I'm trying to answer is below
- Create a new PHP file named lab2.php.
- Inside, add the HTML skeleton code and give its title “Lab Week 2"
- Within the body tag, create a h1 tag that says "Enter the name of your favourite musical artist"
- Add a section tag inside the body tag.
- Create a form tag and use the $_GET method to get users to input their favorite artist. Store the user input into variables.
- Create a submit button for the user to input their favorite artist.
- Check whether the variable is empty or not.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Fav Artist</title>
<meta name="author" content="Sean Kingston">
<meta name="viewport" content="with=device-width, initial-scale=1.0">
</head>
<body>
<!-- H1 tag I want to change once the user clicks on submit button-->
<h1> Enter the name of your favourite musical artist </h1>
<!--Form-->
<form method="get">
<input type="text" name="name" />
<input type="submit" value="Submit" name="sub">
</form>
</body>
</html>
<?php
//isset not working//
if(isset($_GET['name'])){
echo $_GET['name'];
}
?>
<?php
show_source(FILE);
</html>
?>