SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Help

  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    london
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help

    This is my whoe code i am trying from this page to login and open admin_page.php but it is not working can anyone help me or re-do my php code if it is wrong html code is here too.

    <?PHP
    $connectdb = mysql_connect("localhost", "", "");
    mysql_select_db("ezprinting");

    // <?php
    if((isset($User_id)) AND (isset($Password2))){
    $query = mysql_query("SELECT * FROM User WHERE User1 = $User_id AND Password = $Password2");
    $result=mysql_db_query("ezprinting",$query,$connectdb);
    if (mysql_num_rows($result) > 0 ){
    header("Location: Admin_page.php");
    }
    else
    echo("Incorrect Login or password");
    }
    ?>


    <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns="urn:schemas-microsoft-comfficeffice" xmlns="http://www.w3.org/TR/REC-html40">

    <head>



    <meta http-equiv="Content-Language" content="en-gb">
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <link rel="File-List" href="file:///C|/Documents%20and%20Settings/Waqar%20Ahmad/My%20Documents/Waqar/Brunel/PROJECT/HTML/admin_login_files/filelist.xml">
    <title>Admin login</title>
    <!--[if !mso]>
    <style>
    v\:* { behavior: url(#default#VML) }
    o\:* { behavior: url(#default#VML) }
    .shape { behavior: url(#default#VML) }
    </style>
    <![endif]-->
    <!--[if gte mso 9]>
    <xml><o:shapedefaults v:ext="edit" spidmax="1027"/>
    </xml><![endif]-->
    <script language="JavaScript">
    <!--
    function MM_reloadPage(init) { //reloads the window if Nav4 resized
    if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
    else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    // -->
    </script>
    </head>

    <body bgcolor="#000000" text="#BDA04A">
    <div id="Layer2" style="position:absolute; left:750px; top:549px; width:176px; height:35px; z-index:2">
    <form name="form2" method="post" action="main.php">
    <p>
    <input type="submit" name="Submit" value="Cancel">
    </p>
    </form>
    </div>




    <p align="center"><img src="../../Program%20Files/Macromedia/Dreamweaver%204/Lessons/Lesson%20Files/ticket.jpg" width="115" height="115">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <img src="../../Program%20Files/Macromedia/Dreamweaver%204/Lessons/Lesson%20Files/379119083.jpg" width="115" height="115">
    </p>
    <p align="center">&nbsp;</p>
    <div id="Layer1" style="position:absolute; left:417px; top:72px; width:568px; height:74px; z-index:1">
    <div align="center"> <font color="#00CCFF"><b><font size="+7" color="#000099" face="Comic Sans MS"><img src="../../Program%20Files/Macromedia/Dreamweaver%204/Lessons/Lesson%20Files/title.bmp"></font></b></font></div>
    </div>
    <p>&nbsp;</p>
    <p align="center"><img src="../../Program%20Files/Macromedia/Dreamweaver%204/Lessons/Lesson%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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <img src="../../Program%20Files/Macromedia/Dreamweaver%204/Lessons/Lesson%20Files/351125083.jpg" width="115" height="115"></p>
    <hr>
    <form name="form1" method="post" action="<?=$PHP_SELF;?>">
    <div align="center">
    <p align="left">&nbsp;</p>
    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="24%" id="AutoNumber1" bgcolor="#CCFFFF" height="38">
    <tr bgcolor="#666666">
    <td width="50%" height="22"><font face="Arial" size="4"><b>Admin ID </b></font></td>
    <td width="50%" height="22">
    <p align="center">
    <input name="User1" type="text" id="User1" size="6" maxlength="6">
    </td>
    </tr>
    <tr bgcolor="#666666">
    <td width="50%" height="15"><font face="Arial" size="4"><b>Password</b></font></td>
    <td width="50%" height="15">
    <p align="center">
    <input name="Password" type="Password" id="Password" size="6" maxlength="6">
    </td>
    </tr>
    </table>
    <p>&nbsp;</p>
    <p>
    <input type="submit" name="Submit3" value="Submit">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </p>
    </div>
    <p align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </p>
    </form>
    <div align="center">
    <center>
    </center>
    </div>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>



    <hr>
    <p align="center"><font face="Arial" size="1">Mina Store Electronics Authorise
    users only site monitored</font></p>
    <p align="center"><font face="arial" size="-1"><small>Copyright 2004 </small></font></p>
    <hr>
    <p align="center">&nbsp;</p>

    </body>

    </html>

  2. #2
    SitePoint Wizard bronze trophy JRMillion's Avatar
    Join Date
    Apr 2004
    Location
    Arlington VA
    Posts
    2,094
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well you've posted a number of times about this, so I'd say step 1 is get a good book...
    that said, your code relies on register globals being turned on.
    to access the POSTed password etc you should be using $_POST['Password2']....

    Also, you should have a username and passwork in your DB mysql_connect statement.

  3. #3
    SitePoint Wizard bronze trophy JRMillion's Avatar
    Join Date
    Apr 2004
    Location
    Arlington VA
    Posts
    2,094
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check this out, might help you out.
    http://www.free2code.net/tutorials/p...4/phplogin.php


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •