dongqixuan3112 2015-04-08 08:27
浏览 25

每当我使用时,我一直在收到错误,如果在我的HTML上[else]

We were asked to create a website, I would like to ask if there's something wrong with my form because whenever I open it on my browser it always gets an error on my html end tag.


<?php 
 session_start();
 include('connect.php');
 ?>

<?php

  if (isset($_POST['Login'])){

$username=$_POST['username'];
$password=$_POST['password'];

$login_query=mysql_query("select * from user where username='$username' and     password='$password' and Usertype='admin'") or die(mysql_error());
$login_query1=mysql_query("select * from user where username='$username' and password='$password' and Usertype='user'") or die(mysql_error());



$count=mysql_num_rows($login_query);
$count1=mysql_num_rows($login_query1);

$row=mysql_fetch_array($login_query);
$row1=mysql_fetch_array($login_query1);

?>
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="mystylelogin.css"> 
</head>
<body style="background-color: #66A9EB">
    <header>
        <div class="header"><h1><a href="login.php">Tidbits<a></h1></div>
        <div class="header-cont"> 
    </header>
<form method="POST" action="home.php">
        <fieldset>
                <p> Welcome </p>
                    <br>
                    Username: <input type="text" name="uname">
                    <br><br><br>
                    Password: <input type="password" name="pword">
                    <br>
                <div id="button">
                    <br>
                    <input type="submit" style="font-family: Verdana; color: white; font-size: 20px; background-color: #99CCFF; border: 1px solid #3399FF; border-radius:5px; margin-left: 150px" name="do" value="Log In"/>    
                </div>
                <div>
                    <P>

                </div>
            <p id="create"><a href="register.php">Create an Account</a></p>
 <?php 
                        if($count == 1){
                        $_SESSION['id']=$id;
                        header('Location:  admin.php');

                        }
                        if($count1 == 1){
                        session_start();
                        $_SESSION['id']=$id;
                        header('location:user.php');
                        }

                ?>


        </fieldset>
    </form>
<!----------------------------------SLIDESHOW------------------------------------------------------->
    <script type="text/javascript">

        var slideimages = new Array() // create new array to preload images
        slideimages[0] = new Image() // create new instance of image object
        slideimages[0].src = "cookiesandcream.jpg" // set image src property to image path, preloading image in the process
        slideimages[1] = new Image()
        slideimages[1].src = "pizza.jpg"
        slideimages[2] = new Image()
        slideimages[2].src = "waffle.jpg"

        </script>
        </head>
        <body>
        <img src="cookiesandcream.jpg" id="slide" width="700" height="500" />

        <script type="text/javascript">

        //variable that will increment through the images
        var step=0

        function slideit(){
         //if browser does not support the image object, exit.
         if (!document.images)
          return
         document.getElementById('slide').src = slideimages[step].src
         if (step<2)
          step++
         else
          step=0
         //call function "slideit()" every 2.5 seconds
         setTimeout("slideit()",2500)
        }

        slideit()
    </script>

    </body>
    </html>

can you please tell me the error on my codes?

  • 写回答

3条回答 默认 最新

  • douzhuozhu9544 2015-04-08 08:32
    关注

    Do you mean you get a message that your html is invalid? Your starting <html> tag is missing. Correct markup looks like this:

    <!DOCTYPE html>
    <html>
    <head>
        <title>Some Website</title>
    </head>
    <body>
        …
    </body>
    </html>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?