• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

How can I set nick name as a username from MySql DB

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
6 posts • Page 1 of 1

How can I set nick name as a username from MySql DB

Postby nunji » Mon Oct 08, 2012 5:17 am

Hi,

I'm using a login and registration system and I would like to know how can I set a nick name as a username from MySql database?
nunji
New member
 
Posts: 5
Joined: Thu Oct 04, 2012 4:06 pm
Top

Re: How can I set nick name as a username from MySql DB

Postby OldWolf » Mon Oct 08, 2012 5:14 pm

The depends entirely on the user management system you're using... find out how to return the nick from that system, and set it to $params['nick']
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Re: How can I set nick name as a username from MySql DB

Postby nunji » Tue Oct 09, 2012 1:47 pm

Thank you. but I'm confused. the code in brief is:

Code: Select all
HTML form:
user:
<INPUT type="TEXT" name="auth_user_" value="<?php echo $us; ?>" style="width:95px;"></TD>

<?php
                    //if the user-password that was entered is correct
                  {
                     $_SESSION["auth_user_id".$protect_user_group]=$us;  //saves session variable
                     $_SESSION["auth_password_id".$protect_user_group]=$ps;  //saves session variable
            
                     header("Location: x.php"); 
                  }
               
function CheckUserPassword($user,$pass,$with_calc=true)
{
   $sql=@mysql_connect("localhost","root","") ...
   
   $res=@mysql_query("SELECT user FROM user_pass WHERE (user_group='".$protect_user_group."' AND user='".$user."' AND pass='".$c_pass."
?>


So, should I define $params['nick']=$us
or $params['nick']=$user
or something else :?
nunji
New member
 
Posts: 5
Joined: Thu Oct 04, 2012 4:06 pm
Top

Re: How can I set nick name as a username from MySql DB

Postby OldWolf » Fri Oct 12, 2012 2:42 am

I would suggest you contact the folks who wrote the software, and ask them how you would go about printing the username. You'll use the same technique here.
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Re: How can I set nick name as a username from MySql DB

Postby nunji » Fri Oct 12, 2012 9:52 am

Thank you very much :D
I followed your advice and I found out that $param["nick"]=$_session["auth_user_id.protected_user_group"];
nunji
New member
 
Posts: 5
Joined: Thu Oct 04, 2012 4:06 pm
Top

Re: How can I set nick name as a username from MySql DB

Postby OldWolf » Mon Oct 15, 2012 7:02 am

Good, glad you got it worked out. :)
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top


Post a reply
6 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 15 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub