Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

user checking

Asked Modified Viewed 4,988 times
M
Marius L T
M
  • Newbie, joined since
  • Contributed 7 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
asked
Newbie

hello guys. I'm new on php and i need big help.

www.yoursite.com/checkuser.php?username=(use name)&password=(user password)

and if user are in gruop example in V.M (i made that gruop) then window shows some key (exampe True)

If username and password is good but the user aren't in group then window shows false

Also if username and password is not good then window shows false
(sorry for english)
Thanks for help

Marius L T
0 replies

12 posts

A
afif
A
afif 10
  • Member, joined since
  • Contributed 183 posts on the community forums.
  • Started 12 threads in the forums
answered
Member


/*
| In case you have input fields on the previous page where
| you can give the user name and password.
*/

//Select database entry with the given username
$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='".$_POST['username']."'");

//Check if the given username exists
$rows = dbrows($result);
if ($rows) {
$cgroup = dbarray($result);
if (md5(md5($_POST['user_password'])) == $cgroup['user_password']) {
//use the explode function to check
$usergroup = explode(".",$cgroup['user_groups']);
//assuming your group ID is 2 (p.s: don't tell me you don't know how to get the group ID)
if (in_array("2", $usergroup)) {
echo "You are in the group";
} else {
echo "You are not in the group";
} else {
echo "wrong password!";
}
} else { echo "No user name such as ".$_POST['username']; }


This is my spontaneous coding but basically it's a rough sketch of what you can do.
Hope you get the picture.
Edited by afif on 04-02-2010 01:27,
0 replies
M
Marius L T
M
  • Newbie, joined since
  • Contributed 7 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Newbie

thanks. I added but i see empty window. Can you tell me what ling could be? i'm trying www.rsbot.hostzi.com/perz.php?user_name=(myname)&password=(mypw)

(perz is my php file name)
0 replies
A
afif
A
afif 10
  • Member, joined since
  • Contributed 183 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

Quote

Marius L T wrote:
thanks. I added but i see empty window. Can you tell me what ling could be? i'm trying www.rsbot.hostzi.com/perz.php?user_name=(myname)&password=(mypw)

(perz is my php file name)


LOL. told you in my post, it's a rough sketch of what you can do..
it's not a perfectly-working code. that is going to be long.
Edited by afif on 04-02-2010 19:26,
0 replies
M
Marius L T
M
  • Newbie, joined since
  • Contributed 7 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Newbie

i see empty window always
0 replies
A
afif
A
afif 10
  • Member, joined since
  • Contributed 183 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

do you have any experience with php mysql or html?
0 replies
B
Basti
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
answered
Veteran Member

use stripinput please! :)

$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='".stripinput($_POST['username'])."'");

 
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Quote

afif wrote:
do you have any experience with php mysql or html?


I don't think that is relevant here, he just needs help.
0 replies
M
Marius L T
M
  • Newbie, joined since
  • Contributed 7 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Newbie

I don't have any experience on php. I just started. Also what i need change on script input. (sorry i don't know anything on php)
Edited by Marius L T on 04-02-2010 22:47,
0 replies
M
Marius L T
M
  • Newbie, joined since
  • Contributed 7 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Newbie

How to input script??
0 replies
A
afif
A
afif 10
  • Member, joined since
  • Contributed 183 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

Quote

Marius L T wrote:
How to input script??


You mean input text or data or something?
You have to use <form> tag and <input> tag.
Try on that. Find tutorials in the Internet. For a start, you may wanna take a look at w3schools.com
0 replies
M
Marius L T
M
  • Newbie, joined since
  • Contributed 7 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Newbie

afif i adde your script to mine web. But when i enter like this:

www.rsbot.hostzi.com/usercheck.php?user_name=k1&password=password

I see always empty window but username and password is
right. Also user is in group.

slaughter said that acc script input. I'm asking how to do it?
0 replies
A
afif
A
afif 10
  • Member, joined since
  • Contributed 183 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

LOL. as i've said earlier, my script is not a perfectly-working code.
and by the way, what slaugher is saying is stripinput, not script input!

what you should do is:

1. have a page with forms to input username + password.
2. have the processing .php file to check
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 12 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
A
A
afif 10
  • Member, joined since
  • Contributed 183 posts on the community forums.
  • Started 12 threads in the forums
B
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
M
M
  • Newbie, joined since
  • Contributed 7 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet