The Login Page (in Drmwvr)

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 24, 2009, 02:09 PM
431863 members and 298845 Topics
Latest Member: araybia
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Webmasters (Moderators: OmniPotens, yawa-ti-de)  |  The Login Page (in Drmwvr)
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: The Login Page (in Drmwvr)  (Read 223 views)
Dr. Ayo
The Login Page (in Drmwvr)
« on: September 09, 2009, 04:53 PM »

Kindly help pls.
I have just built the login page for my site (I use drmwvr) and I discovered it's not taking me to the 'on success' page. It's not even leaving the login page and I think the codes are intact.
The users are already registered on the DB and the database is communicating well. Other applications like record update is working fine.
Where am I getting it wrong please.
yawa-ti-de (f)
Re: The Login Page (in Drmwvr)
« #1 on: September 09, 2009, 06:21 PM »

paste your code Wink
biggjoe (m)
Re: The Login Page (in Drmwvr)
« #2 on: September 09, 2009, 06:33 PM »

like yawa said, paste your code!

But a quick advice i might give you is that authors of DW have somethings predefined.

If you are to create a login system you must name your session 'MM_username' for it to work unless you know how to tweak their codes.

It took me like six months to fathom that. Grin
yawa-ti-de (f)
Re: The Login Page (in Drmwvr)
« #3 on: September 09, 2009, 07:24 PM »

wow bigjoe.  I wonder how long it would have taken if you opened up notepad and came up with the code yourself  Grin Grin Tongue Cool Huh Undecided Grin Grin
jackkk
Re: The Login Page (in Drmwvr)
« #4 on: September 09, 2009, 07:34 PM »

If you are to create a login system you must name your session 'MM_username' for it to work unless you know how to tweak their codes.
biggjoe (m)
Re: The Login Page (in Drmwvr)
« #5 on: September 10, 2009, 08:09 AM »

Quote from: yawa-ti-de on September 09, 2009, 07:24 PM
wow bigjoe. I wonder how long it would have taken if you opened up notepad and came up with the code yourself Grin Grin Tongue Cool Huh Undecided Grin Grin

I woulda done that but the problem here is that I dont know what his database USERS table and its fields were named.

If I can can say for sure now that his username field in db is named 'username' and password field named 'password', I would simply 'clone' a DW code for a login page for him.

But he is not even coming back. Just like most people here who come looking for help. They always bolt whenever help is about to come.
yawa-ti-de (f)
Re: The Login Page (in Drmwvr)
« #6 on: September 10, 2009, 09:51 AM »

Well we can't say that biggjoe Smiley

Maybe he can't afford the credits to surf regularly or whatever.  We can't really say. Let us give him some time.

Having said that, a wise man once told me many years ago that many people don't need help, because they don't appreciate it.
inf8nity (m)
Re: The Login Page (in Drmwvr)
« #7 on: September 10, 2009, 11:11 AM »

@ Dr. Ayo What version of dreamweaver ar u using?
biggjoe (m)
Re: The Login Page (in Drmwvr)
« #8 on: September 10, 2009, 12:58 PM »

Quote from: yawa-ti-de on September 10, 2009, 09:51 AM
Well we can't say that biggjoe Smiley

Maybe he can't afford the credits to surf regularly or whatever.  We can't really say. Let us give him some time.

Having said that, a wise man once told me many years ago that many people don't need help, because they don't appreciate it.

I cant agree less on that one. People appreciate things better when they pay for it.
Dr. Ayo
Re: The Login Page (in Drmwvr)
« #9 on: September 11, 2009, 02:26 PM »

Sorry guys. I was only trying to see if I could figure it out.
I am haveing problems with my connection at home for now(the modem is not communicating with the system) so I won't be able to paste the codes.
Pls, where else do you think it could have stemmed from aside the session.
(inf8nity)= I use vers. 8
I appreciate your time and concern, all. Thanks

Dr. Ayo
Re: The Login Page (in Drmwvr)
« #10 on: September 12, 2009, 12:29 PM »

The Codes (I was able to get the connection going)


