How to retrieve all but Renew Account for a system admin

Multi tool use
Please, I'm new to PHP and I'm building a subscription-based ecommerce site. I've been able to customize the pages such that they look different based on who's browsing what, but I'd like to take the Renew Account off the admin page since they don't have to subscribe.
I've been struggling all day. Please, could someone show me how it could be achieved?
Below is the snippet:
<?php // Show the user info or the login form:
if (isset($_SESSION['user_id']))
// Show basic user options:
echo '<div class="title">
<h4>Manage Your Account</h4>
</div>
<ul>
<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>
<li><a href="change_password.php" title="Change Your Password">Change Password</a></li>
<li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li>
<li><a href="history.php" title="View Your History">History</a></li>
<li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li>
<li><a href="logout.php" title="Logout">Logout</a></li>
</ul>
';
// Show admin options, if appropriate:
if (isset($_SESSION['user_admin']))
echo '<div class="title">
<h4>Administration</h4>
</div>
<ul>
<li><a href="add_page.php" title="Add a Page">Add Page</a></li>
<li><a href="add_pdf.php" title="Add a PDF">Add PDF</a></li>
<li><a href="#" title="Blah">Blah</a></li>
</ul>
';
else // Show the login form:
require ('login_form.inc.php');
?>
php session
|
show 6 more comments
Please, I'm new to PHP and I'm building a subscription-based ecommerce site. I've been able to customize the pages such that they look different based on who's browsing what, but I'd like to take the Renew Account off the admin page since they don't have to subscribe.
I've been struggling all day. Please, could someone show me how it could be achieved?
Below is the snippet:
<?php // Show the user info or the login form:
if (isset($_SESSION['user_id']))
// Show basic user options:
echo '<div class="title">
<h4>Manage Your Account</h4>
</div>
<ul>
<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>
<li><a href="change_password.php" title="Change Your Password">Change Password</a></li>
<li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li>
<li><a href="history.php" title="View Your History">History</a></li>
<li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li>
<li><a href="logout.php" title="Logout">Logout</a></li>
</ul>
';
// Show admin options, if appropriate:
if (isset($_SESSION['user_admin']))
echo '<div class="title">
<h4>Administration</h4>
</div>
<ul>
<li><a href="add_page.php" title="Add a Page">Add Page</a></li>
<li><a href="add_pdf.php" title="Add a PDF">Add PDF</a></li>
<li><a href="#" title="Blah">Blah</a></li>
</ul>
';
else // Show the login form:
require ('login_form.inc.php');
?>
php session
What is the question? I don't understand what you're asking. What isn't working the way you would like it to?
– Funk Forty Niner
Nov 15 '18 at 21:24
I don't want the Renew Account to show under the admin side
– jesse brite
Nov 15 '18 at 21:26
See the answer given below.
– Funk Forty Niner
Nov 15 '18 at 21:26
What is the status of the question? Given the answer; does it work or not?
– Funk Forty Niner
Nov 15 '18 at 21:37
It doesn't work. Could there be another way?
– jesse brite
Nov 15 '18 at 21:44
|
show 6 more comments
Please, I'm new to PHP and I'm building a subscription-based ecommerce site. I've been able to customize the pages such that they look different based on who's browsing what, but I'd like to take the Renew Account off the admin page since they don't have to subscribe.
I've been struggling all day. Please, could someone show me how it could be achieved?
Below is the snippet:
<?php // Show the user info or the login form:
if (isset($_SESSION['user_id']))
// Show basic user options:
echo '<div class="title">
<h4>Manage Your Account</h4>
</div>
<ul>
<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>
<li><a href="change_password.php" title="Change Your Password">Change Password</a></li>
<li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li>
<li><a href="history.php" title="View Your History">History</a></li>
<li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li>
<li><a href="logout.php" title="Logout">Logout</a></li>
</ul>
';
// Show admin options, if appropriate:
if (isset($_SESSION['user_admin']))
echo '<div class="title">
<h4>Administration</h4>
</div>
<ul>
<li><a href="add_page.php" title="Add a Page">Add Page</a></li>
<li><a href="add_pdf.php" title="Add a PDF">Add PDF</a></li>
<li><a href="#" title="Blah">Blah</a></li>
</ul>
';
else // Show the login form:
require ('login_form.inc.php');
?>
php session
Please, I'm new to PHP and I'm building a subscription-based ecommerce site. I've been able to customize the pages such that they look different based on who's browsing what, but I'd like to take the Renew Account off the admin page since they don't have to subscribe.
I've been struggling all day. Please, could someone show me how it could be achieved?
Below is the snippet:
<?php // Show the user info or the login form:
if (isset($_SESSION['user_id']))
// Show basic user options:
echo '<div class="title">
<h4>Manage Your Account</h4>
</div>
<ul>
<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>
<li><a href="change_password.php" title="Change Your Password">Change Password</a></li>
<li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li>
<li><a href="history.php" title="View Your History">History</a></li>
<li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li>
<li><a href="logout.php" title="Logout">Logout</a></li>
</ul>
';
// Show admin options, if appropriate:
if (isset($_SESSION['user_admin']))
echo '<div class="title">
<h4>Administration</h4>
</div>
<ul>
<li><a href="add_page.php" title="Add a Page">Add Page</a></li>
<li><a href="add_pdf.php" title="Add a PDF">Add PDF</a></li>
<li><a href="#" title="Blah">Blah</a></li>
</ul>
';
else // Show the login form:
require ('login_form.inc.php');
?>
php session
php session
edited Nov 15 '18 at 22:16


