firefox - Passing 2 data from php to iMacros javascript, but 1 is missing -


this php code:

$s = $iim1->iimset("test1",$test1); $s = $iim1->iimset("test2",$test2); $s = $iim1->iimplay("test.js"); 

in javascript

var macro = "code:"; macro += "version build=8970419 recorder=fx" + "\n"; macro += "url goto=test.com" + "\n"; macro += "tag pos=1 type=input:text attr=id:txt_username content={{test1}}" + "\n"; macro += "tag pos=1 type=button attr=id:button_ok" + "\n"; macro += "tag pos=1 type=h2 attr=txt:* extract=txt" + "\n"; iimplay(macro)  var checking=iimgetlastextract();  var macro1 = "code:"; if(checking=='hasuser'){ macro1 += "version build=10022823" + "\n"; macro1 += "tag pos=1 type=button attr=txt:set<sp>score" + "\n"; macro1 += "tag pos=1 type=input:text attr=id:txt_password content={{test2}}" + "\n"; macro1 += "tag pos=1 type=button attr=id:button_ok" + "\n"; macro1 += "tag pos=2 type=button attr=txt:ok" + "\n"; iimplay(macro1) } 

when imacros performing input password(it shows undefined ) in text fill, know test2 empty because first macro has run.

so, how can store value of test2 use in second macro

try in javascript so:

var macro = "code:"; macro += "version build=8970419 recorder=fx" + "\n"; macro += "url goto=test.com" + "\n"; macro += "tag pos=1 type=input:text attr=id:txt_username content={{test1}}" + "\n"; macro += "tag pos=1 type=button attr=id:button_ok" + "\n"; macro += "tag pos=1 type=h2 attr=txt:* extract=txt" + "\n"; macro += "add !extract {{test2}}" + "\n"; iimplay(macro)  var checking=iimgetextract(1);  var macro1 = "code:"; if(checking=='hasuser'){ macro1 += "version build=10022823" + "\n"; macro1 += "tag pos=1 type=button attr=txt:set<sp>score" + "\n"; macro1 += "tag pos=1 type=input:text attr=id:txt_password content=" + iimgetextract(2) + "\n"; macro1 += "tag pos=1 type=button attr=id:button_ok" + "\n"; macro1 += "tag pos=2 type=button attr=txt:ok" + "\n"; iimplay(macro1) }