Saturday, 7 October 2017

html - PHP error Parse error: syntax error, unexpected '




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:



if( $_GET["v"])
{
$matches = $_GET['v'];
echo "Welcome ". $_GET['v']. "
";







exit();
}
?>




Name:





Answer



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



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



No comments:

Post a Comment

casting - Why wasn&#39;t Tobey Maguire in The Amazing Spider-Man? - Movies &amp; TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...