php页面中的服务器错误500

时间:2016-01-07 02:21:28

标签: php html server

我有一个PHP页面返回服务器错误500的问题。这只发生在一个页面中。我跟主持人说过,他们告诉我我的代码中有问题。

这是显示错误的文件的内容



    <?php
define('APP_URL', 'http://mysit.com/');
define('APP_ID', 'xxxxx');
define('APP_SECRET', 'xxxxx');
?><!DOCTYPE html>
<html lang="en">
 	<head>
	    <meta charset="utf-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
	    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
	    <title>test</title>
	    <meta property="og:title" content="Which of your friends are secretly smoking?" />
		<meta property="og:url" content="<?php echo APP_URL . 'result.php?id=<?php echo trim(htmlentities($_GET['id']))'; ?>"/>
		<meta property="og:description" content="test" />
		<meta property="og:image" content="<?php echo APP_URL . 'converted/<?php echo $_GET['id']'; ?>.jpg" />
		<meta property="fb:app_id" content="<?php echo APP_ID; ?>" />
		<meta name="medium" content="image" />
	    
  	</head>
  	<body>
  		<a href="./">test</a>	

  	</body>
</html>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

这:

<?php echo APP_URL . 'result.php?id=<?php echo trim(htmlentities($_GET['id']))'; ?>"/>

应该是:

<?= APP_URL.'result.php?id='.htmlentities(trim($_GET['id'])) ?>

还需要对包含嵌入的&lt;?php标记的其他行进行相同类型的更新。