gpt4 book ai didi

PHP 通知 : Use of undefined constant php - assumed 'php'

转载 作者:行者123 更新时间:2023-12-02 00:39:21 25 4
gpt4 key购买 nike

我只是在编辑一个网站,以便在 footer.php 中包含订阅表单,而不仅仅是主页。我在本地服务器上进行了更改,然后将其移至我的实时环境(dev 子文件夹)。我在本地主机上没有看到任何错误,但在开发站点上却显示以下错误:

PHP Notice: Use of undefined constant php - assumed 'php' in /home/website-name/public_html/uk-en/dev/wp-content/themes/theme-name/footer.php on line 1

第 1 行唯一的内容是打开的 php 标记,请参阅下面 footer.php 文件中的代码

<?php?>
</div><!-- #main -->
<footer id="colophon" class="site-footer" role="contentinfo">
<div class="subscribe-form">
‪<p>SIGN UP TO OUR EMAIL NEWSLETTER FOR NEWS, OFFERS & EXCITING COMPETITIONS.<p>
<div class="contact-7-subscribe"> <?php echo do_shortcode( '[contact-form-7 id="4563" title="Newsletter"]' ); ?> </div>
</div>
<div class="site-info">

<div class="socialmedia">
<a href="https://www.facebook.com/pg/page-name/" target="_blank" class="facebook"></a>
<a href="https://twitter.com/page-name?lang=en" target="_blank" class="twitter"></a>
<a href="https://www.instagram.com/page-name/" target="_blank" class="youtube"></a>
</div>
<div class="payment_cards">
<img src="<?=site_url();?>/wp-content/uploads/2017/05/payment_cards.png" alt="payments cards"/>
</div>
<?php /* Widgetized sidebar */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('footerwidget') ) : ?><?php endif; ?>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!-- #page -->
<?php wp_footer(); ?>
<?php /* if(get_the_ID() == 5) { ?>
<script type="text/javascript"
src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-
forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false">
</script><script type="text/javascript">require(["mojo/signup-
forms/Loader"], function(L) { L.start({"baseUrl":"mc.us10.list-
manage.com","uuid":"37710aefba71598269bda7def","lid":"4385b1c355"}) })
</script>
<?php } */ ?>
<!--Start of Zopim Live Chat Script-->
<script type="text/javascript">
window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute("charset","utf-8");
$.src="//v2.zopim.com/?34qd49wmFaK3NsxoUst4PCSk4gaXUQVe";z.t=+new Date;$.
type="text/javascript";e.parentNode.insertBefore($,e)})(document,"script");
</script>
<!--End of Zopim Live Chat Script-->
<?php /*?><script type="text/javascript"
src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-
forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false">
</script><script type="text/javascript">require(["mojo/signup-
forms/Loader"], function(L) { L.start({"baseUrl":"mc.us10.list-
manage.com","uuid":"37710aefba71598269bda7def","lid":"4385b1c355"}) })
</script><?php */?>
</body>
</html>

我可以关闭通知显示,但我希望获得正确的解决方案而不是掩盖

最佳答案

php开始标签的基本语法是<?php[whitespace]不只是<?php , 看这里 http://php.net/manual/en/language.basic-syntax.phptags.php#118827 .所以正确的语法是在 php 开始和结束标记之间添加一个空格 <?php ?>

关于PHP 通知 : Use of undefined constant php - assumed 'php' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47707032/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com