• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

pass variable from js to php

Explorer ,
Nov 05, 2021 Nov 05, 2021

Copy link to clipboard

Copied

adobe animate build to files one html and one js.

how can i pass vaiiable from js to html or php?

Views

82

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2021 Nov 07, 2021

Copy link to clipboard

Copied

LATEST

var xmlhttp;

var domParser = new DOMParser();

//Parse the XML string into an XMLDocument object using
//the DOMParser.parseFromString() method.
//var xmlDocument = domParser.parseFromString(xmlString, "text/xml");
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}

xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
console.log("TEST15");
var xml_string = xmlhttp.responseText;
}
}


xmlhttp.open("GET", "abc.php?receive_1="+var_1toPost+"&receive_2="+var_2toPost+"&receive_3="+var_3toPost,true);
// in php:

/*
<?php
$received_1 = $_GET['receive_1'];
$received_2 = $_GET['receive_2'];
$received_3 = $_GET['receive_3'];
*/
xmlhttp.send();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines