Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP语法错误。似乎找不到解决办法_Php_Syntax - Fatal编程技术网

PHP语法错误。似乎找不到解决办法

PHP语法错误。似乎找不到解决办法,php,syntax,Php,Syntax,有人能指出如何修复我遇到的两个语法错误吗?我对PHP不是很在行 代码如下: $code = '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script> <script> <table id="slideleft" style=" overflow:auto; position:fixed; top:25%;

有人能指出如何修复我遇到的两个语法错误吗?我对PHP不是很在行

代码如下:

$code = '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
        <script>
        <table id="slideleft" style=" overflow:auto; position:fixed; top:25%;"><tr class="slideLeftItem" style="position:fixed;left:-320px;z-index:1000;height:100%;"><td><img src="https://lh3.googleusercontent.com/-GMJe-Am-U9Q/T4p4bZu7jDI/AAAAAAAAAFs/qQqmMGn-wwg/s800/facebook-vertical.png" style="top:5px; position:absolute; border-left-width:5px; left:318px;"/></td><td class="contentBox" style="border:solid 5px #5370AD; width:300px;height:300px;position:relative;border-radius:5px;background-color:white;"><div id="fb-root"></div><script type="text/javascript" >(function() {var e = document.createElement('script'); e.async = true;e.src = document.location.protocol +'//connect.facebook.net/en_US/all.js#xfbml=1';document.getElementById('fb-root').appendChild(e);());</script>

       <fb:like-box href="https://www.facebook.com/ExplicitWebsiteDesign?ref=hl" width="300" show_faces="true" stream="false" header="false"></fb:like-box></td></tr></table><script type="text/javascript">jQuery(".slideLeftItem").append('<div style="font-size:12px;font-family: arial;width:300px;text-align:right;"><a rel="dofollow" href="http://techbrij.com/944/add-social-slider-widget-website" style="background-color:#D2C9CA;padding:3px 7px;font-weight:bold;color:#516FA9">Get This Widget</a></div>');jQuery("#slideleft tr").hover(function(b){var a=jQuery(this);jQuery("#slideleft tr").not(a).hide();a.css({"z-index":"9999"});a.stop().animate({left:0})},function(b){var a=jQuery(this);a.css({"z-index":"1000"});a.stop().animate({left:-a.outerWidth()});jQuery("#slideleft tr").show()});</script>}</script>';
