Adding viewport tag to header.php causes php error -
i using php script has file header.php normal web page header info. however, when add viewport tag throws error.
header.php:
<?php /* usercake version: 2.0.2 http://usercake.com */ echo " <!doctype html public '-//w3c//dtd xhtml 1.0 transitional//en' 'http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta http-equiv='content-type' content='text/html; charset=utf-8' /> <title>".$websitename."</title> <link href='".$template."' rel='stylesheet' type='text/css' /> <script src='models/funcs.js' type='text/javascript'> </script> </head>"; ?>
error returned:
parse error: syntax error, unexpected t_string, expecting ',' or ';' in /homepages/30/d332080598/htdocs/azotusorg/usercake/models/header.php on line 10
thanks on this!
you not escaping double quotes here
<?php echo " <!doctype html public '-//w3c//dtd xhtml 1.0 transitional//en' 'http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/> <meta http-equiv='content-type' content='text/html; charset=utf-8' /> <title>".$websitename."</title> <link href='".$template."' rel='stylesheet' type='text/css' /> <script src='models/funcs.js' type='text/javascript'> </script> </head>"; ?>
or use single quotes
<?php echo " <!doctype html public '-//w3c//dtd xhtml 1.0 transitional//en' 'http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <meta name='viewport' content='width=device-width, initial-scale=1.0'/> <meta http-equiv='content-type' content='text/html; charset=utf-8' /> <title>".$websitename."</title> <link href='".$template."' rel='stylesheet' type='text/css' /> <script src='models/funcs.js' type='text/javascript'> </script> </head>"; ?>
Comments
Post a Comment