duangan6731 2018-08-16 07:07
浏览 94

解析错误:语法错误,第25行的C:\ wamp64 \ www \ PHP \ New \ input.php中的文件意外结束[重复]

This question already has an answer here:

I'm facing an error

"Parse error: syntax error, unexpected end of file in C:\wamp64\www\PHP\New\input.php on line 25"

Heres My Code, any help ll'be highly appreciated.

<HTML>
<?php

if($submit)
{
    $db = mysql_connect("localhost", "root","");
    mysql_select_db("learndb",$db);
    $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary)
    VALUES ('$first','$last','$nickname','$email','$salary')";
    $result = mysql_query($sql);
    echo "Thank you! Information entered.
";
    }
    else
    {
    ?>
<form method="post" action="input.php">
First name:<input type="Text" name="first">
Last name:<input type="Text" name="last">
Nick Name:<input type="Text" name="nickname">
E-mail:<input type="Text" name="email">
Salary:<input type="Text" name="salary">
<input type="Submit" name="submit" value="Enter information"></form>
< ?
} 
?>
</HTML>
</div>
  • 写回答

1条回答 默认 最新

  • dongzhong5967 2018-08-16 08:16
    关注

    Change < ? to <?php. Short open php tags are a bad practice and are not always enabled by default. To enable short tags, go to your php.ini file and set short_open_tag=On. After that restart your Apache server.

    Also for a short tag to work in your code you need to remove the space between < and ?.

    评论

报告相同问题?

悬赏问题

  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题