$code='1
(function(){var e=document.createElement('script');e.async=true;e.src=document.location.protocol+'//connect.facebook.net/en#US/all.js#xfbml=1';document.getElementById('fb-root')。appendChild(e);());
jQuery(“.slideLeftItem”).append(“”);jQuery(“#slidelefttr”).hover(函数(b){var a=jQuery(this);jQuery({var a=jQuery”).not(a).hide();a.css({“z-index”:“9999”);a.stop().animate({left:0}),函数(b){var a=jQuery(this);a.css({“z-index”1000});a.stop().animate({left:-outeidth());jQuery;
下面的图片是我代码的截图。。。谢谢

$code = ' (function() {var e = document.createElement('scr

您正试图将js另存为字符串,但在js代码中有'。这把事情搞砸了。你只需要避开那些单引号。将主文件中的文件从“更改为\”。这应该可以解决它

您正试图将js另存为字符串,但在js代码中有'。这把事情搞砸了。你只需要避开那些单引号。将主文件中的文件从“更改为\”。这会解决问题。

试着利用以下优势:

ob_start();
?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
        <script>
        <table id="slideleft" style=" overflow:auto; position:fixed; top:25%;"><tr class="slideLeftItem" style="position:fixed;left:-320px;z-index:1000;height:100%;"><td><img src="https://lh3.googleusercontent.com/-GMJe-Am-U9Q/T4p4bZu7jDI/AAAAAAAAAFs/qQqmMGn-wwg/s800/facebook-vertical.png" style="top:5px; position:absolute; border-left-width:5px; left:318px;"/></td><td class="contentBox" style="border:solid 5px #5370AD; width:300px;height:300px;position:relative;border-radius:5px;background-color:white;"><div id="fb-root"></div><script type="text/javascript" >(function() {var e = document.createElement('script'); e.async = true;e.src = document.location.protocol +'//connect.facebook.net/en_US/all.js#xfbml=1';document.getElementById('fb-root').appendChild(e);());</script>

       <fb:like-box href="https://www.facebook.com/ExplicitWebsiteDesign?ref=hl" width="300" show_faces="true" stream="false" header="false"></fb:like-box></td></tr></table><script type="text/javascript">jQuery(".slideLeftItem").append('<div style="font-size:12px;font-family: arial;width:300px;text-align:right;"><a rel="dofollow" href="http://techbrij.com/944/add-social-slider-widget-website" style="background-color:#D2C9CA;padding:3px 7px;font-weight:bold;color:#516FA9">Get This Widget</a></div>');jQuery("#slideleft tr").hover(function(b){var a=jQuery(this);jQuery("#slideleft tr").not(a).hide();a.css({"z-index":"9999"});a.stop().animate({left:0})},function(b){var a=jQuery(this);a.css({"z-index":"1000"});a.stop().animate({left:-a.outerWidth()});jQuery("#slideleft tr").show()});</script>}</script>
<?php
$code = ob_get_clean();
ob_start();
?>
(function(){var e=document.createElement('script');e.async=true;e.src=document.location.protocol+'//connect.facebook.net/en#US/all.js#xfbml=1';document.getElementById('fb-root')。appendChild(e);());
jQuery(“.slideLeftItem”).append(“”);jQuery(“#slidelefttr”).hover(函数(b){var a=jQuery(this);jQuery(#slidelefttr”).not(a).hide();a.css({“z-index”:“9999”);a.stop().animate({left:0}),函数(b){var a=jQuery(this);a.css({“z-index”1000});a.stop().animate({left:-a:-outeidth());jQuery
尝试利用以下优势:

ob_start();
?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
        <script>
        <table id="slideleft" style=" overflow:auto; position:fixed; top:25%;"><tr class="slideLeftItem" style="position:fixed;left:-320px;z-index:1000;height:100%;"><td><img src="https://lh3.googleusercontent.com/-GMJe-Am-U9Q/T4p4bZu7jDI/AAAAAAAAAFs/qQqmMGn-wwg/s800/facebook-vertical.png" style="top:5px; position:absolute; border-left-width:5px; left:318px;"/></td><td class="contentBox" style="border:solid 5px #5370AD; width:300px;height:300px;position:relative;border-radius:5px;background-color:white;"><div id="fb-root"></div><script type="text/javascript" >(function() {var e = document.createElement('script'); e.async = true;e.src = document.location.protocol +'//connect.facebook.net/en_US/all.js#xfbml=1';document.getElementById('fb-root').appendChild(e);());</script>

       <fb:like-box href="https://www.facebook.com/ExplicitWebsiteDesign?ref=hl" width="300" show_faces="true" stream="false" header="false"></fb:like-box></td></tr></table><script type="text/javascript">jQuery(".slideLeftItem").append('<div style="font-size:12px;font-family: arial;width:300px;text-align:right;"><a rel="dofollow" href="http://techbrij.com/944/add-social-slider-widget-website" style="background-color:#D2C9CA;padding:3px 7px;font-weight:bold;color:#516FA9">Get This Widget</a></div>');jQuery("#slideleft tr").hover(function(b){var a=jQuery(this);jQuery("#slideleft tr").not(a).hide();a.css({"z-index":"9999"});a.stop().animate({left:0})},function(b){var a=jQuery(this);a.css({"z-index":"1000"});a.stop().animate({left:-a.outerWidth()});jQuery("#slideleft tr").show()});</script>}</script>
<?php
$code = ob_get_clean();
ob_start();
?>
(function(){var e=document.createElement('script');e.async=true;e.src=document.location.protocol+'//connect.facebook.net/en#US/all.js#xfbml=1';document.getElementById('fb-root')。appendChild(e);());
jQuery(“.slideLeftItem”).append(“”);jQuery(“#slidelefttr”).hover(函数(b){var a=jQuery(this);jQuery(#slidelefttr”).not(a).hide();a.css({“z-index”:“9999”);a.stop().animate({left:0}),函数(b){var a=jQuery(this);a.css({“z-index”1000});a.stop().animate({left:-a:-outeidth());jQuery

在上图中,我尽可能地描述了这个问题


在上图中,我尽可能地描述了这个问题

你能读懂这个密码吗?我不能。语法错误也太多了!语法错误是什么?你确定它们是PHP错误而不是JS吗?你能读懂这段代码吗?我不能。语法错误也太多了!语法错误是什么?你确定它们是PHP错误而不是JS吗?我现在得到了脚本标记,为什么它们会被打开?请看红线!你说的那个并没有结束密码。在“script”结束代码之前的脚本被认为是php并给出了错误。如果你仔细看,脚本是黑色的,没有像其他的那样突出显示。我现在得到了脚本标签,为什么它们会被打开,请看红线!你说的那个并没有结束密码。在“script”结束代码之前的脚本被认为是php并给出了错误。如果您仔细看,脚本是黑色的,不像其他脚本那样高亮显示。