1

i am sorta new to PHP, i mostly use HTML. I have made a PHP script. What the code should do is display a youtube video when i put the code. like this "website.com/youtube.php?v=1010111" It would display the youtube video but I keep on getting the error :

Parse error: syntax error, unexpected '<' in [location]/index.php on line 7

Here is the code:

<?php
if( $_GET["v"])
{
$matches = $_GET['v'];
 echo "Welcome ". $_GET['v']. "<br />";

 <html>

 <iframe width="560" height="315" src="https://www.youtube.com/embed/" </html><?php . $_GET['v'].  ?> <html>frameborder="0" allowfullscreen></iframe>

</html>     
exit();
}
?>
<html>
<body>
<form action="<?php $_PHP_SELF ?>" method="GET">
Name: <input type="text" name="v" />
<input type="submit" />
</form>
</body>
</html>
vimuth
  • 5,064
  • 33
  • 79
  • 116
Mateo
  • 71
  • 1
  • 3
  • 11

1 Answers1

3

You have to write ?> when you want to stop writing PHP code.

At line 7, ou have <html>, just write ?> before that html tag.

alfallouji
  • 1,160
  • 8
  • 12