473,407 Members | 2,598 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,407 software developers and data experts.

newbie login problem

Im having problems login in,this is my script. i was able to login
before with number of user accounts i created, but for some reason now
im unable to login, please have i look at the script to see if there
anything wrong.am pretty stuck

thanks

<?
$from_url = $_POST["fromurl"];
$err = 0;
$memberid=64;
if ((isset($_POST["username"])) && (isset($_POST["passwd"]))) {
$memberid = $f->checkLoginPassword($_POST["username"],
$_POST["passwd"]);
echo($_POST["username"]);

$memberid=64;
if ($memberid 0) {
$_SESSION["memberid"] = $memberid;
if ($from_url == "") {
$from_url = "myhome";
}
header("Location: myhome");
exit;
} else {
$err = 1;
}
} else {
$err = 1;
}
if ($err == 1) {
$smarty = new Smarty();
$smarty->assign("baseurl", $config["baseurl"]);
if (isset($_POST["fromurl"])) {
$smarty->assign("fromurl", $_POST["fromurl"]);
}
$smarty->assign("wrong", 1);
$smarty->assign("memberid", $memberid);
$smarty->assign("stats", $stats);
$smarty->display("login.htm");
}

?>
Aug 10 '08 #1
1 1036
Reggie wrote:
Im having problems login in,this is my script. i was able to login
before with number of user accounts i created, but for some reason now
im unable to login, please have i look at the script to see if there
anything wrong.am pretty stuck

thanks

<?
$from_url = $_POST["fromurl"];
$err = 0;
$memberid=64;
if ((isset($_POST["username"])) && (isset($_POST["passwd"]))) {
$memberid = $f->checkLoginPassword($_POST["username"],
$_POST["passwd"]);
echo($_POST["username"]);

$memberid=64;
if ($memberid 0) {
$_SESSION["memberid"] = $memberid;
if ($from_url == "") {
$from_url = "myhome";
}
header("Location: myhome");
exit;
} else {
$err = 1;
}
} else {
$err = 1;
}
if ($err == 1) {
$smarty = new Smarty();
$smarty->assign("baseurl", $config["baseurl"]);
if (isset($_POST["fromurl"])) {
$smarty->assign("fromurl", $_POST["fromurl"]);
}
$smarty->assign("wrong", 1);
$smarty->assign("memberid", $memberid);
$smarty->assign("stats", $stats);
$smarty->display("login.htm");
}

?>
I don't see how this ever worked. You set $memberid to 64, then to some
value returned from checkLoginPassword(), then immediately back to 64
again. You also echo $_POST['username'], which, if isn't set, will
cause an E_NOTICE. If you are displaying notices, this will stop the
redirect from happening.

I suggest you go back to the version which works and take it from there.
Some of the changes you made here make no sense other than for debugging.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 11 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: uberboyz | last post by:
hi all! i am new to this forum! trying to get some help here. i want to validate 2 users before proceeding to the next function. i have no idea of how to do it, but i tried using the login function...
3
by: db_happy | last post by:
Hello I install Oracle8 Enterprise Edition Release 8.0.4 for Windows NT and I choose Typical in Starter Database.As I understand ORACLE create a sample database for me (If that is wrong please...
1
by: Doug | last post by:
Hello all. I'm learning ASP.NET C# and I have a question about how to go about getting the user's domain login. I need to get the login and use it to query a database to get other information about...
4
by: frankrentef | last post by:
Greetings all, I'm wanting to maintain what values in one file and call them in another. The purpose being to keep a single location where url's, login's and passwords can be maintained, then...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.