28, May 2012

Login problem... - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Login problem...
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: Login problem...  (Read 1714 times)
Community Supporter ?
World Wide Whale
***
Gender: Male
Posts: 160
1052 credits
Members referred : 1



« on: Jul 31, 2006, 03:46:23 am »

Well i will try to tell you my problem...
i have a website that requires registration,so which is the problem...
every member makes the registration thats ok...so far,
when the member try to login have the error * Password or login incorrect*
this happening  to my login.php page
I upload to the server my back up and nothing happened!!!
Could someone give a solution to my problem?


P.S i don't know PHP Smiley
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #1 on: Jul 31, 2006, 08:10:40 am »

Don't worry, we know php, but you have to post some code to understand what the problem is....

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Jul 31, 2006, 08:14:08 am »

yes and some URL's where we can test it...

Community Supporter ?
World Wide Whale
***
Gender: Male
Posts: 160
1052 credits
Members referred : 1



« Reply #3 on: Jul 31, 2006, 02:56:53 pm »

Ok Smiley Tell me what exactly do you need and i will post it to you!!
My website url is www.thetoptraffic.com
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #4 on: Jul 31, 2006, 02:57:46 pm »

Post the php code of the login.php page

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Community Supporter ?
World Wide Whale
***
Gender: Male
Posts: 160
1052 credits
Members referred : 1



« Reply #5 on: Jul 31, 2006, 03:05:26 pm »

Code:
<?php
unset($login,$pwrd,$id);
session_start();
session_register("login","pwrd","id");

if(
$logout==1){
session_destroy();
header("Location: ".$PHP_SELF);
}

require(
'config_inc.php');
require(
'error_inc.php');


//require('error_inc.php');
//require('config_inc.php');


if(auth($login,$pwrd)!=0){
header("Location: $path/user_menu.php");
}

if(
$REQUEST_METHOD=="POST"){
if(isset($lo)){
$log=htmlspecialchars($log);
$passwrd=htmlspecialchars($passwrd);
$au=auth($log,$passwrd);
if($au>0){
$login=$log;   
$pwrd=$passwrd;
$id=$au;
header("Location: user_menu.php?PHPSESSID=".$PHPSESSID);
}else{
require('header_inc.php');
print "<p>".$err[1]."</p>";
}
}
}else{
require('header_inc.php');
}        
?>
       
<form name="form1" method="post" action="" >
  <table border="0" cellspacing="2" cellpadding="0" align="center">
    <tr align="center">
             
      <td height="20" align=right><b>Log In</b></td>
      <td height="20">&nbsp;</td>
            </tr>
            <tr>
             
      <td align="right">Your Name:</td>
             
      <td align="left" height="20">
        <input type="text" name="log" size="15">
      </td>
            </tr>
            <tr>
             
      <td align="right">Password:</td>
             
      <td align="left" height="20">
        <input type="password" name="passwrd" size="15">
      </td>
            </tr>
            <tr>
             
      <td align="right" valign="top">&nbsp;</td>
             
      <td align="left" height="20">
        <input type="submit" name="lo" value="Log In">
        <br>
<a href="forgot.php"><font color=blue size=1>Forgot your password?</font></a>
              </td>
            </tr>
          </table>
       </form>
<?php
require('footer_inc.php');
?>
« Last Edit: Jul 31, 2006, 03:10:02 pm by Nikolas »
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #6 on: Jul 31, 2006, 03:13:39 pm »

There should be a function called auth in your site's files.

Find it (propably in the config_inc.php file) and post the code here.

You will identify it by this :

function auth (......

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Jul 31, 2006, 03:19:20 pm »

does this script worked before?

check also in your php configuration the value for register_globals

Community Supporter ?
World Wide Whale
***
Gender: Male
Posts: 160
1052 credits
Members referred : 1



« Reply #8 on: Jul 31, 2006, 03:32:04 pm »

function auth($log,$pass){
        global $t_user;
        $query = "select id from ".$t_user." where email=\"".$log."\" and pass=\"".$pass."\" ";
        $result = MYSQL_QUERY($query);
        if(mysql_num_rows($result)>0){
                $id=mysql_result($result,0,"id");
                @mysql_free_result($result);
                return $id;
        }else{
                @mysql_free_result($result);
                return 0;

ok guys I am a big idiot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I just noticed that for usename you need   (where email=\"".$log."\" and pass=\"".$pass."\" "Wink
the email not only the name  Embarrassed
ok I am sorry...
Thank you Nikolas and Olaf  Cool
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #9 on: Jul 31, 2006, 03:34:33 pm »

Cheesy

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #10 on: Jul 31, 2006, 03:35:36 pm »

Hehe, it's ok.

BTW change this :

$query = "select id from ".$t_user." where email=\"".$log."\" and pass=\"".$pass."\" ";

to this :

$query = "select id from ".$t_user." where email=\"".addslashes($log)."\" and pass=\"".addslashes($pass)."\" LIMIT 1";

* The script is insecure.....

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Community Supporter ?
World Wide Whale
***
Gender: Male
Posts: 160
1052 credits
Members referred : 1



« Reply #11 on: Jul 31, 2006, 03:43:43 pm »

Ohh thanks men!
I knew it that i had to change this line ,but i wanted to check you... Tongue Tongue Tongue Tongue
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #12 on: Jul 31, 2006, 03:44:34 pm »

Ohh thanks men!
I knew it that i had to change this line ,but i wanted to check you... Tongue Tongue Tongue Tongue

Hehehe.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3486
Tags : php email Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Login problem...
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 12:44:51 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.