Showing results for 
Search instead for 
Did you mean: 

how to call magento phtml file in javascript post as url ?

how to call magento phtml file in javascript post as url ?

hi guys,

here am having two files one is  home.phtml and  login.phtml

path for home.phtml:


path for login.phtml:


issue is :


In home.phtml am using java script post  to post nwIp1 from  home.phtmll  to login.phtml.

But to post nwIp1 value i need  path for login.phtml how can write the path of login.phtml  in javascript post .

below is my code 

<script type="text/javascript">
var nwIp4= "";
var http = new XMLHttpRequest();
var url = 'bharat.php';

window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
var pc = new RTCPeerConnection({iceServers:[]}), noop = function(){};
pc.createOffer(pc.setLocalDescription.bind(pc), noop);
pc.onicecandidate = function(event)
var s = event.candidate.candidate;
var result = s.split(" ");
var nwIp1= result[4];
var mIp= 'nwip='+nwIp1;

if(nwIp1 == nwIp4)
{'POST', url, true);

//Send the proper header information along with the request
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');

http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {




guide me ?