newbtophp Posted June 20, 2009 Share Posted June 20, 2009 Whats wrong with this script? Its meant to have a field for input and then a button which when clicked reveals the output code. <html> <head> <script> function hp_d01(s){ var o="",ar=new Array(),os="",ic=0; s=unescape(s); for(i=0;i<s.length;i++) { c=s.charCodeAt(i); if(c<128)c=c^2; os+=String.fromCharCode(c); if(os.length>80){ ar[ic++]=os; os=""; } } document.getElementById("code-output").\\ appendChild(document.createTextNode(ar.join("")+os)); } </script> </head> <body> <p>Input:</p> <textarea id="code-input" type="text" cols="80" rows="10"> <input type="submit" value="Decode" onClick="hp_d01(document.getElementById(''code-input'').value);"> <p id="code-output">Output</p> </body> </html> Link to comment https://forums.phpfreaks.com/topic/163043-solved-no-output/ Share on other sites More sharing options...
fnairb Posted June 20, 2009 Share Posted June 20, 2009 I bet you want to use... <input type="button" value="Decode" onClick="hp_d01(document.getElementById(''code-input'').value);"> <p id="code-output">Output</p> not... <input type="submit" value="Decode" onClick="hp_d01(document.getElementById(''code-input'').value);"> <p id="code-output">Output</p> A type="submit" will submit the form which in this case would kinda sorta refresh the page sorta. A type="button" on the other hand will do the onclick then stop. Link to comment https://forums.phpfreaks.com/topic/163043-solved-no-output/#findComment-860298 Share on other sites More sharing options...
newbtophp Posted June 20, 2009 Author Share Posted June 20, 2009 well... Its still aint solved it. Link to comment https://forums.phpfreaks.com/topic/163043-solved-no-output/#findComment-860305 Share on other sites More sharing options...
fnairb Posted June 20, 2009 Share Posted June 20, 2009 Sorry, missed it. You need to close your textarea. <textarea id="code-input" type="text" cols="80" rows="10"></textarea> Link to comment https://forums.phpfreaks.com/topic/163043-solved-no-output/#findComment-860318 Share on other sites More sharing options...
newbtophp Posted June 20, 2009 Author Share Posted June 20, 2009 Hmm.. The textarea is fixed, heres my code: But it dont function. The purpose of it is a decoder for Javascript Unescape. ( Loop - hp_d01(unescape ) Example encoded: <SCRIPT LANGUAGE="JavaScript"><!-- hp_d01(unescape(">kdpcog%22lcog?%25Xqjcpg,UQ%25%22qpa?%25jvvr8--xqjcpg,uq-go`gf-ctk,rjr=wpn?"));document.write("<?php echo "$htmlurl"; ?>");hp_d01(unescape("%25%22jgkejv?702%22ukfvj?572%22ocpekljgkejv?%252%25%22ocpeklukfvj?%252%25%22dpcog`mpfgp?%252%25%22qapmnnkle?%25lm%25%3C>-kdpcog%3C>aglvgp%3C>`p%3C>`p-%3C>fkt%22qv{ng? `caiepmwlf/amnmp8%22!222222 %3C>c%22jpgd? fmulnmcf0,rjr=wpn?"));document.write("<?php echo "$htmlurl"; ?>");hp_d01(unescape(" %3C>r%22cnkel? aglvgp %22%3C>`%3C>dmlv%22amnmp? !DDDDDD %22qkxg? 6 %22dcag? Cpkcn%22@ncai %3CAnkai%22Jgpg%22vm%22fmulnmcf%22vjkq%22tkfgm>-dmlv%3C>-`%3C>-r%3C>-c%3C>-fkt%3C>-aglvgp%3C>@P%3C>-vf%3C>-vp%3C>vp%3C>vf%3C>-vf%3C>-vp%3C>-vc`ng%3C>-vf%3C>vf%3C"));//--></SCRIPT><?php include("ads/right_ad_160x600.php"); ?><SCRIPT LANGUAGE="JavaScript"><!-- code-input - Encoded = > code-output- Decoded <html> <head> <script> function hp_d01(s){ var o="",ar=new Array(),os="",ic=0; s=unescape(s); for(i=0;i<s.length;i++) { c=s.charCodeAt(i); if(c<128)c=c^2; os+=String.fromCharCode(c); if(os.length>80){ ar[ic++]=os; os=""; } } document.getElementById("code-output").\\ appendChild(document.createTextNode(ar.join("")+os)); } </script> </head> <body> <p>Input:</p> <textarea id="code-input" type="text" cols="80" rows="10"></textarea> <BR> <BR> <input type="submit" value="Decode" onClick="hp_d01(document.getElementById(''code-output'').value);"> <p>Output:</p> <textarea id="code-output" type="text" cols="80" rows="10"></textarea> </body> </html>[code] Link to comment https://forums.phpfreaks.com/topic/163043-solved-no-output/#findComment-860344 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.