1,38d0
< <?php
<   $jmsg="";
<   $hdate='' . date('A h:i:s l jS \of F Y');
<   
<   if (isset($_GET['bcn']) && isset($_GET['msg'])) {
<     $phpis=file_get_contents(dirname(__FILE__) . "/" . "broadcast_api_test.php");
<     $parts=explode('/' . '/ ' . 'bcdata', $phpis);
<     $parte=explode('/' . '/ end of ' . 'bcdata', $phpis);
<     if (sizeof($parts) == 2 && sizeof($parte) == 2) {
<       $zparte=explode(' bcn=' . str_replace('+',' ',urldecode($_GET['bcn'])) . ' msg=', $phpis);
<       $zparts=explode(date('l jS \of F Y') . ': bcn=' . str_replace('+',' ',urldecode($_GET['bcn'])) . ' msg=', $phpis);
<       if (sizeof($zparte) > 1) {
<       $prehdate="/" . "/ " . explode("/" . "/ ", ($zparte[-2 + sizeof($zparte)]))[-1 + sizeof(explode("/" . "/ ", ($zparte[-2 + sizeof($zparte)])))];
<       $midhdate=' bcn=' . str_replace('+',' ',urldecode($_GET['bcn'])) . ' msg=';
<       $posthdate=explode("\n", $zparte[-1 + sizeof($zparte)])[0] . "\n";
<       file_put_contents(dirname(__FILE__) . "/" . "broadcast_api_test.php", str_replace($prehdate . $midhdate . $posthdate, "/" . "/ " . $hdate . ": bcn=" . str_replace('+',' ',urldecode($_GET['bcn'])) . ' msg=' . base64_encode(str_replace('+',' ',urldecode($_GET['msg']))) . "\n", $phpis));
<       } else {
<       file_put_contents(dirname(__FILE__) . "/" . "broadcast_api_test.php", $parte[0] . "\n/" . "/ " . $hdate . ": bcn=" . str_replace('+',' ',urldecode($_GET['bcn'])) . ' msg=' . base64_encode(str_replace('+',' ',urldecode($_GET['msg']))) . "\n" . '/' . '/ end of ' . 'bcdata' . $parte[1]);
<       }
<       exit;
<     }
<   } else if (isset($_GET['bcn']) && isset($_GET['what'])) {
<     $phpis=file_get_contents(dirname(__FILE__) . "/" . "broadcast_api_test.php");
<     $parte=explode(' bcn=' . str_replace('+',' ',urldecode($_GET['bcn'])) . ' msg=', $phpis);
<     $parts=explode(date('l jS \of F Y') . ': bcn=' . str_replace('+',' ',urldecode($_GET['bcn'])) . ' msg=', $phpis);
<     if (sizeof($parts) >= 2) {
<       $prehdate='' . date('A');
<       $midhdate=explode(" ", trim($parts[-2 + sizeof($parts)]))[-1 + sizeof(explode(" ", trim($parts[-2 + sizeof($parts)])))];
<       $posthdate='' . date('l jS \of F Y');
<       $jmsg=base64_decode(explode("\n", $parts[-1 + sizeof($parts)])[0]);
<     }
<   }
< 
<  if ($jmsg != "") {
<    echo "<html><head><scr" . "ipt type='text/javascript'> function onl() { if (parent.document.getElementById(\"hdatetime\").value != \"" . $prehdate . ' ' . $midhdate . ' ' . $posthdate . "\") { parent.document.getElementById(\"hdatetime\").value=\"" . $hdate . "\"; parent.document.getElementById(\"tab\").value=\"" . str_replace("\n", '" + String.fromCharCode(10) + "', str_replace('"', '" + String.fromCharCode(34) + "', $jmsg)) . "\";  parent.document.getElementById('ta').value=\"" . str_replace("\n", '" + String.fromCharCode(10) + "', str_replace('"', '" + String.fromCharCode(34) + "', $jmsg)) . "\"; } } </scr" . "ipt></head><body onload=onl();></body></html>";
<    exit;
<  }
< ?>
43a6,50
>   <!-- The title will change to greet the user -->
>   <!--h1 id="title">Hey</h1>
>   <input id="name-field" placeholder="Enter Your Name"/>
> </body>
> 
> <script>
> 
> var bc = new BroadcastChannel('alligator_channel');
> 
> (()=>{
>   const title = document.getElementById('title');
>   const nameField = document.getElementById('name-field');
>   const setTitle = (userName) => {
>     title.innerHTML = 'Hey ' + userName;
>   }
> 
>   bc.addEventListener('message', (messageEvent) => {
>     // If our broadcast message is 'update_title' then get the new title from localStorage
>     if (messageEvent.data === 'update_title') {
>       alert('here');
>       // localStorage is domain specific so when it changes in one window it changes in the other
>       setTitle(localStorage.getItem('title'));
>     }
>   });
> 
>   // When the page loads check if the title is in our localStorage
>   if (localStorage.getItem('title')) {
>     setTitle(localStorage.getItem('title'));
>   } else {
>     setTitle('please tell us your name');
>   }
> 
>   nameField.onchange = (e) => {
>     const inputValue = e.target.value;
>     // In the localStorage we set title to the user's input
>     localStorage.setItem('title', inputValue);
>     // Update the title on the current page 
>     setTitle(inputValue);
>       alert('prehere');
>     // Tell the other pages to update the title
>     bc.postMessage('update_title');
>       alert('posthere');
>   };
> })()
> </script-->
119,120d125
<     var ivalt=iv.value.replace(/\ /g,'').replace(/\//g,'');
<     if (ivalt != iv.value) { iv.value=ivalt; }
182c187
<       yourbc.postMessage(ifit(document.getElementById('lname').innerHTML + ': ' + minussc(iv.value)));
---
>       yourbc.postMessage(document.getElementById('lname').innerHTML + ': ' + minussc(iv.value));
190c195
<       bc.postMessage(ifit(document.getElementById('bname').innerHTML + ': ' + minussc(iv.value)));
---
>       bc.postMessage(document.getElementById('bname').innerHTML + ': ' + minussc(iv.value));
198,228d202
<   
<   function ifit(instg) {
<     if (document.getElementById('itab').placeholder.indexOf('RJM Programming') == -1 && document.getElementById('itab').placeholder != '') {
<     document.getElementById('phpbat').src='./broadcast_api_test.php?bcn=' + encodeURIComponent(document.getElementById('itab').placeholder) + '&msg=' + encodeURIComponent(instg) + '&rand=' + Math.floor(Math.random() * 198767543);
<     } else if (document.getElementById('ita').placeholder.indexOf('RJM Programming') == -1 && document.getElementById('ita').placeholder != '') {
<     document.getElementById('phpbat').src='./broadcast_api_test.php?bcn=' + encodeURIComponent(document.getElementById('ita').placeholder) + '&msg=' + encodeURIComponent(instg) + '&rand=' + Math.floor(Math.random() * 198767543);
<     } else if (document.getElementById('itab').value.trim() != '') {
<     document.getElementById('phpbat').src='./broadcast_api_test.php?bcn=' + encodeURIComponent(document.getElementById('itab').value) + '&msg=' + encodeURIComponent(instg) + '&rand=' + Math.floor(Math.random() * 198767543);
<     } else if (document.getElementById('ita').value.trim() != '') {
<     document.getElementById('phpbat').src='./broadcast_api_test.php?bcn=' + encodeURIComponent(document.getElementById('ita').value) + '&msg=' + encodeURIComponent(instg) + '&rand=' + Math.floor(Math.random() * 198767543);
<     }
<     return instg;
<   }
<   
<   function ifwhatit() {
<     if (document.getElementById('itab').placeholder.indexOf('RJM Programming') == -1 && document.getElementById('itab').placeholder != '') {
<     document.getElementById('phpwhatbat').src='./broadcast_api_test.php?bcn=' + encodeURIComponent(document.getElementById('itab').placeholder) + '&what=' + Math.floor(Math.random() * 198767543);
<     } else if (document.getElementById('ita').placeholder.indexOf('RJM Programming') == -1 && document.getElementById('ita').placeholder != '') {
<     document.getElementById('phpwhatbat').src='./broadcast_api_test.php?bcn=' + encodeURIComponent(document.getElementById('ita').placeholder) + '&what=' + Math.floor(Math.random() * 198767543);
<     } else if (document.getElementById('itab').value.trim() != '') {
<     document.getElementById('phpwhatbat').src='./broadcast_api_test.php?bcn=' + encodeURIComponent(document.getElementById('itab').value) + '&what=' + Math.floor(Math.random() * 198767543);
<     } else if (document.getElementById('ita').value.trim() != '') {
<     document.getElementById('phpwhatbat').src='./broadcast_api_test.php?bcn=' + encodeURIComponent(document.getElementById('ita').value) + '&what=' + Math.floor(Math.random() * 198767543);
<     }
<   }
<   
<   setInterval(ifwhatit, 8000);
<   
< <?php 
< ?>
<   
230,232d203
< <input id=hdatetime value='' type=hidden></input>
< <iframe id=phpbat src='//www.rjmprogramming.com.au/About_Us.html' style='display:none;'></iframe>
< <iframe id=phpwhatbat src='//www.rjmprogramming.com.au/About_Us.html' style='display:none;'></iframe>
235,238d205
< <?php
< // bcdata
< // end of bcdata
< ?>
