Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6321401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:08:33+00:00 2026-05-24T16:08:33+00:00

<?php //display the bid button if a user is logged in if (isset($_SESSION[‘username’])) {

  • 0
<?php
//display the bid button if a user is logged in
if (isset($_SESSION['username'])) {
?>
    <form class='bidForm' action='bid.php?id=<?php echo $item_id; ?>' method='POST'>
        <input class='bid' type='submit' value='BID' />
    </form>
<?php
} else {

}
?>

I am making a auction site where if the user bids on an item, the expiration time for the auction item increases by a certain amount. I have set up a bid button for each item that is currently active on the auction and I have to make it so the bid button is only visible (at least the working one – changes to a login button when hovered over while no user is logged in) to logged in users. And as you can see, I have used a isset(SESSION) if else statement above at the moment. I also have the div that contains the active auction items constantly getting refreshed every second through jQuery so that the countdown is being refreshed every second. (it’s an auction type where when users bid when the timer is below 20 seconds, the timer gets reset to 20 seconds)

The problem is, for some reason the jQuery refreshing actually cancels out the session for some reason (at least in the part where it is getting refreshed) and the bid button disappears after the first second. I can’t create an else statement saying that if the session was not set, to now set it because then non-logged in users could see the bid button as well. And I can’t create some url variable to refer through GET because then non-logged in users could manipulate that to make the bid button visible for them. And finally, I can’t use javascript or prefer not to as I don’t want the bidding function to be unavailable for people who have javascript turned off.

What are my options?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:08:34+00:00Added an answer on May 24, 2026 at 4:08 pm

    Are you sure you did session_start() in this specific page as well?

    Else you cannot access $_SESSION. Could be this.

    /David

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a page called display.php and the user is viewing display.php?page=3
I use php to display a table of data drawn from my mysql database.
I'm trying to understand this bit of code: in display.php: <html> ... <body> <table>
I have the following javascript: $('#ge-display').click(function (event) { window.open('/googleearth/ge-display.php','','scrollbars=yes,menubar=no,height=650,width=1000,resizable=yes,toolbar=yes,location=no,status=no'); event.stopPropagation(); return false; }); the
I don't want PHP errors to display /html, but I want them to display
I want a php page to 'display' a pdf. Here is the code: <?php
<?php ini_set('display_errors',1); error_reporting(E_ALL); require_once('/include/adLDAP.php'); $adldap = new adLDAP(); $username = user123; $password = pass123;
I'm working on Ubuntu.(Linux) I want to display all .php pages to .html in
Trying to display current time with PHP (using this ): $date = date('m/d/Y h:i:s
Im using this PHP to display the contents or text files held in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.