Example #1
0
                    $last_easy_key = filter_sql($_POST["easy_key"]);
                    // Filter SQL just in case
                    // Translate Easy Key to Public Key and fill in field with
                    $context = stream_context_create(array('http' => array('header' => 'Connection: close')));
                    // Force close socket after complete
                    $easy_key = filter_sql(file_get_contents("http://timekoin.net/easy.php?s={$easy_key}", FALSE, $context, NULL, 500));
                    if ($easy_key == "ERROR" || empty($easy_key) == TRUE) {
                        $server_message = '<font color="red"><strong>' . $last_easy_key . ' Not Found. Check Your Spelling.</strong></font>';
                        $easy_key = NULL;
                    } else {
                        $server_message = '<table border="0"><tr><td style="width:580px" align="right"><font color="blue"><strong>Easy Key Found</strong></font></td></tr></table>';
                    }
                }
                // No selections made, default screen
                $display_balance = db_cache_balance($my_public_key);
                $body_string = send_receive_body($easy_key, NULL, NULL, $last_easy_key, $message);
                $body_string .= $server_message;
            }
        }
        $text_bar = '<table border="0" cellpadding="6"><tr><td><strong>Current Server Balance: <font color="green">' . number_format($display_balance) . '</font></strong></td></tr>
			<tr><td><strong><font color="green">Public Key</font> to receive:</strong></td></tr>
			<tr><td><textarea readonly="readonly" rows="6" cols="75">' . base64_encode($my_public_key) . '</textarea></td></tr></table>';
        $quick_info = 'Send your own Timekoins to someone else.<br><br>
			Your server will attempt to verify if the public key is valid by examing the transaction history before sending.<br><br>
			New public keys with no history could appear invalid for this reason, so always double check.<br><br>
			You can enter an <strong>Easy Key</strong> and Timekoin will fill in the Public Key field for you.<br><br>
			Messages encoded into your transaction are limited to <strong>64</strong> characters and are visible to anyone.<br>No <strong>| ? = \' ` * %</strong> characters allowed.';
        home_screen('Send / Receive Timekoins', $text_bar, $body_string, $quick_info);
        exit;
    }
    //****************************************************************************
Example #2
0
                    } else {
                        $server_message = '<font color="blue"><strong>Easy Key Found</strong></font>';
                    }
                }
                if (empty($_GET["name_id"]) == TRUE) {
                    // No selections made, default screen
                    $display_balance = db_cache_balance($my_public_key);
                    $body_string = send_receive_body($easy_key, NULL, NULL, $last_easy_key, $message);
                    $body_string .= $server_message;
                } else {
                    // Insert Address Book Entry
                    $name = mysql_result(mysql_query("SELECT name FROM `address_book` WHERE `id` = " . $_GET["name_id"]), 0, 0);
                    $easy_key = mysql_result(mysql_query("SELECT easy_key FROM `address_book` WHERE `id` = " . $_GET["name_id"]), 0, 0);
                    $full_key = mysql_result(mysql_query("SELECT full_key FROM `address_book` WHERE `id` = " . $_GET["name_id"]), 0, 0);
                    $display_balance = db_cache_balance($my_public_key);
                    $body_string = send_receive_body($full_key, NULL, NULL, $easy_key, $message, $name);
                }
            }
        }
        if ($display_balance === "NA") {
            $display_balance = '<font color="red">NA</font>';
        } else {
            $display_balance = number_format($display_balance);
        }
        $text_bar = '<table border="0" cellpadding="6"><tr><td><strong>Current Billfold Balance: <font color="green">' . $display_balance . '</font></strong></td></tr>
			<tr><td><strong><font color="green">Public Key</font> to receive:</strong></td></tr>
			<tr><td><textarea readonly="readonly" rows="6" cols="75">' . base64_encode($my_public_key) . '</textarea></td></tr></table>';
        $quick_info = 'Send your own Timekoins to someone else.</br></br>
			Your client will attempt to verify if the public key is valid by examing the transaction history before sending.</br></br>
			New public keys with no history could appear invalid for this reason, so always double check.</br></br>
			You can enter an <strong>Easy Key</strong> and Timekoin will fill in the Public Key field for you.</br></br>