سلام دوستان
من دارم php یاد میکیرم و امروز در تمرین کتابم به مشکل برخوردم که هر کاری کردم نشد.!!!
مشکل اینه ؟
Parse error: syntax error, unexpected T_STRING in /var/www/PaltformMatch.php on line 36
<?
$agent = getenv ("http_user_agent");
if (preg_match("/Win/i", "$agent")) {
$style = "Win";
}
else if (preg_match ("/Linux/i", "$agent")) {
$style = "Linux";
}
$win_style = "<style type=\"text/css\">P, ul, ol, li
{font-family: Arial; font-size: 10pt; font-weight: normal;}
h1 {font-family: Arial; font-size: 16pt; font-weight: bold;}
h2 {font-family: Arial; font-size: 14pt; font-weight: bold;}
strong {font-family: Arial; font-size: 10pt; font-weight: bold;}
em {font-family: Arial; font-size: 10pt; font-weight: italic;}
</style>";
$linux_style = "<style type = \"text/css\"> p, ul, ol, li
{font-family: times; font-size: 12pt; font-weight: normal;}
h1 {font-family: times; font-size: 18pt; font-wieght: bold;}
h2 {font-family: times; font-size: 16pt; font-wieght: bold;}
strong {font-family: times; font-size: 12pt; font-wieght: bold;}
em {font-family: times; font-size: 12pt; font-wieght: italic;}
</style>
?>
<html>
<head>
<title>Platform Matching</title>
<?
if ($style == "Win") {
echo "$win_style";
}
else if ($style == "Linux") {
echo "$Linux_style";
}
?>
</head>
<body>
<h1 align = center>This is a level 1 heading</h1>
<h2 align = center>This is a level 2 heading</h2>
<p align = center>This is a simple paragraph with some <strong>bold</strong> and <em>emphasized</em> text.</p>
</body>
</html>
مشکل این کجاست لطفا کمک کنید