Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8268877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:02:27+00:00 2026-06-08T06:02:27+00:00

I hope you guys can help me. I’ve got a php file name login.php,

  • 0

I hope you guys can help me. I’ve got a php file name login.php, in this page there is a form for submitting a name and a password, and then there is checklogin.php that connects to the bd and check if the user exists.

The problem is that when I put the info about user and then submit nothing happens. It stays on the same page (login.php).

Here is the code in login.php:

<link rel="stylesheet" type="text/css" href="StyleSheet.css" />

</head>

  <style type="text/css">
    #Button1
    {
        width: 120px;
    }
    #Button2
    {
        width: 120px;
    }
</style>


<body onload="display_ct(),display_ct2();">
<form id="form1" runat="server">
<div id="wrap">
<div id="header">
<div id="Div1">
<div class="row dropdown-container fixed">
<div class="col-220">
<a id="logo" title="Back Home" href="index.htm">
<img width="220" alt="logo" src="Images/logo.jpg"/>
</a>
</div>
<div class="col-701 last">
<p>&nbsp;</p>
<p class="get-in-touch">
<img width="14" height="10" alt="" src="Images/flagpt.jpg"/>
<strong>
      <script type="text/javascript">
          function display_c() {
              var refresh = 1000; // Refresh rate in milli seconds
              mytime = setTimeout('display_ct()', refresh)
          }

          function display_ct() {
              var strcount
              var x = new Date()
              var horas = x.getHours();
              var min = x.getMinutes();
              var sec = x.getSeconds();
              if (horas < 10) {
                  horas = "0" + horas;
              }
              if (min < 10) {
                  min = "0" + min;
              }
              if (sec < 10) {
                  sec = "0" + sec;
              }

              document.getElementById('ct').innerHTML = horas + ":" + min + ":" + sec + " ";
              tt = display_c();
          }

      </script> <span id='ct' ></span>
</strong>
<img width="14" height="10" alt="" src="Images/flagiraque.jpg"/>
<strong>
<script type="text/javascript">
function display_c2() {
    var refresh = 1000; // Refresh rate in milli seconds
    mytime2 = setTimeout('display_ct2()', refresh)
}

function display_ct2() {
    var strcount
    var x = new Date()
    var horas1 = x.getHours() + 2;
    var min1 = x.getMinutes();
    var sec1 = x.getSeconds();

    if (horas1 < 10) {
        horas1 = "0" + horas1;
    }
    if (horas1 > 24) {
        horas1 = "0" + (horas1 - 24);
    }

    if (min1 < 10) {
        min1 = "0" + min1;
    }
    if (sec1 < 10) {
        sec1 = "0" + sec1;
    }
    document.getElementById('ct2').innerHTML = horas1 + ":" + min1 + ":" + sec1 + " ";
    tt1 = display_c2();
}

      </script> <span id='ct2' ></span>
</strong>
</p>
<p class="text-right">غرفة التجارة و الصناعة البرتغالية العراقية</p>
<p class="text-right1">Câmara do Comércio e Indústria Portugal-Iraque</p>
<p class="text-right">ژووری بازرگانی عیراق پۆرتگال</p>
</div>
<ul id="nav">
<li><a href="index.htm"><center>Inicio <br />  بداية  </center> </a></li>

<li onmouseover=""><center><a href="about2.htm">About Us</a></center>  <center>  حول الغرفة </center>    
    <ul class="nav first"> 
        <li><a href="MsgPresidente.htm"><center>Palavra do Presidente</center>  <center>  كلمة الرئيس  </center></a> </li>
        <li><a href="DirectionBoard.htm"><center> Direcção</center>  <center> كلمة الرئيس  </center></a> </li>
        <li><a href="ConsultiveBoard.htm"><center>Conselho Superior</center>  <center>المجلس الاستشاري </center></a></li>
        <li><a href="GeneralAssembly.htm"><center>Assembleia Geral</center>  <center>الجمعية العامة</center></a></li>
        <li><a href="FinancialCouncil.htm"><center>Conselho Fiscal</center>  <center>الهيئة المالية </center></a></li>

        <li><a href="FoundingMembers.htm"><center>Membros Fundadores</center>  <center> العضاء المؤسسين </center></a></li>   
    </ul>
