Forum Moderators: open
Now the question is: what if i have my variable stored in other domain?
this is the phanorama:
In my first page i have a variable called "codeinv" and i need to know the inventory quantity of that SKU code (variable value).
Im my firs page i cannot execute php either asp, only HTML so i cannot do any database query, so I need to call a iframe from a php site (other domain) and that iframe pull the "codeinv" variable from it's calling page and do the query, then that page should return the value of "codeinv" lets say:
page 1: send this value to the php iframe "codeinv=040201-wh"
page 2: recive the variable, do a query and return this value to calling page "x=138"
everything works within the same domain my problem is that it DOESNT work if the calling page is stored in other domain: below are the source for the 2 pages:
Calling page: (www.MyDOmain.com/display.html)
<body onload="showVal()">
<style>iframe {display: none;}</style>
<script language="JavaScript">
function showVal() {
var X = frames["testFrame"].document.getElementById("X").value;
document.write(X); }
showVal(); </script>
<iframe src="http://site.My.Other.Domain.com/source.php?codeinv=040201-wh" id="testFrame" name="testFrame"></iframe> php iframe: (site.My.Other.Domain.com/source.php)
NOTE: I Post only the ouput
<script>var X = 138;
function setVars() {
document.getElementById("X").value = X; }
document.write(window.url.code); </script>
<body onload="setVars()">
<input type="hidden" id="X" value="" /> any help will be apreciated
thanks!