can anyone give me the scripts on how to hide some context until a user is register. i want to hide a few pages. thanks!
Hide context until user is register
Page 1 of 19 Replies - 732 Views - Last Post: 11 April 2009 - 11:38 AM
Replies To: Hide context until user is register
#2
Re: Hide context until user is register
Posted 11 April 2009 - 10:39 AM
Is this what you are wanting?
if(isset($_SESSION['username']))
{
//Show content for users logged in
} else {
//Show content for users not logged in
}
#3
Re: Hide context until user is register
Posted 11 April 2009 - 10:49 AM
yes! i believe that it is, is that the actually code for it? if so where do i insert that at?
#4
Re: Hide context until user is register
Posted 11 April 2009 - 10:51 AM
We're not going to do it all for you dangmnx 
[rules][/rules]
[rules][/rules]
#5
Re: Hide context until user is register
Posted 11 April 2009 - 10:55 AM
Think outside the box for a minute...
Where would you put it if you are wanting to keep people who are not logged in from seeing it?
BIG HINT: Before it's put on the screen.
There is probably a better way but this is definitely a start.
Where would you put it if you are wanting to keep people who are not logged in from seeing it?
BIG HINT: Before it's put on the screen.
There is probably a better way but this is definitely a start.
#6
Re: Hide context until user is register
Posted 11 April 2009 - 10:58 AM
That is the whole point, i don't know where to start with this code and that's why i am seeking for help here.
i have already have everything ready i need, i just need the code on how to hide a certain context in my menu which is called "Upload" because i don't want non-register users to be able to upload. the code i have for that will be located in my menu.php but it is also in every other page.
i have already have everything ready i need, i just need the code on how to hide a certain context in my menu which is called "Upload" because i don't want non-register users to be able to upload. the code i have for that will be located in my menu.php but it is also in every other page.
<style>
A:visited {color: #000000; text-decoration: underline}
A:link {color: #000000; text-decoration: underline}
A:active {color: #000000; text-decoration: underline}
A:hover {color: #000000; text-decoration: none}
</style>
<ul id="cssdropdown">
<li class="mainitems">
<a href="index.php">Home</a>
</li>
<li class="mainitems">
<a href="#">League</a>
<ul class="subuls" style="width: 12em">
<li><img border="0" src="http://www.dangmn.net/hp/images/menuarrow.gif" /><a href="enter.php">ENTER 1v1 Ladder</a></li><br/><br/>
</ul>
</li>
[size=3]
This is the url i want to hide until user are register.[/size][u]
[b]<li class="mainitems">
<a href="report.php">Reporting</a>
<ul class="subuls" style="width: 13em">
<li><img border="0" src="http://www.dangmn.net/hp/images/menuarrow.gif" /><a href="report.php">Report 1v1 Ladder</a></li><br/><br/>
</ul>
</li>[/b]
<li class="mainitems">
<a href="#">Forums</a>
<ul class="subuls" style="width: 13em">
<li><img border="0" src="http://www.dangmn.net/hp/images/menuarrow.gif" /><a href="#">Members Login</a></li><br/><br/>
<li><img border="0" src="http://www.dangmn.net/hp/images/menuarrow.gif" /><a href="#">Sign up & Register</a></li><br/><br/>
</ul>
</li>
<li class="mainitems">
<a href="#">Maps</a>
<ul class="subuls" style="width: 12em">
<li><img border="0" src="http://www.dangmn.net/hp/images/menuarrow.gif" /><a href="#">Season 1 Map</a></li><br/><br/>
</ul>
</li>
<li class="mainitems">
<a href="#">Media</a>
<ul class="subuls" style="width: 9em">
<li><img border="0" src="http://www.dangmn.net/hp/images/menuarrow.gif" /><a href="#">Replays</a></li><br/><br/>
<li><img border="0" src="http://www.dangmn.net/hp/images/menuarrow.gif" /><a href="#">ScreenShots</a></li><br/><br/>
</ul>
</li>
<li class="mainitems">
<a href="#">TGL Support</a>
<ul class="subuls" style="width: 8em">
<li><img border="0" src="http://www.dangmn.net/hp/images/menuarrow.gif" /><a href="#">Admin</a></li><br/><br/>
<li><img border="0" src="http://www.dangmn.net/hp/images/menuarrow.gif" /><a href="#">F.A.Q's</a></li><br/><br/>
</ul>
</li>
</ul>
<div id="restofcontent">
<br />
</div>
#7
Re: Hide context until user is register
Posted 11 April 2009 - 11:03 AM
Fairly easy, you answerd your own question... you'd put it right there.
#8
Re: Hide context until user is register
Posted 11 April 2009 - 11:04 AM
okay, so here is what i tired,
and i get an error that says
Parse error: syntax error, unexpected '<' in /home/dangmnne/public_html/hp/menu.php on line 29
<?php
if(isset($_SESSION['username']))
{
//Show content for users logged in
} else {
//Show content for users not logged in
}
<li class="mainitems">
<a href="report.php">Reporting</a>
<ul class="subuls" style="width: 13em">
<li><img border="0" src="http://www.dangmn.net/hp/images/menuarrow.gif" /><a href="report.php">Report 1v1 Ladder</a></li><br/><br/>
</ul>
</li>
?>
and i get an error that says
Parse error: syntax error, unexpected '<' in /home/dangmnne/public_html/hp/menu.php on line 29
#9
Re: Hide context until user is register
Posted 11 April 2009 - 11:14 AM
<?php
if(isset($_SESSION['username']))
{
//Show content for users logged in
?>
<li class="mainitems">
<a href="report.php">Reporting</a>
<ul class="subuls" style="width: 13em">
<li><img border="0" src="http://www.dangmn.net/hp/images/menuarrow.gif" /><a href="report.php">Report 1v1 Ladder</a></li><br/><br/>
</ul>
</li>
<?php } else {
//Show content for users not logged in
//In this situation, you really have no need for an 'else'
?>
<?php
}
?>
#10
Re: Hide context until user is register
Posted 11 April 2009 - 11:38 AM
Thank you very much
it works now, i'll let you know if i have any other issues. thanks again!
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|