</li>
<li><a href="Links.htm"><center>Links</center>  <center>  روابط</center></a></li>
<li><a href="Protocolos.htm"><center>Protocolos</center>  <center>  مذكرات تفاهم  </center> </a></li>
<li onmouseover=""><center><a href="news2.htm">Noticias/Fotos/Videos</a></center>  <center> اخبار و صور  </center>    
    <ul class="nav first"> 
        <li><a href="news2.htm"><center>Noticias</center>  <center> اخبار   </center> </a></li>
        <li><a href="photo1.htm"><center>Fotos</center>  <center> صور   </center></a> </li> 
        <li><a href="videos.htm"><center>Videos</center>  <center>  افلام </center></a> </li>   
    </ul>
</li>    
<li onmouseover=""><center><a href="associados2.htm">Associados</a></center>  <center> اعضاء  </center>    
    <ul class="nav first"> 
        <li><a href="HowToJoin.htm"><center>Como entrar</center>  <center>كيفية الاشتراك </center></a> </li>
        <li><a href="ListOfMembers.htm"><center>Lista de Membros</center>  <center>  قائمة الاعضاء </center></a> </li>  
    </ul>
</li>    
<li><a href="Contacts.htm"><center>Contactos</center>  <center>اتصل بنا  </center></a>     </li> 
</ul>
</div>
</div>
</div>
<div id="content">
<div class="hr">

</div> 
<div class="row fixed">
<div class="col-220">
<ul id="news-box">
<p></p>
</ul>
</div>
<div class="col-460 ">
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="checklogin.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Member Login </strong></td>
</tr>
<tr>
<td width="78">Username</td>
<td width="6">:</td>
<td width="294"><input name="myusername" type="text" id="myusername"></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input name="mypassword" type="password" id="mypassword"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input type="submit" name="submit" value="Login"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>

</div>
</div>
</div>

<div id="footer">
<div class="row fixed">
<div class="col-220">
    <p >

        <img width="130" height="70"   alt="emb" src="Images/smartcom.jpg"/><br>
<strong>
&copy; 2012

<a href="http://www.smartcom.pt">Smartcom,
        <br/></a>Intelligent Communications&nbsp;


</strong>
</p>
<p >
All rights reserved.
<br/>

</p>
</div>
<div class="col-460 ">

</div>
</div>
</div>
</div>
</div>  
</form>

</body>
</html>

Checklogin.php:

<?php
//ob_start();
//session_start();
if(isset($_POST['submit']))
{
$host="localhost"; // Host name
$username="ccili_userccili"; // Mysql username
$password="lKUJZhn[{w#e"; // Mysql password
$db_name="ccili_BD"; // Database name
$tbl_name="User"; // Table name


// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

// username and password sent from form
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);


//$sql="SELECT * FROM $tbl_name WHERE LOGINNAME='$myusername' and LOGINPASS='$mypassword'";
$result=mysql_query("SELECT * FROM $tbl_name WHERE LOGINNAME='$myusername' and LOGINPASS='$mypassword'");

// Mysql_num_row is counting table row
$count=mysql_num_rows($result);

// If result matched $myusername and $mypassword, table row must be 1 row

if($count==1){

// Register $myusername, $mypassword and redirect to file "login_success.htm"
session_register("myusername");
session_register("mypassword");

header("Location: login_sucess.php");
//header("Location: http://ccili.org/login_sucess.php");
die();
}
else {
echo "Wrong Username or Password";
}
}
//ob_end_flush();
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:02:32+00:00Added an answer on June 8, 2026 at 6:02 am

    You have nested form tags and that doesn’t quite work. The form is submitting to the first tag that has no action attribute.

    Here is some more insight on the nesting issue: Can you nest html forms?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope some of you guys can help me with this problem.... I have
I hope you guys can help me with this one. So, I have a
Hello StackOverflow Community, I hope you guys can help me with this here: On
This has been doing my head in. Hope you guys can help. I can't
I hope you guys can help me with this. The navigation, tabmenunav has 3
I'm really confused so I hope you guys can help me. I know how
I've run in to a problem I hope you guys can help me with.
First time stackoverflow user but occasional lurker, hope you guys can help me out.
I am stuck with a design problem that I hope you guys can help
Couldn't find a better place to ask this so I hope you guys can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.