Gossamer Forum
Quote Reply
Username on Main page
Not sure if this is where I ask the question, but is there a way after a user logs in, to put on the main page something like this


Welcome, Guest <------if they are not logged in
Welcome, Tazmear <------- but there name when they loggin

Im using links SQL 2.




Thanks
www.sagnetwork.com - Internet Portal
Quote Reply
Re: [tazmear] Username on Main page In reply to
Hi Tazmear,

You can post on the Glinks forum which includes linksql2 too.

Something below should work

Code:
Welcome, <%if Username%><%Username%><%else%>Guest<%endif%>

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Username on Main page In reply to
this is what I did on the home.html page

Welcome, <%if Username%><%Username%><%else%>Guest
<font size="2">
<form action="<%db_cgi_url%>/user.cgi" method="POST">
<input type=hidden name=login value=1>
<%body_font%>
<%if url%>
<input type="hidden" name="url" value="<%url%>">
<%endif%>
<p>Sign in to <%site_title%>: </p>
<%if error%>
<p><%error_font%><b><%error%></b></font></p>
<%endif%>

<p>Username: <input name="Username" value="Username">
<br>Password: <input type=password name=Password>
<input type=submit value="Login"></p>
<p>Dont have a User ID<br>
Then <a href="<%db_cgi_url%>/user.cgi?signup_form=1">register</a> here</p>
<p>Forgotten <a href="<%db_cgi_url%>/user.cgi?email_pass=1">Username/Password</a>.</p>
</form><BR>
<form action="<%db_cgi_url%>/user.cgi" method="POST">
<input type="hidden" name="url" value="<%url%>">
<input type=hidden name=login value=1>
<%body_font%>
<%if url%>
</font>
</form><%endif%>

but after you loggin, it still shows Guest and the login is still on the page,

What im trying to do, is let them login from the index page, after they login it will welcome them on the index page and just have a logoff link.

do I have the script right for that?

Welcome, Guest
Sign in to Sitename:
Username:
Password:

Dont have a User ID Then regist here
Forgotten username/password


Then when they login it would just look like this

Welcome, Tazmear

Logoff <------a link to logoff

Thanks for your help
www.sagnetwork.com - Internet Portal

Last edited by:

tazmear: Jun 2, 2007, 10:23 AM
Quote Reply
Re: [tazmear] Username on Main page In reply to
Hi,

It seems that you are on the static page. If that is the case, it is impossible unless you use SSI for that portion and your link sql is setting to use cookies and your browser is enabled to accept cookies.

If you are on the page.cgi, that should work unless there is other error.
You can PM me the url so that I can take a look if it is still not worked

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog