Permalink
Browse files

Working Technical example

  • Loading branch information...
magicbug committed Nov 22, 2012
1 parent 6f03be8 commit b1837b805ea89534dcefcd4e3d54f585d06dfbba
Showing with 51 additions and 3 deletions.
  1. +1 −1 aprs_func.php
  2. +2 −1 index.php
  3. +3 −1 templates/main.php
  4. +45 −0 templates/passcode.php
View
@@ -1,6 +1,6 @@
<?php
function aprspass ($callsign) {
function aprspass ($callsign) {
$stophere = strpos($callsign, '-');
if ($stophere) $callsign = substr($callsign, 0, $stophere);
$realcall = strtoupper(substr($callsign, 0, 10));
View
@@ -14,7 +14,8 @@
$app->post('/passcode', function () {
require('aprs_func.php');
echo aprspass($_POST['callsign']);
$passcode = aprspass($_POST['callsign']);
require('templates/passcode.php');
});
View
@@ -1,5 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>APRS Passcode Generator</title>
<style type="text/css" media="screen">
@@ -18,6 +19,7 @@
}
label {
width: 100%;
font-weight: bold;
}
</style>
</head>
View
@@ -0,0 +1,45 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>APRS Passcode Generator - Passcode</title>
<style type="text/css" media="screen">
body {
font-family: Arial, "MS Trebuchet", sans-serif;
font-size: 14px;
background-color: whiteSmoke;
}
#container {
margin: 0 auto;
width: 400px;
padding: 10px;
border: 1px solid #E5E5E5;
background-color: #ffffff;
}
label {
width: 100%;
font-weight: bold;
}
.green {
color: #4F8A10;
}
</style>
</head>
<body>
<div id="container">
<h1>APRS Passcode Generator</h1>
<h2>Your Passcode: <span class="green"><?php echo $passcode; ?></span></h2>
<p><a href="../index.php">Generate a new Passcode</a></p>
<p>Techical Example of Passcode Generation using PHP</p>
<p>Source code available on <a href="https://github.com/magicbug/PHP-APRS-Passcode" title="Github" target="_blank">Github</a></p>
</div>
</body>
</html>

0 comments on commit b1837b8

Please sign in to comment.