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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:49:43+00:00 2026-05-30T18:49:43+00:00

store value of input type=hidden into a php variable. The value is set by

  • 0

store value of input type=”hidden” into a php variable.

The value is set by javascript into a hidden variable[input].

Now i need to save its value into a $myphpvariable.

I cant set the value into session with javascript and cookies is not an option.

  • 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-30T18:49:44+00:00Added an answer on May 30, 2026 at 6:49 pm

    After the page is submitted, hidden input elements will show up in the $_POST superglobal, just like any other form element. If the hidden form field were called coolsecret then the value would be in $_POST['coolsecret'] (or $_GET['coolsecret'] if you used method=get).

    Before the page is submitted, there’s no way to get a value from javascript into PHP, because your PHP code is all executed on the server, and the javascript isn’t executed until the user has loaded the page on their computer. You should think about what you’re trying to accomplish, and whether there’s any way to compute the variable you want in PHP instead. If it’s absolutely impossible to compute the variable ahead of time, then like Another Code said, you’ll need to use something like an AJAX request.

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

Sidebar

Related Questions

I'm defining an iterator type that does not store its current value explicitly. Instead,
I need to create a hidden field on my page, store some value in
I have following code: <input type=hidden name=qz_id value=<?=$quizid; ?> /> <input type=hidden name=s_id value=<?=$s_id;
I have 2 forms <form name= form1 action=> <input type=hidden name=max id= max1 value=100/>
I have this form: <tr> <td><input type=hidden name=ledlamps value=LED lamps>LED lamps:</td> <td><input class=field checkbox
I've learned how to store a single input of data and return a value
how to store a value returned from a sql query in a variable in
What column type in Oracle 10g can be used to store any value of
I'm designing a Java based web-app and I need a key-value store. Berkeley DB
How to store Json string in a hidden input field. Well, I could do

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.