merge upstream phpxmlrpc
[plcapi.git] / php / phpxmlrpc / demo / client / mail.php
index 9486e09..4907a7a 100644 (file)
@@ -1,11 +1,4 @@
-<?php
-// Allow users to see the source of this file even if PHP is not configured for it
-if (isset($_GET['showSource']) && $_GET['showSource']) {
-    highlight_file(__FILE__);
-    die();
-}
-?>
-<html>
+<?php require_once __DIR__ . "/_prepend.php"; ?><html lang="en">
 <head><title>xmlrpc - Mail demo</title></head>
 <body>
 <h1>Mail demo</h1>
@@ -14,17 +7,14 @@ if (isset($_GET['showSource']) && $_GET['showSource']) {
     When you press <kbd>Send</kbd> this page will reload, showing you the XML-RPC request sent to the host server, the
     XML-RPC response received and the internal evaluation done by the PHP implementation.</p>
 
-<p>You can find the source to this page here: <a href="mail.php?showSource=1">mail.php</a><br/>
+<p>You can see the source to this page here: <a href="mail.php?showSource=1">mail.php</a><br/>
     And the source to a functionally identical mail-by-XML-RPC server in the file <a
         href="../server/server.php?showSource=1">server.php</a> included with the library (look for the 'mail_send'
     method)</p>
 <?php
 
-include_once __DIR__ . "/../../src/Autoloader.php";
-PhpXmlRpc\Autoloader::register();
-
 if (isset($_POST["mailto"]) && $_POST["mailto"]) {
-    $server = "http://phpxmlrpc.sourceforge.net/server.php";
+    $server = XMLRPCSERVER;
     $req = new PhpXmlRpc\Request('mail.send', array(
         new PhpXmlRpc\Value($_POST["mailto"]),
         new PhpXmlRpc\Value($_POST["mailsub"]),
@@ -41,7 +31,7 @@ if (isset($_POST["mailto"]) && $_POST["mailto"]) {
     if (!$resp->faultCode()) {
         print "Mail sent OK<br/>\n";
     } else {
-        print "<fonr color=\"red\">";
+        print "<font color=\"red\">";
         print "Mail send failed<br/>\n";
         print "Fault: ";
         print "Code: " . htmlspecialchars($resp->faultCode()) .
@@ -63,4 +53,4 @@ if (isset($_POST["mailto"]) && $_POST["mailto"]) {
     <input type="Submit" value="Send"/>
 </form>
 </body>
-</html>
+</html><?php require_once __DIR__ . "/_append.php"; ?>