Commits

Toby Inkster committed 4ae944d

HTML_Safe

  • Participants
  • Parent commits 0e0c08b

Comments (0)

Files changed (1)

 		if ($info['WebID'])
 		{
 			print "<div class=\"success\">\n";
-			printf("<p>Found a WebID:<br /><tt>%s</tt></p>\n", htmlentities($info['WebID']));
+			printf("<p>Found a WebID%s:<br /><tt id=\"webid\" title=\"%s\">%s</tt></p>\n", 
+				(empty($info['Name']) ? '' : (' for ' . htmlentities($info['Name']))),
+				htmlentities($info['WebID']),
+				htmlentities($info['WebID']));
+			if (!empty($_REQUEST['javascript']))
+			{
+				print "<script type=\"text/javascript\">\n";
+				print "function UseIt() { window.opener.document.getElementById('"
+					. htmlentities($_REQUEST['javascript'])
+					. "').value = document.getElementById('webid').title; }\n";
+				print "</script>\n";
+				print "<p><a href=\"javascript:UseIt();\">Use this WebID</a></p>\n";
+			}
 			print "</div>\n";
 			print "</body>\n";
 			print "</html>\n";
 	}
 ?>
 
-<form action="" method="get">
+<form action="" method="post">
 
 <ul>
 
 </ul>
 
 <div class="form-end">
+	<input type="hidden" name="javascript" value="<?php echo htmlentities($_REQUEST['javascript']) ?>" />
 	<input type="hidden" name="submit" value="1" />
 	<input name="search" value="search" alt="Search" type="image" src="Search.png" />
 </div>