Funk Forty Niner
1
1
asked Nov 15 '18 at 21:20
jesse britejesse brite
115
115
What is the question? I don't understand what you're asking. What isn't working the way you would like it to?
– Funk Forty Niner
Nov 15 '18 at 21:24
I don't want the Renew Account to show under the admin side
– jesse brite
Nov 15 '18 at 21:26
See the answer given below.
– Funk Forty Niner
Nov 15 '18 at 21:26
What is the status of the question? Given the answer; does it work or not?
– Funk Forty Niner
Nov 15 '18 at 21:37
It doesn't work. Could there be another way?
– jesse brite
Nov 15 '18 at 21:44
|
show 6 more comments
What is the question? I don't understand what you're asking. What isn't working the way you would like it to?
– Funk Forty Niner
Nov 15 '18 at 21:24
I don't want the Renew Account to show under the admin side
– jesse brite
Nov 15 '18 at 21:26
See the answer given below.
– Funk Forty Niner
Nov 15 '18 at 21:26
What is the status of the question? Given the answer; does it work or not?
– Funk Forty Niner
Nov 15 '18 at 21:37
It doesn't work. Could there be another way?
– jesse brite
Nov 15 '18 at 21:44
What is the question? I don't understand what you're asking. What isn't working the way you would like it to?
– Funk Forty Niner
Nov 15 '18 at 21:24
What is the question? I don't understand what you're asking. What isn't working the way you would like it to?
– Funk Forty Niner
Nov 15 '18 at 21:24
I don't want the Renew Account to show under the admin side
– jesse brite
Nov 15 '18 at 21:26
I don't want the Renew Account to show under the admin side
– jesse brite
Nov 15 '18 at 21:26
See the answer given below.
– Funk Forty Niner
Nov 15 '18 at 21:26
See the answer given below.
– Funk Forty Niner
Nov 15 '18 at 21:26
What is the status of the question? Given the answer; does it work or not?
– Funk Forty Niner
Nov 15 '18 at 21:37
What is the status of the question? Given the answer; does it work or not?
– Funk Forty Niner
Nov 15 '18 at 21:37
It doesn't work. Could there be another way?
– jesse brite
Nov 15 '18 at 21:44
It doesn't work. Could there be another way?
– jesse brite
Nov 15 '18 at 21:44
|
show 6 more comments
2 Answers
2
active
oldest
votes
What you could do is to first check if the user admin session is set, to which I added the same conditional value for in the first conditional statement.
If it is set, then assign an empty value for what I named as $renew
, with an else
with the value that I removed from your existing <li></li>
.
The first two session arrays here are only representational values of course.
I concatenated the '.$renew.'
variable in the menu.
Note: Make sure that the session was started using session_start()
inside all pages using sessions; that is not known.
$_SESSION['user_id'] = 123;
$_SESSION['user_admin'] = "john";
if (isset($_SESSION['user_admin']))
$renew = '';
else
$renew = '<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>';
if (isset($_SESSION['user_id']))
// Show basic user options:
echo '<div class="title">
<h4>Manage Your Account</h4>
</div>
<ul>
'.$renew.'
<li><a href="change_password.php" title="Change Your Password">Change Password</a></li>
<li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li>
<li><a href="history.php" title="View Your History">History</a></li>
<li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li>
<li><a href="logout.php" title="Logout">Logout</a></li>
</ul>
';
// Show admin options, if appropriate:
if (isset($_SESSION['user_admin']))
echo '<div class="title">
<h4>Administration</h4>
</div>
<ul>
<li><a href="add_page.php" title="Add a Page">Add Page</a></li>
<li><a href="add_pdf.php" title="Add a PDF">Add PDF</a></li>
<li><a href="#" title="Blah">Blah</a></li>
</ul>
';
It seems not to work. I The Renew Account doesn't show, but I keep seeing the same log admin content as though I haven't logged out. I don't know what could possibly be the cause. PS I have session_start () in all pages that require session
– jesse brite
Nov 15 '18 at 22:43
@jessebrite What I posted worked for me. Make sure that caching isn't an issue here and/or that the previous session doesn't still exist and needs to be destroyed and a logout method does use the function to destroy it.
– Funk Forty Niner
Nov 15 '18 at 22:46
@FunkyFortNiner I finally got it to work! I removed the two session variables as seen in your code since they'll be coming from other pages. Your code is a life saver. Thanks@ColbyBoren as well. You guys are awesome
– jesse brite
Nov 15 '18 at 22:49
@jessebrite That's great to hear Jesse, glad to hear it. You can accept the answer in order to mark your question as solved if you want. You're under no obligation to do this, but it does inform everyone that the question was solved including the system itself. Welcome to Stack Overflow.
– Funk Forty Niner
Nov 15 '18 at 22:51
@FunkyFortyNiner How's it done? Is it different from upvoting?
– jesse brite
Nov 15 '18 at 22:58
|
show 3 more comments
Try..
If(!isset($_SESSION['user_admin'])) echo '<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>';
This way if it the session variable for admin is set the echo won't occur.
$_SESSSION
isn't valid. Edit: This as per the original answer stackoverflow.com/revisions/53328105/1
– Funk Forty Niner
Nov 15 '18 at 21:45
Yeah I fixed it. Thanks
– Colby Boren
Nov 15 '18 at 21:47
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328051%2fhow-to-retrieve-all-but-renew-account-for-a-system-admin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
What you could do is to first check if the user admin session is set, to which I added the same conditional value for in the first conditional statement.
If it is set, then assign an empty value for what I named as $renew
, with an else
with the value that I removed from your existing <li></li>
.
The first two session arrays here are only representational values of course.
I concatenated the '.$renew.'
variable in the menu.
Note: Make sure that the session was started using session_start()
inside all pages using sessions; that is not known.
$_SESSION['user_id'] = 123;
$_SESSION['user_admin'] = "john";
if (isset($_SESSION['user_admin']))
$renew = '';
else
$renew = '<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>';
if (isset($_SESSION['user_id']))
// Show basic user options:
echo '<div class="title">
<h4>Manage Your Account</h4>
</div>
<ul>
'.$renew.'
<li><a href="change_password.php" title="Change Your Password">Change Password</a></li>
<li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li>
<li><a href="history.php" title="View Your History">History</a></li>
<li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li>
<li><a href="logout.php" title="Logout">Logout</a></li>
</ul>
';
// Show admin options, if appropriate:
if (isset($_SESSION['user_admin']))
echo '<div class="title">
<h4>Administration</h4>
</div>
<ul>
<li><a href="add_page.php" title="Add a Page">Add Page</a></li>
<li><a href="add_pdf.php" title="Add a PDF">Add PDF</a></li>
<li><a href="#" title="Blah">Blah</a></li>
</ul>
';
It seems not to work. I The Renew Account doesn't show, but I keep seeing the same log admin content as though I haven't logged out. I don't know what could possibly be the cause. PS I have session_start () in all pages that require session
– jesse brite
Nov 15 '18 at 22:43
@jessebrite What I posted worked for me. Make sure that caching isn't an issue here and/or that the previous session doesn't still exist and needs to be destroyed and a logout method does use the function to destroy it.
– Funk Forty Niner
Nov 15 '18 at 22:46
@FunkyFortNiner I finally got it to work! I removed the two session variables as seen in your code since they'll be coming from other pages. Your code is a life saver. Thanks@ColbyBoren as well. You guys are awesome
– jesse brite
Nov 15 '18 at 22:49
@jessebrite That's great to hear Jesse, glad to hear it. You can accept the answer in order to mark your question as solved if you want. You're under no obligation to do this, but it does inform everyone that the question was solved including the system itself. Welcome to Stack Overflow.
– Funk Forty Niner
Nov 15 '18 at 22:51
@FunkyFortyNiner How's it done? Is it different from upvoting?
– jesse brite
Nov 15 '18 at 22:58
|
show 3 more comments
What you could do is to first check if the user admin session is set, to which I added the same conditional value for in the first conditional statement.
If it is set, then assign an empty value for what I named as $renew
, with an else
with the value that I removed from your existing <li></li>
.
The first two session arrays here are only representational values of course.
I concatenated the '.$renew.'
variable in the menu.
Note: Make sure that the session was started using session_start()
inside all pages using sessions; that is not known.
$_SESSION['user_id'] = 123;
$_SESSION['user_admin'] = "john";
if (isset($_SESSION['user_admin']))
$renew = '';
else
$renew = '<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>';
if (isset($_SESSION['user_id']))
// Show basic user options:
echo '<div class="title">
<h4>Manage Your Account</h4>
</div>
<ul>
'.$renew.'
<li><a href="change_password.php" title="Change Your Password">Change Password</a></li>
<li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li>
<li><a href="history.php" title="View Your History">History</a></li>
<li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li>
<li><a href="logout.php" title="Logout">Logout</a></li>
</ul>
';
// Show admin options, if appropriate:
if (isset($_SESSION['user_admin']))
echo '<div class="title">
<h4>Administration</h4>
</div>
<ul>
<li><a href="add_page.php" title="Add a Page">Add Page</a></li>
<li><a href="add_pdf.php" title="Add a PDF">Add PDF</a></li>
<li><a href="#" title="Blah">Blah</a></li>
</ul>
';
It seems not to work. I The Renew Account doesn't show, but I keep seeing the same log admin content as though I haven't logged out. I don't know what could possibly be the cause. PS I have session_start () in all pages that require session
– jesse brite
Nov 15 '18 at 22:43
@jessebrite What I posted worked for me. Make sure that caching isn't an issue here and/or that the previous session doesn't still exist and needs to be destroyed and a logout method does use the function to destroy it.
– Funk Forty Niner
Nov 15 '18 at 22:46
@FunkyFortNiner I finally got it to work! I removed the two session variables as seen in your code since they'll be coming from other pages. Your code is a life saver. Thanks@ColbyBoren as well. You guys are awesome
– jesse brite
Nov 15 '18 at 22:49
@jessebrite That's great to hear Jesse, glad to hear it. You can accept the answer in order to mark your question as solved if you want. You're under no obligation to do this, but it does inform everyone that the question was solved including the system itself. Welcome to Stack Overflow.
– Funk Forty Niner
Nov 15 '18 at 22:51
@FunkyFortyNiner How's it done? Is it different from upvoting?
– jesse brite
Nov 15 '18 at 22:58
|
show 3 more comments
What you could do is to first check if the user admin session is set, to which I added the same conditional value for in the first conditional statement.
If it is set, then assign an empty value for what I named as $renew
, with an else
with the value that I removed from your existing <li></li>
.
The first two session arrays here are only representational values of course.
I concatenated the '.$renew.'
variable in the menu.
Note: Make sure that the session was started using session_start()
inside all pages using sessions; that is not known.
$_SESSION['user_id'] = 123;
$_SESSION['user_admin'] = "john";
if (isset($_SESSION['user_admin']))
$renew = '';
else
$renew = '<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>';
if (isset($_SESSION['user_id']))
// Show basic user options:
echo '<div class="title">
<h4>Manage Your Account</h4>
</div>
<ul>
'.$renew.'
<li><a href="change_password.php" title="Change Your Password">Change Password</a></li>
<li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li>
<li><a href="history.php" title="View Your History">History</a></li>
<li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li>
<li><a href="logout.php" title="Logout">Logout</a></li>
</ul>
';
// Show admin options, if appropriate:
if (isset($_SESSION['user_admin']))
echo '<div class="title">
<h4>Administration</h4>
</div>
<ul>
<li><a href="add_page.php" title="Add a Page">Add Page</a></li>
<li><a href="add_pdf.php" title="Add a PDF">Add PDF</a></li>
<li><a href="#" title="Blah">Blah</a></li>
</ul>
';
What you could do is to first check if the user admin session is set, to which I added the same conditional value for in the first conditional statement.
If it is set, then assign an empty value for what I named as $renew
, with an else
with the value that I removed from your existing <li></li>
.
The first two session arrays here are only representational values of course.
I concatenated the '.$renew.'
variable in the menu.
Note: Make sure that the session was started using session_start()
inside all pages using sessions; that is not known.
$_SESSION['user_id'] = 123;
$_SESSION['user_admin'] = "john";
if (isset($_SESSION['user_admin']))
$renew = '';
else
$renew = '<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>';
if (isset($_SESSION['user_id']))
// Show basic user options:
echo '<div class="title">
<h4>Manage Your Account</h4>
</div>
<ul>
'.$renew.'
<li><a href="change_password.php" title="Change Your Password">Change Password</a></li>
<li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li>
<li><a href="history.php" title="View Your History">History</a></li>
<li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li>
<li><a href="logout.php" title="Logout">Logout</a></li>
</ul>
';
// Show admin options, if appropriate:
if (isset($_SESSION['user_admin']))
echo '<div class="title">
<h4>Administration</h4>
</div>
<ul>
<li><a href="add_page.php" title="Add a Page">Add Page</a></li>
<li><a href="add_pdf.php" title="Add a PDF">Add PDF</a></li>
<li><a href="#" title="Blah">Blah</a></li>
</ul>
';
answered Nov 15 '18 at 22:13


