Jump to content

Problem with dynamically created javascript for proxy form


Picatta

Recommended Posts

Well, I decided to make a script in php which would pase a text file and then depending on the get data attached to ?type= would print out the appropriate proxy form and a drop down menu which would change the action of the script. This script gets called like a normal .js file, except like src="script.php?type=cgi". The text file is in the format

URL |-@-| TYPE

Where TYPE is either cgi or php. Anyway, all was going well, and I got CGI working but now php won't work. I can't figure out what's wrong.

(I am pretty sure I screwed up the javascript)

[code]<?php
$type = $_GET['type'];
if ($type == 'cgi') {
print "
document.write('<FORM name=\"Proxy\" method=post><p align=center><select style=\"color: #ffffff; background-color: #000000\" id=\"ProxyChange\">');
";
}
if ($type == 'php') {
print "
document.write('<div id=\"container\"><div id=\"menu\"><a href=\"$website\">URL Form</a> | ')
document.write('    <a href=\"" . $website . "?action=cookies\">Manage Cookies</a> |')
document.write('  </div>  <div class=\"title\">PHProxy</div>  <noscript><div class=\"error\"><big>You have Javascript disabled. Please enable it to use the proxy</big></div></noscript>')
document.write('  <form name=\"poxy_url_form\" method=\"get\" action=\"/anticencorship/phpProxy/index.php\">')
document.write('  <select style=\"color: #ffffff; background-color: #000000\" id=\"PProxyChange\">
";
}
$file = 'proxies.txt';
$file = file_get_contents($file);
$file = preg_split('/\n/',$file);
$limit = count($file);
for ($int=0; $int<$limit; $int++) {
$website = $file[$int];
$line = $file[$int];
$line = explode('|-@-|',$line);
$website = $line[0];
$name = explode('://',$website);
$name = $name[1];
$name = preg_split('/\.[cnobuCNOBU]/',$name);
$name = $name[0];
if ((strpos($website,'https://')) !== FALSE) {$secure = 'Secure';} else {$secure = 'Insecure';}
if (strpos($line[1],$type) !== FALSE)
print "document.write('<option value=\"$website\">$name ($secure)</option>');
";
}
if ($type == 'cgi') {
print "
document.write('</select></p><br /><br /><p align=center><FONT COLOR=\"#ffffff\"><INPUT size=80 name=URL style=\"color: #ffffff; background-color: #000000\"><b><INPUT type=submit onClick=\"Proxy.action=document.Proxy.ProxyChange.options[document.Proxy.ProxyChange.selectedIndex].value\"          value=\"\" style=\"color: #ffffff; background-color: #000000\"> <BR><INPUT type=checkbox name=rc value=\"ON\"> Destroy Cookies (except some proxy cookies) <BR><INPUT type=checkbox name=rs value=\"ON\"> Remove Scripts (For anonymity) <BR><INPUT type=checkbox name=fa value=\"ON\"> Filter ads <BR><INPUT type=checkbox name=br value=\"ON\"> Spoof Referrer <BR><INPUT type=checkbox name=if value=\"ON\"> Show small Address form </p></b></FONT></FORM>');";
}
if ($type == 'php') {
print "
document.write('<input type=hidden name=formsub value=true>  <input type=\"hidden\" name=\"q\" value=\"\" id=\"url_input\" />  <input type=\"hidden\" name=\"hl\" value=\"\" />')
document.write('  </form>  <form name=\"poxy_settings_form\" method=\"get\" action=\"\" onsubmit=\"return submit_form();\">  <input type=hidden name=formsub value=true>')
document.write('  <table style=\"width: 100%\">  <tr><td class=\"option\" style=\"width: 20%\">URL</td><td class=\"option\" style=\"width: 80%\">&nbsp;<input type=\"text\" name=\"url\" size=\"70\" value=\"\" /></td></tr>')
document.write('  <tr><td class=\"option\">Include Form</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Includes a mini URL-form on every HTML page</td></tr><tr><td class=\"option\">Remove Scripts</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Remove client-side scripting (i.e. Javascript)</td></tr><tr><td class=\"option\">Accept Cookies</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Accept HTTP cookies</td></tr><tr><td class=\"option\">Show Images</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Show images</td></tr><tr><td class=\"option\">Show Referer</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Show referring website in HTTP headers</td></tr><tr><td class=\"option\">Rotate13</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" /> Use rotate13 encoding on the URL</td></tr><tr><td class=\"option\">Base64</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Use base64 encoding on the URL</td></tr><tr><td class=\"option\">Strip Meta</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" /> Strip meta HTML tags</td></tr><tr><td class=\"option\">Strip Title</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" /> Strip Website title</td></tr><tr><td class=\"option\">Session Cookies</td><td class=\"option\"> <input type=\"checkbox\" name=\"ops[]\" checked=\"checked\" /> Store cookies for this session only</td></tr>  <tr><td class=\"option\" style=\"width: 20%\">New Window</td><td class=\"option\" style=\"width: 80%\"><input type=\"checkbox\" name=\"new_window\" />Open URL in a new window </td></tr>')
document.write('  </table>  <div style=\"text-align: center\"><input type=\"submit\" name=\"browse\" value=\"Browse\" onclick=\"return submit_form(); poxy_url_form.action=document.poxy_url_form.PProxyChange.options[document.poxy_url_form.PProxyChange.selectedIndex].value\" /></div>')
document.write('  <div style=\"text-align: center\">PHProxy 0.4 &copy; 2005 <a href=\"http://www.whitefyre.com/\">whiteFyre</a></div>  </form>  </div>')
";
}
?>


[/code]
Link to comment
Share on other sites

Hi,,
maybe try:
[code]print "<s cript>document.write(\"<font face='Impact, Arial' size=3 color='#008000'>Hello World</font>\")</s cript>";
[/code]
because 'document.write' is javascript,,

nb: replace 's cript' by 'script',,

Hoping it helps,
l8tr,,
Link to comment
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.