Jump to content

Recommended Posts

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

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.