我在 PHP 中遇到分号错误,并且无法理解为什么这是一个问题

发布于 2024-11-03 16:08:45 字数 2156 浏览 1 评论 0原文

这是错误消息:

解析错误:语法错误,意外的“;”在 /home1/goldensu/public_html/camira/contactForm.php 第 155 行

,这是代码:

      $sendMessage = "Someone is interested in becoming a reseller or installer.<br /><br /><br />
        <b><u>Country</u>:</b> "
        .stripslashes($country)."<br /><br />\n
        <b><u>Company Name</u>:</b> "
        .stripslashes($companyName)."<br /><br />\n
        <b><u>Office Address</u>:</b> "
        .stripslashes($officeAddress)."<br /><br />\n
        <b><u>Company Phone</u>:</b> "
        .stripslashes($companyPhone)."<br /><br />\n
        <b><u>Company Email</u>:</b> "
        .stripslashes($companyEmail)."<br /><br />\n
        <b><u>Web page</u>:</b> "
        .stripslashes($webPage."<br /><br />\n
        <b><u>Number of emplyees</u>:</b> "
        .stripslashes($numberEmployees)."<br /><br />\n
        <b><u>Yearly turnover</u>:</b> "
        .stripslashes($turnover)."<br /><br />\n
        <b><u>Marketing Activities</u>:</b> "
        .stripslashes($marketingActivities)."<br /><br />\n
        <b><u>Annual marketing budget</u>:</b> "
        .stripslashes($marketingBudget)."<br /><br />\n
        <b><u>Current renewable energy products</u>:</b> "
        .stripslashes($energyProducts)."<br /><br />\n
        <b><u>Length of agreements</u>:</b> "
        .stripslashes($agreements)."<br /><br />\n
        <b><u>Territories</u>:</b> "
        .stripslashes($territories)."<br /><br />\n
        <b><u>Staff Qualifications</u>:</b> "
        .stripslashes($staffQualifications)."<br /><br />\n";

它抱怨末尾的分号。是不是有什么蠢事?

This is the error message:

Parse error: syntax error, unexpected ';' in /home1/goldensu/public_html/camira/contactForm.php on line 155

and this is the code:

      $sendMessage = "Someone is interested in becoming a reseller or installer.<br /><br /><br />
        <b><u>Country</u>:</b> "
        .stripslashes($country)."<br /><br />\n
        <b><u>Company Name</u>:</b> "
        .stripslashes($companyName)."<br /><br />\n
        <b><u>Office Address</u>:</b> "
        .stripslashes($officeAddress)."<br /><br />\n
        <b><u>Company Phone</u>:</b> "
        .stripslashes($companyPhone)."<br /><br />\n
        <b><u>Company Email</u>:</b> "
        .stripslashes($companyEmail)."<br /><br />\n
        <b><u>Web page</u>:</b> "
        .stripslashes($webPage."<br /><br />\n
        <b><u>Number of emplyees</u>:</b> "
        .stripslashes($numberEmployees)."<br /><br />\n
        <b><u>Yearly turnover</u>:</b> "
        .stripslashes($turnover)."<br /><br />\n
        <b><u>Marketing Activities</u>:</b> "
        .stripslashes($marketingActivities)."<br /><br />\n
        <b><u>Annual marketing budget</u>:</b> "
        .stripslashes($marketingBudget)."<br /><br />\n
        <b><u>Current renewable energy products</u>:</b> "
        .stripslashes($energyProducts)."<br /><br />\n
        <b><u>Length of agreements</u>:</b> "
        .stripslashes($agreements)."<br /><br />\n
        <b><u>Territories</u>:</b> "
        .stripslashes($territories)."<br /><br />\n
        <b><u>Staff Qualifications</u>:</b> "
        .stripslashes($staffQualifications)."<br /><br />\n";

It's complaining about the semicolon at the end. Is it something stupid?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

情感失落者 2024-11-10 16:08:45

问题就在这里:

.stripslashes($webPage."<br /><br />\n

看来您错过了右括号 ) :

.stripslashes($webPage)."<br /><br />\n

Problem is here:

.stripslashes($webPage."<br /><br />\n

it appears you have missed a closing bracket ) :

.stripslashes($webPage)."<br /><br />\n
2024-11-10 16:08:45

在这种情况下,它很可能是前面的表达式中缺少括号。

看起来是这样的:(

    .stripslashes($webPage."<br /><br />\n
    <b><u>Number of emplyees</u>:</b> "

通过应用 magic_quotes 解决方法集中应用可以避免的错误。)

In this context it's most likely a missing paranthesis in the previous expressions.

It seems this one:

    .stripslashes($webPage."<br /><br />\n
    <b><u>Number of emplyees</u>:</b> "

(A error that could have been avoided by applying a magic_quotes workaround centrally.)

戏剧牡丹亭 2024-11-10 16:08:45

刚刚看到缺少的右括号...我真傻!

.stripslashes($webPage."<br /><br />\n

Just seen the missing closing bracket... Silly me!

.stripslashes($webPage."<br /><br />\n
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文