Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#829051
Hi
I want to set a variable just by php (trigger is placed before form) in ajax mode, and see the affect in the form after running the ajax has run (I don't want to use js to set the variable! ).
Here is the sample:
Code: Select all
// JS Code:
$.ajax({
  type: "POST",
  url: window.location,
  dataType: "json",
  data: { action: 'variable' },
  async: false,
  success: function (jsn_data){},
  error: function(xhr, status, error) {}
});
Code: Select all
// PHP Code (trigger):
if (isset($_POST['action']) && $_POST['action'] == 'variable') {
	@@textVar = 4;
	die(json_encode(['result'=>$this]));
}
What should I do?
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]