无法弄清楚这段代码有什么问题

时间:2012-01-27 12:13:56

标签: php html

有人可以告诉我这段代码有什么问题,因为我找不到任何东西吗?

<html>
<head>
<title>Meine Seite</title>
</head>
<body>
<h2>Willkommen</h2>
<br />
<?php
define("EZSQL_DB_USER", 'xxxxx_xxxx');
define("EZSQL_DB_PASSWORD", 'xxxxxxx');
define("EZSQL_DB_NAME", 'xxxx_xxxx');
define("EZSQL_DB_HOST", 'localhost');
if (!function_exists('gettext')) {
function _($s) {return $s;}
}
?>
<?php
$mysqlConnection = mysql_connect(EZSQL_DB_HOST, EZSQL_DB_USER, EZSQL_DB_PASSWORD);
if (!$mysqlConnection)
{
echo "<h2>Hallo du!</h2>";
}

?>
</body>
</html>

结果:

Willkommen

Hallo du!"; } ?>

非常感谢您的帮助!

感谢

1 个答案:

答案 0 :(得分:2)

  

Hallo du!"; } ?>

这表明你的php没有运行。你必须将php文件上传到webserver然后从浏览器中看到。像http://localhost/file.php一样。 C:\documents\file.php

相关问题