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

  • SEARCH
  • Home
  • 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 706345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:09:20+00:00 2026-05-14T04:09:20+00:00

Sorry for the unclear title, an example will clear things up: TABLE: Scenario_victories ID

  • 0

Sorry for the unclear title, an example will clear things up:

TABLE: Scenario_victories

ID  scenid        timestamp      userid side    playdate
1   RtBr001   2010-03-15 17:13:36   7     1     2010-03-10
2   RtBr001   2010-03-15 17:13:36   7     1     2010-03-10
3   RtBr001   2010-03-15 17:13:51   7     2     2010-03-10

ID and timestamp are auto-insertions by the database when the other 4 fields are added.

The first thing to note is that a user can record multiple playings of the same scenario (scenid) on the same date (playdate) possibly with the same outcome (side = winner). Hence the need for the unique ID and timestamps for good measure.

Now, on their user page, I’m displaying their recorded play history in a <select><option>... list form with 2 buttons at the end – Delete Record and Go to Scenario

My script takes the scenid and after hitting a few other tables returns with something more user-friendly like:

  (playdate)   (from scenid)        (from side)
#########################################################
# 2010-03-10  Road to Berlin #1 -- Germany, Hungary won #
# 2010-03-10  Road to Berlin #1 -- Germany, Hungary won #
# 2010-03-10  Road to Berlin #1 -- Soviet Union won     #
#########################################################
     [Delete Record]              [Go To Scenario]

in HTML:

<select name="history" size=3>
  <option>2010-03-10  Road to Berlin #1 -- Germany, Hungary won</option>
  <option>2010-03-10  Road to Berlin #1 -- Germany, Hungary won</option>
  <option>2010-03-10  Road to Berlin #1 -- Soviet Union won</option>
</select>

Now, if you were to highlight the first record and click Go to Scenario there is enough information there for me to parse it and produce the exact scenario you want to see. However, if you were to select Delete Record there is not – I have the playdate and I can parse the scenid and side from what’s listed, but in this example all three records would have the same result.

I appear to have painted myself into a corner. Does anyone have a suggestion as to how I can get some unique identifying data (ID and/or timestamp) to ride along on this form without showing it to the user?

PHP-only please, I must be NoScript compliant!

  • 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-14T04:09:21+00:00Added an answer on May 14, 2026 at 4:09 am

    You can set a value attribute on your options, and make it contain the ID (which is unique) of your data :

    <select name="history" size=3>
      <option value="1">2010-03-10  Road to Berlin #1 -- Germany, Hungary won</option>
      <option value="2">2010-03-10  Road to Berlin #1 -- Germany, Hungary won</option>
      <option value="3">2010-03-10  Road to Berlin #1 -- Soviet Union won</option>
    </select>
    

    Then, when receiving the data that’s been posted, $_POST['history'] will contain the ID that correspond to the entry choosen by the user.

    And, as this ID is unique, you can use to identify, without any doubt, your data.

    The content of the value attribute, when set, is passed to the server when the form is submitted — it’s not displayed to the user.

    When no value is set for an option, the browser will pass the content of that option to the server, when the form is submitted — which is what you were getting.

    As a sidenote : as with everything submitted from a user, you must check that the value received for $_POST['history'] is valid, safe, and all that — it should be an integer, it should be one one the values the user can access, …

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

Sidebar

Related Questions

Sorry if the title is unclear - not sure how to phrase it. Feel
I am sorry if the title is unclear. Allow me to elaborate further. Firstly,
I'm sorry if my title is a little unclear. Basically I want to print
Sorry the title isn't more help. I have a database of media-file URLs that
Sorry if the title is poorly descriptive, but I can't do better right now
Sorry for the long question title. I guess I'm on to a loser on
Sorry for an unclear question previously; hopefully I can start again... I have this
Sorry For being unclear, what I mean is this. Currently on page load I
Sorry for the basic question - I'm a .NET developer and don't have much
Sorry for this not being a real question, but Sometime back i remember seeing

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.