473,383 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Login issue

150 100+
Login issue in this code when i enter to the login page the login form still visible how can i solve this problem ?

[PHP]
<?php if(!($_SESSION['userLOGIN'])){ ?>
<form method='post' action='Login.php' id="LOGINFORM">
Username:
<input name='user' type='text' id='user' size='20' maxlength='15' />
<br />
Password:
<input name='pass' type='password' id='pass' size='20' maxlength='15' />
<br />
<span style='color: 999933;font-size: 9px;'><a href='#'>Forget Password</a> / <a href='Signup.php'>Signup</a></span>
<input type='submit' name='button' id='button' value='Login' />
</form>
<?php } ?>

<?php

if($_SESSION['userLOGIN']){
echo "Welcome ".$_SESSION['userLOGIN']." You are now logging in <input name='' type='button' value='GO' onclick='alert()'/>";
}else{
$userLOGIN = $_POST['user']; $userLOGIN = secure($userLOGIN);
$passLOGIN = $_POST['pass']; $passLOGIN = secure($passLOGIN);
if($userLOGIN == "" || $passLOGIN == ""){
echo "<span class='RED'>Please Fill all fields</span>";
}else{
include_once("Connections/conection.php");
$result=mysql_query("SELECT username,Password FROM users WHERE username='$userLOGIN' && Password=PASSWORD('$passLOGIN')",$myConnection);
if(mysql_num_rows($result)==1){
echo "Welcome $userLOGIN you are now logedin";
session_register("userLOGIN");
}else{
echo "<span class='RED'>Your not registerd in this site please try again or <a href='Signup.php'>Signup</a></span>";
}
}
}

?>[/PHP]
Jul 25 '07 #1
1 1464
dafodil
392 256MB
Expand|Select|Wrap|Line Numbers
  1. <?php if(!($_SESSION['userLOGIN'])){ ?>
  2.       <form method='post' action='Login.php' id="LOGINFORM">
  3.         Username:
  4.         <input name='user' type='text' id='user' size='20' maxlength='15' />
  5.         <br />
  6.         Password:
  7.         <input name='pass' type='password' id='pass' size='20' maxlength='15' />
  8.         <br />
  9.         <span style='color: 999933;font-size: 9px;'><a href='#'>Forget Password</a> / <a href='Signup.php'>Signup</a></span>
  10.         <input type='submit' name='button' id='button' value='Login' />
  11.       </form>
  12. <?php } ?>  
  13.  
  14.  
try to echo the part inside the if statement.
You should write it like this:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if(!($_SESSION['userLOGIN'])){ 
  3.  
  4. echo "<form....>";
  5. echo "Username";
  6. echo "<input....>";
  7. }
  8. ?>
  9.  
  10.  

Make sure that you are entering the correct password and username.

Check also the database if the username and password exist in the table.
Jul 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: 23s | last post by:
I had this problem in the past, after a server reformat it went away, and now after another server reformat it's back again - no clue what's doing it. Here's the flow: Website root is public, no...
5
by: RedEye | last post by:
Hello, I am working on a test site to explore the new login controls and membership features of ASP.NET v2.0. I have tested the controls using SQL Express and have now decided to try using a...
14
by: clintonG | last post by:
This is an appeal for peer support sent to Microsoft as will be noted in closing. The Login control does not include a Cancel button. The only option is to convert the Login control to a...
2
by: David Costello | last post by:
Hi all, I keep getting a bizarre login error, when trying to connect to a SQL Server 2005 database on a local domain to my machine using C#. The Exception returns: SQLException: Login failed for...
6
by: =?Utf-8?B?eW9kYWt0?= | last post by:
I'm having issues with logging into my application after moving it from the development server to the live IIS server. Things I've already done: 1) I made sure that I have applicationName set as...
11
by: Anil Gupte | last post by:
I am getting the following error: ********* Login failed for user 'AUM\ASPNET'. Description: An unhandled exception occurred during the execution of the current web request. Please review the...
2
by: =?Utf-8?B?U2hhbm5vbg==?= | last post by:
I am trying to publish an application to a server that I do not have desktop access to because of our hosting environment. I publish to a file share. The WEB site has been configured by the hosts...
3
by: shanthiniramu | last post by:
hi... I have an issue in my hosted page while i'm login when i give an invalid email-id in my login page, the page does'nt show any alert message...... but i wrote coding to show that alert...
0
by: Anup Daware | last post by:
Hi All, I am facing this very weird issue, for every server request my control is redirecting to the login page and again coming back to the actual page from where the request was initiated when I...
9
by: Josh | last post by:
I run a Joomla website and am familiar with php in some but not all aspects. Currently I am trying to find some solutions related to session handling. Am I correct in saying that "login" is kept...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.