Search
Left Quote    Knowledge speaks, but wisdom listens.
- Jimi Hendrix    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: Complete Membership Question
  This user is offline  gravy
  Subject: "Complete Membership Question" Posted: @ 4:28 am on Mar 07 2007   

Member #: 294
Rank: User - (63)
Since: 03/07/07
Posts: 66
From: MN

Heya,
I'm new here, and I went through the whole Complete Membership Tutorial. I had a blast in there, and awesome job, mega props, and cool kudos to the author!

I understand what the page header php is doing but for some reason that escapes me is that I can not get $user to display the user name.

If I could just get a nudge toward where to look to fix this, that would be great!


Photo Hosting Scripts? It's what I do....
    Viewed: 11,274 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Complete Membership Question" Posted: @ 4:46 pm on Mar 07 2007    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

Hey try to use: $_SESSION['use rname']




-bs0d | AllSyntax.com

    Viewed: 11,260 Times | Reply to This | To top
  This user is offline  gravy
  Subject: "re: Complete Membership Question" Posted: @ 11:27 pm on Mar 07 2007    

Member #: 294
Rank: User - (63)
Since: 03/07/07
Posts: 66
From: MN

  bs0d said...

< i> Hey try to use: $_SESSION['use rname']

okay this is what I ended up doing after your suggestion and it works! Just wanna know if you see anything that will mess something up down the line.

Code:

if(!isset($_SES SION['username ']) && !isset($_SESSIO N['password'] )) {
$_SESSION['log ged_in'] = 0;
$user = "Guest&q uot;;
$message = "<font size='1' face='verdana '>Welcome <b>$user& lt;/b>, Please <a href=\"r egister.php\& quot;>Regist er</a> for a free account. Or <a href=\"l ogin.php\&quo t;>Login< /a> now.";
}else if ($_SESSION['lo gged_in'] = 1 ) {
$member = $_SESSION['use rname'];
$message = "<font size='1' face='verdana '>Welcome <b>$membe r</b>, you are now logged in, <a href=\"l ogout.php\&qu ot;>click here</a> to logout.";
}



BTW, a huge thank you for the response!




Photo Hosting Scripts? It's what I do....

    Viewed: 11,256 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Complete Membership Question" Posted: @ 11:48 pm on Mar 07 2007    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

No problem.

Looks good except this line:

}else if ($_SESSION['lo gged_in'] = 1 ) { should be:

} elseif($_SESSIO N['logged_in' ] == 1) {

and instead of $member = $_SESSION['use rname']; you probably meant: $user = $_SESSION['use rname'];



Edited at 11:51:35 pm on 03/07/07


-bs0d | AllSyntax.com

    Viewed: 11,253 Times | Reply to This | To top
  This user is offline  gravy
  Subject: "re: Complete Membership Question" Posted: @ 11:58 pm on Mar 07 2007    

Member #: 294
Rank: User - (63)
Since: 03/07/07
Posts: 66
From: MN

made the changes I can't believe I missed the = in there. I changed $member to $user and it works the same. Thanks dude!




Photo Hosting Scripts? It's what I do....

    Viewed: 11,249 Times | Reply to This | To top
  This user is offline  misterhaan
  Subject: "re: Complete Membership Question" Posted: @ 4:07 pm on Mar 08 2007    

Member #: 5
Rank: User - (213)
Since: 02/11/05
Posts: 148
From: chair

it's practically embarrassing how many times i put = instead of ==

though i do occasionally write code for work in a language that uses = instead of == (it also won't let you put spaces around it), so maybe i make this mistake more frequently after i've written code in that language




please note that the above post is likely made up in its entirety.

    Viewed: 11,221 Times | Reply to This | To top
  This user is offline  gravy
  Subject: "re: Complete Membership Question" Posted: @ 7:40 pm on Mar 08 2007    

Member #: 294
Rank: User - (63)
Since: 03/07/07
Posts: 66
From: MN

yeah i think i was just tired when i messed that up. gotta say i love not having to write all of the code though. now I just have to modify this script to send a welcome email to the user and i have to figure out how to upload pics through mysql to keep track of the photos the users upload so they can access them from their members page.

got alot of headaches ahead




Photo Hosting Scripts? It's what I do....

    Viewed: 11,216 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Complete Membership Question" Posted: @ 11:24 pm on Mar 08 2007    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

Actually, hold that thought on uploading images. I am currently working on an article (probably 1/2 done with it). Should be up by next week




-bs0d | AllSyntax.com

    Viewed: 11,210 Times | Reply to This | To top
  This user is offline  gravy
  Subject: "re: Complete Membership Question" Posted: @ 11:48 pm on Mar 08 2007    

Member #: 294
Rank: User - (63)
Since: 03/07/07
Posts: 66
From: MN

sweet! I will be sure to study it next week!




Photo Hosting Scripts? It's what I do....

    Viewed: 11,206 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank