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 222629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:08:43+00:00 2026-05-11T19:08:43+00:00

What is the best way to carry an auto incremented ID from one form

  • 0

What is the best way to carry an auto incremented ID from one form to another?

I have 3 tables (users, residences, and users_residences). I want a user to register, be added to the users table, be redirected to a form to create a residence which will add a row to the residence table and simultaneously add the the residence tabe row’s id and the users table row’s id to the users_residences table.

I have been playing around with uri segments but can’t think of a way to store (or call) the just added user’s ID for use in the second form.

I could probably use sessions to store an session id in the users table, then find the row ID from that, but it seems pretty hacky.

I am quite new to programming so feel free to tell me that I fail, but at least point me in the direction of where I can learn some of these concepts.

Thanks
Al

  • 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-11T19:08:43+00:00Added an answer on May 11, 2026 at 7:08 pm

    I’d say you are better off with the session key in the users table; it’s more secure (assuming you are doing this over https).

    Storing a value in a hidden field is easy to manipulate from a security perspective. If your fields use auto increment, It’s also easy to guess what the next one will be. A user could just pretend to be the next user registering and take that user’s info. You are also giving info about what other user’s ids are, how many users are registered for your site, etc.

    Also, unless you are planning on doing something ajaxy, I’m not sure there is much of a choice; the user would click submit, get redirected to another webpage while the save is happening, the only information that could be transmitted would be url you redirect them to or session. You could pass it in the url, but it would also have the above problems.

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

Sidebar

Related Questions

The best way to explain my problem is by a example. I have a
The best way of describing this is I have a table of people with
What is the best way to construct an #ask query using semantic properties from
In pursuit of finding the best way to have a date displayed on a
Best way to Handle Exceptions in C# Catch Block.I have no other choice but
The best way to explain this is with examples. Let's say I have the
Possible Duplicate: Best way to detect integer overflow in C/C++ If I have an
What is the best way to pass List via form in python (cgi). ListStr
Best way to match 2 pages for Google analytics. Pages to Query: 1.) this_google.html
The best way I think to explain this is to tell you what my

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.