summaryrefslogtreecommitdiff
path: root/leave-a-message/index.php
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-02-10 11:16:07 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-02-10 11:16:07 +0800
commit9d3c8c0e6e1a7ba43bf3dc19350d1dca68b657a3 (patch)
tree339de0698c13e1763d3361d70fb1266621025c91 /leave-a-message/index.php
downloadweb-9d3c8c0e6e1a7ba43bf3dc19350d1dca68b657a3.tar.xz
Initial commit.
Diffstat (limited to 'leave-a-message/index.php')
-rw-r--r--leave-a-message/index.php91
1 files changed, 91 insertions, 0 deletions
diff --git a/leave-a-message/index.php b/leave-a-message/index.php
new file mode 100644
index 0000000..3589515
--- /dev/null
+++ b/leave-a-message/index.php
@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="expires" content="Friday 24 October 1997 09:30 GMT">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Chrisoft::Leave a message</title>
+ <link rel=stylesheet href='../common.css' type='text/css'>
+ <link rel=stylesheet href='extras.css' type='text/css'>
+ <style type="text/css">
+ div.comment{
+ border:1px solid #CCC;
+ }
+ div.author{
+ text-align:right;
+ }
+ </style>
+ <script src='https://www.google.com/recaptcha/api.js'></script>
+ <script type="text/javascript">
+ function verify()
+ {
+ if(document.getElementById("content").value.length+document.getElementById("name").value.length>16300)return;
+ try
+ {
+ if(grecaptcha.getResponse().length===0)
+ document.getElementById("ann").style.display="inline-block";
+ else document.getElementById("msgform").submit();
+ }
+ catch(e){return;}
+ }
+ function ol()
+ {
+ if( navigator.userAgent.match(/Android/i)
+ || navigator.userAgent.match(/webOS/i)
+ || navigator.userAgent.match(/iPhone/i)
+ || navigator.userAgent.match(/iPad/i)
+ || navigator.userAgent.match(/iPod/i)
+ || navigator.userAgent.match(/BlackBerry/i)
+ || navigator.userAgent.match(/Windows Phone/i)
+ )
+ document.getElementById("tab").style.width="98%",
+ document.getElementById("msgform").style.width="96%";
+ }
+ </script>
+ <?php
+ if(isset($_POST['name']))
+ echo "<script>
+ window.onload=function()
+ {
+ document.getElementById(\"ann\").style.display=\"inline-block\";
+ document.getElementById(\"name\").value=\"".$_POST['name']."\";
+ document.getElementById(\"content\").value=\"".$_POST['content']."\";
+ }
+ </script>";
+ ?>
+</head>
+<body onload="ol()">
+<table id="tab" border="0" style="width:70%;margin:auto;">
+ <tr>
+ <td class="CTitle" style="font-size:2em;">
+ <a href="../">Chrisoft</a>::Messages
+ </td>
+ </tr>
+ <tr><td>
+ <h1 class="TText">Deprecated. Use Guestbook found in the homepage instead.</h1>
+ <div class="TText" style="margin:auto;width:80%">
+ <?php
+ $file=fopen("/var/www/html/leave-a-message/messages.txt","r");
+ $comms;$i=0;
+ while(($str=fgets($file,16384))!==false)$comms[$i++]=$str;
+ fclose($file);
+ while(--$i>=0)echo $comms[$i];
+ ?>
+ <form action="writemessage.php" id="msgform" method="post" style="width:50%;margin:auto;padding:5px;border:1px solid #CCC;">
+ <span style="width:90%;display:table;">
+ <label for="name" style="display:table-cell;width:1px;white-space:nowrap;">Your honourable name:</label>
+ <input type="text" id="name" name="name" required style="margin-left:5px;display:table-cell;width:100%;">
+ </span>
+ <p>Message:</p>
+ <textarea required id="content" name="content" rows="5" style="width:90%;margin-left:1px;"></textarea>
+ <p>
+ Something Annoying: <span id="ann" style="color:#F00;display:none;">Please complete the annoying challenge!</span></p>
+ <div class="g-recaptcha" data-sitekey="6Lf1lAcUAAAAAGep8SpTETdIrEiw6w8uVy8IXp9U"></div><br>
+ <div style="text-align:center;">
+ <button onclick="verify();" type="button" style="border:none;color:white;padding:0.5em 2em;text-align:center;background-color:#44AA44;-webkit-transition-duration:0.4s;transition-duration:0.4s;">Leave the message!</button>
+ </div>
+ </form>
+ </div>
+ </td></tr>
+</table>
+</body>