Funk Forty NinerFunk Forty Niner
1
1
It seems not to work. I The Renew Account doesn't show, but I keep seeing the same log admin content as though I haven't logged out. I don't know what could possibly be the cause. PS I have session_start () in all pages that require session
– jesse brite
Nov 15 '18 at 22:43
@jessebrite What I posted worked for me. Make sure that caching isn't an issue here and/or that the previous session doesn't still exist and needs to be destroyed and a logout method does use the function to destroy it.
– Funk Forty Niner
Nov 15 '18 at 22:46
@FunkyFortNiner I finally got it to work! I removed the two session variables as seen in your code since they'll be coming from other pages. Your code is a life saver. Thanks@ColbyBoren as well. You guys are awesome
– jesse brite
Nov 15 '18 at 22:49
@jessebrite That's great to hear Jesse, glad to hear it. You can accept the answer in order to mark your question as solved if you want. You're under no obligation to do this, but it does inform everyone that the question was solved including the system itself. Welcome to Stack Overflow.
– Funk Forty Niner
Nov 15 '18 at 22:51
@FunkyFortyNiner How's it done? Is it different from upvoting?
– jesse brite
Nov 15 '18 at 22:58
|
show 3 more comments
It seems not to work. I The Renew Account doesn't show, but I keep seeing the same log admin content as though I haven't logged out. I don't know what could possibly be the cause. PS I have session_start () in all pages that require session
– jesse brite
Nov 15 '18 at 22:43
@jessebrite What I posted worked for me. Make sure that caching isn't an issue here and/or that the previous session doesn't still exist and needs to be destroyed and a logout method does use the function to destroy it.
– Funk Forty Niner
Nov 15 '18 at 22:46
@FunkyFortNiner I finally got it to work! I removed the two session variables as seen in your code since they'll be coming from other pages. Your code is a life saver. Thanks@ColbyBoren as well. You guys are awesome
– jesse brite
Nov 15 '18 at 22:49
@jessebrite That's great to hear Jesse, glad to hear it. You can accept the answer in order to mark your question as solved if you want. You're under no obligation to do this, but it does inform everyone that the question was solved including the system itself. Welcome to Stack Overflow.
– Funk Forty Niner
Nov 15 '18 at 22:51
@FunkyFortyNiner How's it done? Is it different from upvoting?
– jesse brite
Nov 15 '18 at 22:58
It seems not to work. I The Renew Account doesn't show, but I keep seeing the same log admin content as though I haven't logged out. I don't know what could possibly be the cause. PS I have session_start () in all pages that require session
– jesse brite
Nov 15 '18 at 22:43
It seems not to work. I The Renew Account doesn't show, but I keep seeing the same log admin content as though I haven't logged out. I don't know what could possibly be the cause. PS I have session_start () in all pages that require session
– jesse brite
Nov 15 '18 at 22:43
@jessebrite What I posted worked for me. Make sure that caching isn't an issue here and/or that the previous session doesn't still exist and needs to be destroyed and a logout method does use the function to destroy it.
– Funk Forty Niner
Nov 15 '18 at 22:46
@jessebrite What I posted worked for me. Make sure that caching isn't an issue here and/or that the previous session doesn't still exist and needs to be destroyed and a logout method does use the function to destroy it.
– Funk Forty Niner
Nov 15 '18 at 22:46
@FunkyFortNiner I finally got it to work! I removed the two session variables as seen in your code since they'll be coming from other pages. Your code is a life saver. Thanks@ColbyBoren as well. You guys are awesome
– jesse brite
Nov 15 '18 at 22:49
@FunkyFortNiner I finally got it to work! I removed the two session variables as seen in your code since they'll be coming from other pages. Your code is a life saver. Thanks@ColbyBoren as well. You guys are awesome
– jesse brite
Nov 15 '18 at 22:49
@jessebrite That's great to hear Jesse, glad to hear it. You can accept the answer in order to mark your question as solved if you want. You're under no obligation to do this, but it does inform everyone that the question was solved including the system itself. Welcome to Stack Overflow.
– Funk Forty Niner
Nov 15 '18 at 22:51
@jessebrite That's great to hear Jesse, glad to hear it. You can accept the answer in order to mark your question as solved if you want. You're under no obligation to do this, but it does inform everyone that the question was solved including the system itself. Welcome to Stack Overflow.
– Funk Forty Niner
Nov 15 '18 at 22:51
@FunkyFortyNiner How's it done? Is it different from upvoting?
– jesse brite
Nov 15 '18 at 22:58
@FunkyFortyNiner How's it done? Is it different from upvoting?
– jesse brite
Nov 15 '18 at 22:58
|
show 3 more comments
Try..
If(!isset($_SESSION['user_admin'])) echo '<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>';
This way if it the session variable for admin is set the echo won't occur.
$_SESSSION
isn't valid. Edit: This as per the original answer stackoverflow.com/revisions/53328105/1
– Funk Forty Niner
Nov 15 '18 at 21:45
Yeah I fixed it. Thanks
– Colby Boren
Nov 15 '18 at 21:47
add a comment |
Try..
If(!isset($_SESSION['user_admin'])) echo '<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>';
This way if it the session variable for admin is set the echo won't occur.
$_SESSSION
isn't valid. Edit: This as per the original answer stackoverflow.com/revisions/53328105/1
– Funk Forty Niner
Nov 15 '18 at 21:45
Yeah I fixed it. Thanks
– Colby Boren
Nov 15 '18 at 21:47
add a comment |
Try..
If(!isset($_SESSION['user_admin'])) echo '<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>';
This way if it the session variable for admin is set the echo won't occur.
Try..
If(!isset($_SESSION['user_admin'])) echo '<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>';
This way if it the session variable for admin is set the echo won't occur.
edited Nov 15 '18 at 21:46
answered Nov 15 '18 at 21:24


