Php 获取500个内部服务器错误?
下面是产生问题的php代码Php 获取500个内部服务器错误?,php,server,Php,Server,下面是产生问题的php代码 <?php $link = $_SERVER['PHP_SELF']; $link_array = explode('/',$link); $last_part = end($link_array); if($last_part == "funnyprank01.php"||$last_part == "funnyprank02.php"||$last_part == "funnyprank03.php"||$last_part == "funnyprank04
<?php
$link = $_SERVER['PHP_SELF'];
$link_array = explode('/',$link);
$last_part = end($link_array);
if($last_part == "funnyprank01.php"||$last_part == "funnyprank02.php"||$last_part == "funnyprank03.php"||$last_part == "funnyprank04.php")
{
<meta property="og:image" content="http://i1.ytimg.com/vi/3uRpVGkVhVI/hqdefault.jpg">
<meta property="og:image:type" content="image/jpg">
}
else
{
<meta property="og:image" content="http://www.8mags.com/images/youtubeimage.png">
<meta property="og:image:type" content="image/png">
}
?>
在添加此代码之前,一切正常。包含此代码的文件名为header.php
<?php
$link = $_SERVER['PHP_SELF'];
$link_array = explode('/',$link);
$last_part = end($link_array);
if($last_part == "funnyprank01.php"||$last_part == "funnyprank02.php"||$last_part == "funnyprank03.php"||$last_part == "funnyprank04.php")
{
?>
<meta property="og:image" content="http://i1.ytimg.com/vi/3uRpVGkVhVI/hqdefault.jpg">
<meta property="og:image:type" content="image/jpg">
<?php
}
else
{
?>
<meta property="og:image" content="http://www.8mags.com/images/youtubeimage.png">
<meta property="og:image:type" content="image/png">
<?php
}
?>
如果仍然返回500错误,请参考我的原始答案
如果仍然返回500错误,请参考我的原始答案
如果仍然返回500错误,请参考我的原始答案
如果仍然返回500错误,请参考我的原始答案,不要忘记关闭php标记
<?php
$link = $_SERVER['PHP_SELF'];
$link_array = explode('/',$link);
$last_part = end($link_array);
if($last_part == "funnyprank01.php"||$last_part == "funnyprank02.php"||$last_part == "funnyprank03.php"||$last_part == "funnyprank04.php"):?>
<meta property="og:image" content="http://i1.ytimg.com/vi/3uRpVGkVhVI/hqdefault.jpg">
<meta property="og:image:type" content="image/jpg">
<?php else:?>
<meta property="og:image" content="http://www.8mags.com/images/youtubeimage.png">
<meta property="og:image:type" content="image/png">
<?php endif?>
别忘了关闭php标记
<?php
$link = $_SERVER['PHP_SELF'];
$link_array = explode('/',$link);
$last_part = end($link_array);
if($last_part == "funnyprank01.php"||$last_part == "funnyprank02.php"||$last_part == "funnyprank03.php"||$last_part == "funnyprank04.php"):?>
<meta property="og:image" content="http://i1.ytimg.com/vi/3uRpVGkVhVI/hqdefault.jpg">
<meta property="og:image:type" content="image/jpg">
<?php else:?>
<meta property="og:image" content="http://www.8mags.com/images/youtubeimage.png">
<meta property="og:image:type" content="image/png">
<?php endif?>
别忘了关闭php标记
<?php
$link = $_SERVER['PHP_SELF'];
$link_array = explode('/',$link);
$last_part = end($link_array);
if($last_part == "funnyprank01.php"||$last_part == "funnyprank02.php"||$last_part == "funnyprank03.php"||$last_part == "funnyprank04.php"):?>
<meta property="og:image" content="http://i1.ytimg.com/vi/3uRpVGkVhVI/hqdefault.jpg">
<meta property="og:image:type" content="image/jpg">
<?php else:?>
<meta property="og:image" content="http://www.8mags.com/images/youtubeimage.png">
<meta property="og:image:type" content="image/png">
<?php endif?>
别忘了关闭php标记
<?php
$link = $_SERVER['PHP_SELF'];
$link_array = explode('/',$link);
$last_part = end($link_array);
if($last_part == "funnyprank01.php"||$last_part == "funnyprank02.php"||$last_part == "funnyprank03.php"||$last_part == "funnyprank04.php"):?>
<meta property="og:image" content="http://i1.ytimg.com/vi/3uRpVGkVhVI/hqdefault.jpg">
<meta property="og:image:type" content="image/jpg">
<?php else:?>
<meta property="og:image" content="http://www.8mags.com/images/youtubeimage.png">
<meta property="og:image:type" content="image/png">
<?php endif?>
将其更改为:
<?php
$link = $_SERVER['PHP_SELF'];
$link_array = explode('/',$link);
$last_part = end($link_array);
if($last_part == "funnyprank01.php"||$last_part == "funnyprank02.php"||$last_part == "funnyprank03.php"||$last_part == "funnyprank04.php")
{ ?>
<meta property="og:image" content="http://i1.ytimg.com/vi/3uRpVGkVhVI/hqdefault.jpg">
<meta property="og:image:type" content="image/jpg">
<?php }
else
{ ?>
<meta property="og:image" content="http://www.8mags.com/images/youtubeimage.png">
<meta property="og:image:type" content="image/png">
<?php } ?>
将其更改为:
<?php
$link = $_SERVER['PHP_SELF'];
$link_array = explode('/',$link);
$last_part = end($link_array);
if($last_part == "funnyprank01.php"||$last_part == "funnyprank02.php"||$last_part == "funnyprank03.php"||$last_part == "funnyprank04.php")
{ ?>
<meta property="og:image" content="http://i1.ytimg.com/vi/3uRpVGkVhVI/hqdefault.jpg">
<meta property="og:image:type" content="image/jpg">
<?php }
else
{ ?>
<meta property="og:image" content="http://www.8mags.com/images/youtubeimage.png">
<meta property="og:image:type" content="image/png">
<?php } ?>
将其更改为:
<?php
$link = $_SERVER['PHP_SELF'];
$link_array = explode('/',$link);
$last_part = end($link_array);
if($last_part == "funnyprank01.php"||$last_part == "funnyprank02.php"||$last_part == "funnyprank03.php"||$last_part == "funnyprank04.php")
{ ?>
<meta property="og:image" content="http://i1.ytimg.com/vi/3uRpVGkVhVI/hqdefault.jpg">
<meta property="og:image:type" content="image/jpg">
<?php }
else
{ ?>
<meta property="og:image" content="http://www.8mags.com/images/youtubeimage.png">
<meta property="og:image:type" content="image/png">
<?php } ?>
将其更改为:
<?php
$link = $_SERVER['PHP_SELF'];
$link_array = explode('/',$link);
$last_part = end($link_array);
if($last_part == "funnyprank01.php"||$last_part == "funnyprank02.php"||$last_part == "funnyprank03.php"||$last_part == "funnyprank04.php")
{ ?>
<meta property="og:image" content="http://i1.ytimg.com/vi/3uRpVGkVhVI/hqdefault.jpg">
<meta property="og:image:type" content="image/jpg">
<?php }
else
{ ?>
<meta property="og:image" content="http://www.8mags.com/images/youtubeimage.png">
<meta property="og:image:type" content="image/png">
<?php } ?>
在输出原始内容之前,您需要关闭PHP标记。因此,在if部分之后,我应该关闭?>然后对于else部分,重新启动它?您的编辑看起来是正确的,如果您收到其他错误,请告知。不,它现在工作正常。谢谢。别忘了选择答案来标记此问题:)在输出原始内容之前,您需要关闭PHP标记。因此,在if部分之后,我应该关闭?>然后在else部分重新启动它?您的编辑看起来正确,请告知您是否收到其他错误。不,它现在工作正常。谢谢。别忘了选择答案来标记此问题:)在输出原始内容之前,您需要关闭PHP标记。因此,在if部分之后,我应该关闭?>然后在else部分重新启动它?您的编辑看起来正确,请告知您是否收到其他错误。不,它现在工作正常。谢谢。别忘了选择答案来标记此问题:)在输出原始内容之前,您需要关闭PHP标记。因此,在if部分之后,我应该关闭?>然后在else部分重新启动它?您的编辑看起来正确,请告知您是否收到其他错误。不,它现在工作正常。谢谢。别忘了选择答案来标记这个问题:)我得到了-1,你得到了-1。没人知道为什么?我知道为什么,看你问题下面的评论。我明显错过了这一点。我正在编辑代码以显示它应该是什么样子。如果我错了,请纠正我?我得到了-1,你得到了-1。没人知道为什么?我知道为什么,看你问题下面的评论。我明显错过了这一点。我正在编辑代码以显示它应该是什么样子。如果我错了,请纠正我?我得到了-1,你得到了-1。没人知道为什么?我知道为什么,看你问题下面的评论。我明显错过了这一点。我正在编辑代码以显示它应该是什么样子。如果我错了,请纠正我?我得到了-1,你得到了-1。没人知道为什么?我知道为什么,看你问题下面的评论。我明显错过了这一点。我正在编辑代码以显示它应该是什么样子。如果我错了,请纠正我?