如何删除“解析错误:语法错误,C:\ xampp \htdocs \ma.php中第54行的意外文件结束” [英] How do I remove the "parse error: syntax error, unexpected end of file in C:\xampp\htdocs\ma.php on line 54'

查看:90
本文介绍了如何删除“解析错误:语法错误,C:\ xampp \htdocs \ma.php中第54行的意外文件结束”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名学生正在尝试使用php。请帮助我,我很困惑

这是我输入的代码:

i am a student trying php. pls help me out i am confused
this is the code i typed:

<?php
$emailErr = "" ;
$email = "" ;
$error = 0 ;
if ($_SERVER ["REQUEST_METHOD"] == "POST") 
{
    if (empty($_POST["email"] ) ) 
    {
        $emailErr = "email is required" ;
        $errors = 1 ;
    }
    else
    {
        $email = test_input ($_POST["email"] ) ;
        if ( !filter_var ($email, FILTER_VALIDATE_EMAIL) )
        {
            $emailErr = "invalid email format" ;
            $errors = 1 ;
        }
    }

    function test_input ($data)
    {
        $data = trim($data) ;
        $data = stripslashes ($data) ;
        $data = htmlspecialchars ($data) ;
        return $data ;
    }
?>


<title> my website 


<h1 align=" center "> Login </h1>
" >
 EMAIL ID  
<span class="error">*<?php echo $emaiErr ; ?> </span> 
<br>
 PASSWORD 
<br>
<br>

<?php
if ( isset ( $_POST[ 'submit' ] ) && (errors == 0) )
{
    echo "<h2> Form submitted successfully.</h2>" ;
}
?>





< b>我尝试了什么:



i现在没有尝试过任何事情,除了试图改变语法,但在这里我不明白该怎么做。 。请帮帮我,也请提一下html部分是否有问题..谢谢



What I have tried:

i have tried nothing as of now except for trying to change syntax but here i don't understand what to do.. pls help me out and also pls mention if there is a problem with the html part too.. thank you

推荐答案

emailErr = ;
emailErr = "" ;


email = ;
email = "" ;


错误 = 0 ;
if


这篇关于如何删除“解析错误:语法错误,C:\ xampp \htdocs \ma.php中第54行的意外文件结束”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