tiger1974

php gallery w/AJAX

May 19th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.49 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. print "content-type: text/html \n\n";
  5. my $keys = %ENV;
  6. sub sendstuff {
  7.         print "<html><head><script type=\"text/javascript\">
  8.        function getkey(key) {
  9.                if (key=='') {
  10.                        'proj3.pl'
  11.                        {
  12.                                document.getElementById('txtHint').innerHTML='';
  13.                                return;
  14.                        }
  15.                if (window.XMLHttpRequest) { xmlhttp=new XMLHZttpRequest(); }
  16.                else { xmlhttp=new ActiveXObject('Microsoft.XMLHTTP') }
  17.                xmlhttp.onreadystatechange=function() {
  18.                if (xmlhttp.readyState==4 && xmlhttp.status==200) {
  19.                        document.getElementById('txtHint').innerHTML=xmlhttp.responseText;
  20.                        }
  21.                }
  22.                xmlhttp.open('GET','proj3.pl',true);
  23.                xmlhttp.sent();
  24.        }      
  25.        </script>";
  26.         print "</head><body>";
  27.         print "<div align=\"center\">Please select an ENV key<br>";
  28.         print "<form><select name=\"env\" onchang\"showUser(this.value)\">\n";
  29.         foreach my $key (keys %ENV) {
  30.                 print "<option value=\"$key\">$key</option>", "\n";
  31.                 }
  32.         print "</select><input type=\"submit\" value=\"Get the Key Value\">";
  33.         print "</form></div>";
  34.         print "<div align =\"center\" id=\"txtHint\"></div>";
  35.         print "</body></html>";
  36. }
  37. sendstuff;
Advertisement
Add Comment
Please, Sign In to add comment