Colby BorenColby Boren
16711
16711
$_SESSSION
isn't valid. Edit: This as per the original answer stackoverflow.com/revisions/53328105/1
– Funk Forty Niner
Nov 15 '18 at 21:45
Yeah I fixed it. Thanks
– Colby Boren
Nov 15 '18 at 21:47
add a comment |
$_SESSSION
isn't valid. Edit: This as per the original answer stackoverflow.com/revisions/53328105/1
– Funk Forty Niner
Nov 15 '18 at 21:45
Yeah I fixed it. Thanks
– Colby Boren
Nov 15 '18 at 21:47
$_SESSSION
isn't valid. Edit: This as per the original answer stackoverflow.com/revisions/53328105/1– Funk Forty Niner
Nov 15 '18 at 21:45
$_SESSSION
isn't valid. Edit: This as per the original answer stackoverflow.com/revisions/53328105/1– Funk Forty Niner
Nov 15 '18 at 21:45
Yeah I fixed it. Thanks
– Colby Boren
Nov 15 '18 at 21:47
Yeah I fixed it. Thanks
– Colby Boren
Nov 15 '18 at 21:47
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328051%2fhow-to-retrieve-all-but-renew-account-for-a-system-admin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
ozLEfXa3oviwLYIdysOyR02IsFe,atWDi6d9b7mP0zVU6tTkFwOWYr9la
What is the question? I don't understand what you're asking. What isn't working the way you would like it to?
– Funk Forty Niner
Nov 15 '18 at 21:24
I don't want the Renew Account to show under the admin side
– jesse brite
Nov 15 '18 at 21:26
See the answer given below.
– Funk Forty Niner
Nov 15 '18 at 21:26
What is the status of the question? Given the answer; does it work or not?
– Funk Forty Niner
Nov 15 '18 at 21:37
It doesn't work. Could there be another way?
– jesse brite
Nov 15 '18 at 21:44