0

I'm a college student trying to do one of the exercises from the book. The exercise is typed below. I typed it in exactly as my textbook said too. What is the purpose of <<_END at the beginning and _END; at the end? When I did it this way my html didn't work correctly. When I did it like the instructor did in his lecture it worked. What he did was put all PHP in separate sections . What is the best way to use PHP, HTML5, JavaScript and CSS3 all in one page? Or should I be linking my HTML page to external JavaScript, CSS3, and PHP pages? My end goal for this assignment is to build a login page and a create a new account page that is linked to my database.

Any and all tips/help is very much appreciated!!

<?php //from the book page 266
echo <<<_END
<html>
<head>
<title>PAGE 266, 267</title>
<body>
<form method="post" action="formtest.php">
What is your name?
<input type="test" name="name">
<input type="submit">
</form>
</body>
</html>
_END;
?>
k3153y
  • 1
  • 2
  • 2
    See the “heredoc” section in the PHP manual on strings • https://www.php.net/manual/en/language.types.string.php – user2864740 Nov 13 '21 at 20:10
  • 2
    As the previous comment mentions, see [PHP's heredoc info](https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) – Paul T. Nov 13 '21 at 20:11
  • Also, asking multiple questions in one is done - [ask] – DarkBee Nov 13 '21 at 20:18

0 Answers0