dpzff20644 2014-04-01 19:00
浏览 20

第25行的C:\ xampp \ htdocs \ assign \ xtra assign.php中意外的'if'(T_IF)[关闭]

 <html>
 <body>

 <form name="form1" method="post" action="xtra assign.php">

  <h1>Malaysia Identification Card(IC)</h1>

 Enter IC NO : <input type="text" name="IC" id="IC"><br>

 <input type="submit" name="submit" value="submit">
  <input type="reset" name="clear" value="clear">

 </form>
 </body>
 </html>

In this php , I need to add 3 functions: is_numeric,substr and strlen, but I get so many errors. Also i also i need to make difference if the end number is even or odd. if the end number is odd, it is gentlement, if the end number is even, it is a lady.

<?php

if(isset($_POST['submit']))
{
$IC=$_POST['IC'];
substr($IC,-1);
$IC=123456789012;

can i use this code?

if(is_numeric($IC) &&strlen($IC===12)) 
{
  echo"CARD HOLDER IS A GENTLEMAN";
} 

can i use this the same like if?

else (is_numeric($IC) &&strlen($IC===12) &&substr($IC,-1))
{
 echo "CARD HOLDER IS A LADY";
 }


else 
{
 echo "THE IC NUMBER IS INVALID";
}
}
 ?>
  • 写回答

3条回答 默认 最新

  • doudi2431 2014-04-01 19:01
    关注

    Usually this is the result of a missing semicolon. Make sure the statement prior to line 25 ends with ;.

    评论

报告相同问题?

悬赏问题

  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)