Saturday, 13 August 2016

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

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...