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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:15:40+00:00 2026-06-04T20:15:40+00:00

I have a variable that I’m calling in php and showing in a input

  • 0

I have a variable that I’m calling in php and showing in a input field for the user by default, to make some calculations, but the user can change the value. I’m using javascript to get the value, but it doesnt update. Its value always keeps the default value.

  • 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-06-04T20:15:41+00:00Added an answer on June 4, 2026 at 8:15 pm

    Um… several things here…

    Firstly, we don’t have any code. So we have no idea what you’re trying to do.

    So I’m going to assume you’re talking about some sort of global variable (if you just declare $foo = 10 somewhere in your script you won’t be able to get it; the script is done parsing by the time the page is outputted).

    So let’s say you have $_COOKIE['some_value'] as the variable you want to change. The idea is you make an ajax call to some php file that will update it. So you might have

    //change_value.php
    
    setcookie($_GET['cookie_name'], $_GET['new_value']);
    

    And you could make an ajax call using a library (jQuery here)

    $.ajax({
      url: 'change_value.php',
      data: 'cookie_name=bar&new_value=' + new_value //new value is a variable in javascript,
      success: function(data) {
        alert("Success");
      }
    });
    

    You can read more about ajax with jQuery here http://api.jquery.com/jQuery.ajax/

    The example above also takes back any return data outputted by change_value.php. So you could update change_value.php to change the value if specified, then output the (new) value regardless (so you could grab it).

    Of course, with cookies you could do that directly with javascript, but that’s just an example. If you had sessions the same approach could be used.

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

Sidebar

Related Questions

I have a variable that im define with another variable and some text. $title
I have PHP variable that contains string like: http://domain.com/uploads/image1.jpg|||http://domain.com/uploads/image2.jpg|||http://domain.com/uploads/image3.jpg|||... I need to get first
I have variable that store data datetime UTC from database. I want to make
I have a variable that a user specifies $start_date in format of y-m-d .
I have a PHP variable that looks a bit like this: $id = 01922312;
I have a PHP variable that looks a bit like this: $id = 01922312;
I have a variable that contains some text, some html, basically can be a
How can I determine using PHP code that, for example, I have a variable
I have a variable that stores false or true , but I need 0
If I have a variable that contains PHP code... something like this: $PageCode =

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.