<?php require_once('Connections/mysite.php'); ?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['usrnametxt'])) {
  $loginUsername=$_POST['usrnametxt'];
  $password=$_POST['usrnametxt'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "login success.php";
  $MM_redirectLoginFailed = "login fails.php";
  $MM_redirecttoReferrer = true;
  mysql_select_db($database_mysite, $mysite);
 
  $LoginRS__query=sprintf("SELECT Username, Paasword FROM login WHERE Username='%s' AND Paasword='%s'",
    get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
   
  $LoginRS = mysql_query($LoginRS__query, $mysite) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
   
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;        

    if (isset($_SESSION['PrevUrl']) && true) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];   
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Login</title>
<style type="text/css">
<!--
body,td,th {
   font-family: Georgia, Times New Roman, Times, serif;
   font-size: 14px;
}
-->
</style></head>

<body>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
  <tr>
    <td><form ACTION="<?php echo $loginFormAction; ?>" id="usrnmeform" name="usrnmeform" method="POST">
      <label>Username
        <input name="usrnametxt" type="text" id="usrnametxt" />
        </label>
    </form></td>
  </tr>
  <tr>
    <td><form id="pswdform" name="pswdform" method="post" action="">
      <label>Password&nbsp;
        <input name="pswdtxt" type="text" id="pswdtxt" />
        </label>
    </form></td>
  </tr>
  <tr>
    <td><form id="submitform" name="submitform" method="post" action="">
      <label>
      <input type="submit" name="Submit" value="Submit" />
        </label>
    </form></td>
  </tr>
</table>
</body>
</html>

Expecting your usuall replies.
biggjoe (m)
Re: The Login Page (in Drmwvr)
« #11 on: September 12, 2009, 03:14 PM »

I noticed two errors from your code:

You declared your username field as your password field on line 15 below,  I indicated the error line in red and the alternate code on it below.
Quote
<?php require_once('Connections/mysite.php'); ?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['usrnametxt'])) {
  $loginUsername=$_POST['usrnametxt'];
15.    $password=$_POST['usrnametxt']; // use:  $password=$_POST['pswdtxt'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "login success.php";
  $MM_redirectLoginFailed = "login fails.php";
  $MM_redirecttoReferrer = true;
  mysql_select_db($database_mysite, $mysite);
 
  $LoginRS__query=sprintf("SELECT Username, Paasword FROM login WHERE Username='%s' AND Paasword='%s'",
    get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
   
  $LoginRS = mysql_query($LoginRS__query, $mysite) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
   
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;         

    if (isset($_SESSION['PrevUrl']) && true) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];   
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Login</title>
<style type="text/css">
<!--
body,td,th {
   font-family: Georgia, Times New Roman, Times, serif;
   font-size: 14px;
}
-->
</style></head>

<body>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
  <tr>
    <td><form ACTION="<?php echo $loginFormAction; ?>" id="usrnmeform" name="usrnmeform" method="POST">
      <label>Username
        <input name="usrnametxt" type="text" id="usrnametxt" />
        </label>
    </form></td>
  </tr>
  <tr>
    <td><form id="pswdform" name="pswdform" method="post" action="">
      <label>Password&nbsp;
        <input name="pswdtxt" type="text" id="pswdtxt" />
        </label>
    </form></td>
  </tr>
  <tr>
    <td><form id="submitform" name="submitform" method="post" action="">
      <label>
      <input type="submit" name="Submit" value="Submit" />
        </label>
    </form>
</td>
  </tr>
</table>
</body>
</html>


Again, the portion I colored red above is all wrong,  you created separate forms for each of your form fields.  All your form fields should be inside one form, ok?
 use the one below:

Code:
<form ACTION="<?php echo $loginFormAction?>" id="usrnmeform" name="usrnmeform" method="POST">
      Username
        <input name="usrnametxt" type="text" id="usrnametxt" />
        Password
        <input name="pswdtxt" type="text" id="pswdtxt" />
        <input type="submit" name="Submit" value="Submit" />
        <br />
       
    </form>
Dr. Ayo
Re: The Login Page (in Drmwvr)
« #12 on: September 12, 2009, 03:54 PM »

Thanks so much, biggjoe.
U took your time to point out those flaws. I'm grateful.
I Will effect it and tell u how far.
yawa-ti-de (f)
Re: The Login Page (in Drmwvr)
« #13 on: September 12, 2009, 05:10 PM »

Here is another (assuming you didn't type it that way on purpose).  It is bolded for your convenience:

Quote
$LoginRS__query=sprintf("SELECT Username, Paasword FROM login WHERE Username='%s' AND Paasword='%s'",
Afam (m)
Re: The Login Page (in Drmwvr)
« #14 on: September 12, 2009, 06:15 PM »

Quote from: Dr. Ayo on September 12, 2009, 12:29 PM
The Codes (I was able to get the connection going)


<?php require_once('Connections/mysite.php'); ?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['usrnametxt'])) {
  $loginUsername=$_POST['usrnametxt'];
  $password=$_POST['usrnametxt'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "login success.php";
  $MM_redirectLoginFailed = "login fails.php";

  $MM_redirecttoReferrer = true;
  mysql_select_db($database_mysite, $mysite);
 

Is login success.php a valid page name?

Is login fails.php a valid page name?
biggjoe (m)
Re: The Login Page (in Drmwvr)
« #15 on: September 12, 2009, 06:43 PM »

Quote from: Afam on September 12, 2009, 06:15 PM
Is login success.php a valid page name?

Is login fails.php a valid page name?

As for valid, I will say Yes. Yes because the page will be available but the url will be encoded to 'login%20fails.php'
Advisable? My answer is NO.

Quote from: yawa-ti-de on September 12, 2009, 05:10 PM
Here is another (assuming you didn't type it that way on purpose).  It is bolded for your convenience:


And that too.
Afam (m)
Re: The Login Page (in Drmwvr)
« #16 on: September 12, 2009, 07:34 PM »

Quote from: biggjoe on September 12, 2009, 06:43 PM
As for valid, I will say Yes. Yes because the page will be available but the url will be encoded to 'login%20fails.php'
Advisable? My answer is NO.

Ok. Just wondering why someone will name pages that way.
nitation (m)
Re: The Login Page (in Drmwvr)
« #17 on: September 13, 2009, 10:51 AM »

@ Poster,

Looking at your codes, I will suggest you learn the basics of Hyper Texture Markup Language before venturing into Server-side scripting language such as - php, Asp, Jsp, etc.

This will do you every good! If not, you will find yourself asking for help with everything you wanna do. Google beginners to HTML and I believe "Sir googs" will not disappoint.

- nitation



biggjoe (m)
Re: The Login Page (in Drmwvr)
« #18 on: September 14, 2009, 11:26 AM »

Quote from: nitation on September 13, 2009, 10:51 AM
@ Poster,

Looking at your codes, I will suggest you learn the basics of Hyper Texture Markup Language before venturing into Server-side scripting language such as - php, Asp, Jsp, etc.

This will do you every good! If not, you will find yourself asking for help with everything you wanna do. Google beginners to HTML and I believe "Sir googs" will not disappoint.

- nitation

if he can use dreamweaver, he has come to a stage where it will be easier for him to learn from codes generated by DW than online tutorials.

Thats the way I see it though.
nitation (m)
Re: The Login Page (in Drmwvr)
« #19 on: September 14, 2009, 04:15 PM »

@Biggjoe,

Picture yourself in an interview, and a question splashed that you must write 300 lines of HTML codes using a notepad. This is where the disadvantage comes in. Drag dropping TD's and TR's will not be available for you, and there will be no Drmwvr to generate codes also. More so,  dreamweaver was not designed to secure your application from all known security hassles.

If you have learnt through this system, then I see why it took you six months to fix a line of code.

"Bad programming practice me brother"

Edited just now: by the look of things, this poster still lacks the basics of HTML!!!

- nitation
Afam (m)
Re: The Login Page (in Drmwvr)
« #20 on: September 14, 2009, 04:41 PM »

Quote from: nitation on September 14, 2009, 04:15 PM

Edited just now: by the look of things, this poster still lacks the basics of HTML!!!

- nitation

I agree with this. The thing about IT is that if you don't take the time to learn and understand it then be prepared to run into avoidable problems as issues would come up when you least expected and it becomes worse if you don't even understand what went wrong talk less of knowing how to fix it.
nitation (m)
Re: The Login Page (in Drmwvr)
« #21 on: September 14, 2009, 04:58 PM »

@ Afam

Short corners to programming always end up in a disastrous output. I don't know where the dude got his training from, but the foundation matters a lot.

- nitation
yawa-ti-de (f)
Re: The Login Page (in Drmwvr)
« #22 on: September 14, 2009, 05:06 PM »

nitation, afam:

Thanks for bringing this up.  When I do, I am often barraged with -ve posts and at some point, I am asked, "can i see your works?"

In my neck of the woods, we had to code in Emacs (unix) and in pascal for our first programming class.  Though we hated it as we knew we would never use either in the real world, the point made was that by getting our hands dirty, we would know what to do in the event that our beloved WYSIWYG editor decided to "misbehave".

In the event that I organize a seminar in Nigeria, one thing I will stress up front is that there wil be no dream weaver.  you will code from scratch.  After that, should you choose to go buy dreamweaver, believe, u will thank me later  Cool
biggjoe (m)
Re: The Login Page (in Drmwvr)
« #23 on: September 14, 2009, 06:26 PM »

Quote from: nitation on September 14, 2009, 04:15 PM
@Biggjoe,
If you have learnt through this system, then I see why it took you six months to fix a line of code.
-----------------------
Now I see where you are taking this whole thing to. But I wont be available there.

I must also say here  that Dreamweaver helped me to learn and I am not ashamed of it ok. That hasn't changed anything about the way I work now. Some of the best coders cant even use DW probably because they dont believe in it. Some might have also learnt with it.

When you said: "Bad programming practice me brother", I wondered whether you still remember that you are talking about learning.

Anyone can learn through any given method, thats why we are all different.
Afam (m)
Re: The Login Page (in Drmwvr)
« #24 on: September 14, 2009, 06:56 PM »

I use Dreamweaver to handle simple straight forward tasks everyday but I am not limited by the inherent limitation of dreamweaver itself because I simple revert to writing raw codes and navigating through logic.

The most important thing is for the programmer to understand whatever underlying code he/she may come across.

As a matter of fact most authoring tools have problems that seasoned programmers end up tweaking themselves unless they intend to wait for the software maker to release updates.

If you want to know the extent of problems inherent in some of the popular tools out there just visit the software owners website and see the support or forum section (if they are even bold enough to setup one) and you will be shocked at the number of mistakes, errors and bugs that even the latest releases of popular tools come with.
yawa-ti-de (f)
Re: The Login Page (in Drmwvr)
« #25 on: September 14, 2009, 06:59 PM »

biggjoe:

Not the point - that you can't or shouldn't use DW

The point - when all you have is a hammer, everything is a nail.
biggjoe (m)
Re: The Login Page (in Drmwvr)
« #26 on: September 14, 2009, 07:15 PM »

Quote from: yawa-ti-de on September 14, 2009, 06:59 PM
biggjoe:

Not the point - that you can't or shouldn't use DW

The point - when all you have is a hammer, everything is a nail.

Ya it is absolutely true and its not like I didnt get the point.
However, Nitation seemed to be trying to get personal when he tried to overstretch the issue by referring to a casual statement I made earlier.
Afam (m)
Re: The Login Page (in Drmwvr)
« #27 on: September 14, 2009, 07:22 PM »

@biggjoe and nitation,

Abeg, make everybody hide hin sword for now make we make up. Minor issues if not resolved properly may create bigger problems and it may not be worth it.

Enjoy!
zenus (m)
Re: The Login Page (in Drmwvr)
« #28 on: September 14, 2009, 07:36 PM »

i love DW especially from the code download
biggjoe (m)
Re: The Login Page (in Drmwvr)
« #29 on: September 14, 2009, 07:41 PM »

Quote from: Afam on September 14, 2009, 07:22 PM
@biggjoe and nitation,

Abeg, make everybody hide hin sword for now make we make up. Minor issues if not resolved properly may create bigger problems and it may not be worth it.

Enjoy!

That was why I said that I know where it is going and that I wont be available there.

Quote from: zenus on September 14, 2009, 07:36 PM
i love DW especially from the code download
whatever that means Huh
nitation (m)
Re: The Login Page (in Drmwvr)
« #30 on: September 15, 2009, 06:05 AM »

OK, I am no longer emphasizing on this issue. I will watch from here

- nitation
 Why Did My Sidebar Move Down   Did You More About Phpbb  I Love To Know About Web Designing.  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.