Welcome to Geeklog, Anonymous Friday, November 29 2024 @ 01:29 pm EST
Geeklog Forums
staticpages and php problem
Status: offline
sornok
Forum User
Newbie
Registered: 03/04/04
Posts: 9
I am trying to do the following on a static page
what I want to do is to check if the current user is a member or not and create the appropriate link for him , ie if its a member to create a link to edit his/her profile and if its a guest to create a link to go to the registration page
the page is centerblock and it is at the top of the page - homepage only - not wrapped in a block
my first question is, what is the value of $_USER['uid'] when a user is not logged in ? although I use an echo to type it, this echo does nothing...
the main problem is that this piece of code works only when it is not shown as a centerblock (as a simple static page) and always with the problem of my first question
if there is another way to do all this i would be curious to know
thx
Text Formatted Code
?><?php if ($_USER['uid']>=2) {echo $_USER['uid']; echo '<a href="/usersettings.php?mode=edit">';} else {echo $_USER['uid']; echo '<a href="/users.php?mode=new">';}?>press here</a>what I want to do is to check if the current user is a member or not and create the appropriate link for him , ie if its a member to create a link to edit his/her profile and if its a guest to create a link to go to the registration page
the page is centerblock and it is at the top of the page - homepage only - not wrapped in a block
my first question is, what is the value of $_USER['uid'] when a user is not logged in ? although I use an echo to type it, this echo does nothing...
the main problem is that this piece of code works only when it is not shown as a centerblock (as a simple static page) and always with the problem of my first question
if there is another way to do all this i would be curious to know
thx
11
12
Quote
sornok
Anonymous
right on top of the code i posted ?
16
13
Quote
All times are EST. The time is now 01:29 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content