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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:33:28+00:00 2026-05-31T19:33:28+00:00

GET is a convenient method to post the form id, post the website id

  • 0

GET is a convenient method to post the form id, post the website id or any id.
However, it is insecure because it leaks out the id to the visitors.

Are there any method that I can use that is similar to GET format that i need not to submit the form but i can retrieve the id easily at the same time?

sorry, i am so green at it. how to use a session ? if use get , i can define 
$get?id=aaa for each link,but how can i achieve it in session?

What i actually want to do:

In my case i want to develop several form , each one has a id on it, say formA , formB , formC ..

IF i use get i will define <form id="myform" method="get" action="verify.php?id="formA">
however, since it is insecure, how can i use session to do this?

*Ans: put the $_session[id]=’formid’ and get it in the same way.*

It is ok for a form , but…..

If i want to create a page that has a lot of links , how can i achieve using a session ?
how can i bind the session to the link? Thank you.

  • 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-31T19:33:30+00:00Added an answer on May 31, 2026 at 7:33 pm

    The GET method put the data in the URL(so that why you see them).
    The POST method put the data in the request body, so is not diplsayed in the adress bar.
    However you can easyly find out the content of the request body with browser module.

    The GET and POST method are equally secure in this way.
    However like Alex said you could use the php session but are only usefull for data that the user won’t change.

    In your case, if you identified the user with and id, you just have to fill the $_SESSION[‘userid’] (the variable name is arbitrary), then when the user will submit the for you will retreive the user id from the session.

    Edit:
    For your url:

    http://mydomain.com?serviceid=1 call your service number one
    

    You can set a token system, which mean for the current user you give him a hash that seems random and allow him to execute the service.
    Your can put this token generation at the begining of your script:

    session_start(); // To start php session
    // We check if the current user has a token
    if ( isset($_SESSION['usertoken'] ) )
    {
       $token = md5( 'myubbersalt' . md5(time)  ); // The token is a random string (not to random there)
       $_SESSION['usertoken'] = $token; // The server now have set an action token for the user
    }
    

    Then when you will generate your page (with link to service), you add the token in the url, like this:

    echo 'http://mydomain.com?serviceid=1&tok=' . $_SESSION['usertoken'];
    

    Finally when the http://mydomain.com?serviceid=1 is called you check the token internally:

    session_start(); // This should be added at the begining of your script
    ...
    // We check if the usertoken match the service token
    $canExecuteService = false;
    if ( isset( $_GET['tok'] && isset($_SESSION['usertoken']) )
    {
       if ( $_GET['tok'] == $_SESSION['usertoken'] )
       {
          $canExecuteService = true;
       }
    }
    

    So you have a variable telling you if you can execute or not the service.
    The token livelenght is the same as the php session. Plus 2 distinct user can’t have the same token (in this simple generation two user can share the same token if they execute the page at the exact same time). Plus an attacker can’t forge a token, because this one is generated from a variable source and is salted with a salt only knew by your website.

    Regards

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

Sidebar

Related Questions

I like the convenient output form method {{ form.as_ul }} but is there a
The Scanner class provides a convenient method to skip over whitespace and get complete
is there a convenient way to bypass the private visibility ( edit: that is,
Using urllib2, are we able to use a method other than 'GET' or 'POST'
i get a valid fd object from a caller. How can i find out
how to get a value of a (hidden) column, from the selected row. that
I noticed that in Android API Level 11 (ICS) MotionEvent has a transform method
So I have a helper method that looks something like the following: private D
How do you ensure that you don't get a Call to a member function
I have a django form that first validates its data through calling form.is_valid(). If

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.