--- On Fri, 2/19/10, Ashley Sheridan wrote:
From: Ashley Sheridan
Subject: Re: [PHP] Login Script: mysql_num_rows(): supplied argument is not a
valid MySQL result resource
To: "David Hutto"
Cc: php-general@lists.php.net
Date: Friday, February 19, 2010, 5:34 AM
On Fri,
On Fri, 2010-02-19 at 00:30 -0800, David Hutto wrote:
> The following script is supposed to validate a username and password in a
> mysql db. When entering the username and password of a preregistered user, I
> get the following errors:
>
> Warning: mysql_num_rows(): supplied argument is not
Daniel Brown wrote:
if(!isset($key=='1')) //caused parse error
That's because isset() isn't able to eval() an expression.
Got it, I see the mistake now.
Remove the !isset() part, or the =='1' part and that will remove
the parse error.
I changed it to if(!isset($key)) and yo
On Jan 5, 2008 11:50 AM, Reese <[EMAIL PROTECTED]> wrote:
> Daniel Brown wrote:
>
> > Do you expect the value of $key in this condition to be a literal zero?
> > $twoyears = array('alphanumeric_code1', 'alphanumeric_code2',
> > 'alphanumeric_code3', 'alphanumeric_code4',
>
On Jan 4, 2008 11:55 AM, Reese <[EMAIL PROTECTED]> wrote:
> Web Design Company wrote:
> > Someone?
>
> Me31!1!1ONE
>
> Please, if you do not need amplifying information or if you do
> not intend to pose a suggestion, it is better to remain silent.
> I wasn't helped by your "Someone?" post, no o
Web Design Company wrote:
Someone?
Me31!1!1ONE
Please, if you do not need amplifying information or if you do
not intend to pose a suggestion, it is better to remain silent.
I wasn't helped by your "Someone?" post, no one else was either.
Reese
--
PHP General Mailing List (http://www.php
Daniel Brown wrote:
[snip="all"]
Reese,
While I noticed several areas for improvement in the code (such as
being sure to exit; after calling header("Location: "); ), two
things primarily come to mind:
Do you expect the value of $key in this condition to be a literal zero?
On Jan 4, 2008 9:54 AM, Reese <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> I've been lurking for several weeks, I thought I'd post to describe
> a problem I've been having in the hope that a solution can be found.
> And my thanks to Casey, for his offlist assistance with another,
> unrelated issue e
Someone?
-
http://ooyes.net Web design company | http://ooyes.net Graphic design
company | http://ooyes.net Outsourcing company
--
View this message in context:
http://www.nabble.com/Login-script-problem-tp14618073p14618942.html
Sent from the PHP - General mailing list archive at Nabb
Richard Lynch wrote:
And using a re-direct instead of an include is a shocking waste of
HTTP resources imho, but that may not matter if traffic is low.
I generally redirect there because on occasion the login process does
stuff like clear out potentially pre-existing session data from another
On Fri, February 2, 2007 7:05 am, Jürgen Wind wrote:
>> // Set up the session here, or however you're tracking the
>> // current customer/user/whatever
>>
>> header('Location: /somewhere_else');
>> ?>
>>
>> Hope that helps.
>>
>> -Stut
>>
>>
> be aware that you need a session_write_close(); before
If you are splicing $_POST directly into your SQL, you are DEFINITELY
doing it wrong, but not in the way that you think.
Start reading here:
http://phpsec.org
On Fri, February 2, 2007 6:10 am, Dave Carrera wrote:
> Hi Stut,
>
> I think i have found where i am going wrong.
>
> Its in the com
On Fri, February 2, 2007 5:33 am, Satyam wrote:
> In login scripts you usually don't tell which part of the login is
> wrong,
> otherwise, you are hinting at what is right. Once the customer is
> logged
> in, you are right to be as helpful as possible, but until the customer
> proves who he/she is
On Fri, February 2, 2007 5:19 am, Dave Carrera wrote:
> Having a grey brain moment here and need some advise on the logic of
> this, should be simple, login script.
>
> I am checking validity of
>
> customer number
> customer email
> customer password (md5 in mysql)
>
> So i have my form with relev
Stut wrote:
>
>
>
> I'm not totally clear what the question was in there. Personally I keep
> this simple...
>
> $_POST['number'] =
> (isset($_POST['number']) ? trim($_POST['number']) : '');
> $_POST['email'] =
> (isset($_POST['email']) ? trim($_POST['email']) : '');
>
>
On p, 2007-02-02 at 12:10 +, Dave Carrera wrote:
> Hi Stut,
>
> I think i have found where i am going wrong.
>
> Its in the comparison login for the db result.
>
> So i select * from jfjfjfjf where custno=$_POST[number]
>
> But now i am getting messed up with if cust no not found then a
Hi Stut,
I think i have found where i am going wrong.
Its in the comparison login for the db result.
So i select * from jfjfjfjf where custno=$_POST[number]
But now i am getting messed up with if cust no not found then all i get
is a blank page but hoping for an error
And i dont think i
Dave Carrera wrote:
Hi All,
Having a grey brain moment here and need some advise on the logic of
this, should be simple, login script.
I am checking validity of
customer number
customer email
customer password (md5 in mysql)
So i have my form with relevant fields
Now i am getting problems
- Original Message -
From: "Dave Carrera" <[EMAIL PROTECTED]>
Hi All,
Having a grey brain moment here and need some advise on the logic of this,
should be simple, login script.
I am checking validity of
customer number
customer email
customer password (md5 in mysql)
So i have my for
On Tue, August 15, 2006 5:51 am, Dave Goodchild wrote:
> I think the php and mysql md5 functions differ but I may be wrong!
You are wrong. :-)
The whole point of MD5 is that MD5 is MD5, no matter where you go.
Even ASP MD5 is the same as PHP MD5.
Except it probably sucks for being too slow or y
On Tue, August 15, 2006 5:37 am, Ross wrote:
> I have a couple of questions
>
> first how do I check two tables is it?
You probably should not have 2 tables at all.
Both username and password would normally be stored in a single record
in the same table
CREATE TABLE user (
user_id int(11) auto
I would hope that MD5 hashing is MD5 hashing no matter where it
originates. However, I think it's better to use the database server's
implementation. I believe it is less likely to be changed in future
versions, and it removes some processing time from the front end.
Additionally, if you ever mo
On 15/08/06, Ross <[EMAIL PROTECTED]> wrote:
Hello,
I have a couple of questions
first how do I check two tables is it?
$sql = "SELECT * FROM mytable, mytable2 WHERE username = '$username' AND
userpass = '$userpass'";
Secondly my table just sends and returns straight values from the db but
Ross wrote:
first how do I check two tables is it?
$sql = "SELECT * FROM mytable, mytable2 WHERE username = '$username' AND
userpass = '$userpass'";
That depends on what you are trying to achieve. Your example makes no
sense at all. What are you trying to get from each table? How are they
"Chuck" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Could anyone let me know or point me to where I could find out how to
setup
> a login for my php site. I've been looking around and found plenty of
stuff
> for PHP/Apache, but nothing for just PHP.
>
> Any help or info about thi
Thanks for all the suggestions guys, I took your advice and currently
have a working login script (hopefully :) ). If I have any more
problems I'll be sure to ask you, it's nice to know that there's a place
I can always go for questions.
Thanks,
Brian
--
PHP General Mailing List (http://www.ph
Hey Brian,
how about something like this, just change the session info to cookies
if you want?
hth
On Mon, 2004-07-19 at 21:01, Brian Krausz wrote:
> [snip]
> a. do not reply off-list unless asked, your question may not receive the
> attention it needs
> [/snip]
> Sorry, I got the email bef
On Tuesday 20 July 2004 03:24, Brian Krausz wrote:
> While I know there are many scripts out there, and have spent many hours
> looking through them, I am having trouble finding a login script that
> fits my needs. I am looking for the following:
>
> A MySQL-based login system that doesn't use Pea
> [snip]
> a. do not reply off-list unless asked, your question may not receive the
> attention it needs
> [/snip]
> Sorry, I got the email before the board post so I assumed you were only
> replying off-list.
>
> [snip]
> 2. You do know basic PHP, correct? Create a page that accepts a username
> a
"Brian Krausz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> [snip]
> a. do not reply off-list unless asked, your question may not receive the
> attention it needs
> [/snip]
> Sorry, I got the email before the board post so I assumed you were only
> replying off-list.
>
> [snip]
> 2
[snip]
a. do not reply off-list unless asked, your question may not receive the
attention it needs
[/snip]
Sorry, I got the email before the board post so I assumed you were only
replying off-list.
[snip]
2. You do know basic PHP, correct? Create a page that accepts a username
and password. Have
Hello Brian,
Take a look at setcookie() in the PHP manual. The algorithm is pretty
simple. Once the user submits the form, you compare form data with the
data in the database. If the password matches, then set a cookie with
the username (using setcookie()). Then you'll just have to check if the
co
[snip]
Well I already have a db with username/password fields, etc. I'm just
looking for code for a login page and a file to include at the top of
each page for auth.
[/snip]
a. do not reply off-list unless asked, your question may not receive the
attention it needs
2. You do know basic PHP, c
Well I already have a db with username/password fields, etc. I'm just
looking for code for a login page and a file to include at the top of
each page for auth.
Jay Blanchard wrote:
[snip]
While I know there are many scripts out there, and have spent many hours
looking through them, I am having
[snip]
While I know there are many scripts out there, and have spent many hours
looking through them, I am having trouble finding a login script that
fits my needs. I am looking for the following:
A MySQL-based login system that doesn't use Pear :: DB. All I would
like is for it to support co
Sounds good (o;
I find it easyer to work with HTML auth anyway.
/ Mark
- Original Message -
From: "Chris Shiflett" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "PHP" <[EMAIL PROTECTED]>
Sent: Thursday, July 24, 2003 4:06 PM
Subject: Re: [PHP] Logi
--- Master Mark <[EMAIL PROTECTED]> wrote:
> Is HTTP auth better than HTML?
In my opinion, no. Handling authentication in your application is a much better
choice for numerous reasons (although HTTP authentication has its place and can
be very useful).
Chris
=
Become a better Web developer w
--- Karl James <[EMAIL PROTECTED]> wrote:
> Warning: Cannot add header information - headers already
> sent by (output started at
>
/home/virtual/site12/fst/var/www/html/Create_Account.php:8)
> in
/home/virtual/site12/fst/var/www/html/Create_Account.php
> on line 10
This means you have something o
Move this below to after your php logic:
Add a User
Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]
-Original Message-
From: Karl James [mailto:[EMAIL PROTECTED]]
Sent: Monday, 20 January 2003 1:59 PM
To: php
Subject: [PHP] login script fix help
php 4.* 4.03 I think, or something like that
first I have a form that directs to login.php, in that file I have
session_start();
session_register(admin_allow);
session_register(username);
session_register(password);
then I assign a word to admin_allow and the username and password to th
More information is needed... what version of PHP are your running? I bit
of sample code on how you set up your sessions would also be helpful...
/dkm
- Original Message -
From: "Hawk" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 15, 2002 11:19 AM
Subject: [PHP] L
This is your problem -- what do you expect this line to do?
> $sid (login($user, $pass));
Bogdan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
Line 10 is?
$sid (login($user, $pass)); <--- missing =
-Original Message-
From: Necro [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 21, 2001 1:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Login Script
Lo all,
I am trying to get the following script to work..
http://localhost/hq.php
43 matches
Mail list logo