Exemplo n.º 1
0
<?php

/**
 * Created by PhpStorm.
 * User: lasithniro
 * Date: 1/10/16
 * Time: 12:59 AM
 */
include "qrcode.php";
$qr = new qrcode();
$transID = "easyID_002";
$studentName = "Lasith";
$paymentType = "Repeat exam fee";
$paymentStatus = "Completed";
$amount = '100.00';
$index = '13000829';
$str = "Transaction ID = {$transID} \n Student Index Number = {$index} \n Payment type = {$paymentType} \n Amount = {$amount} \n Payment Status = {$paymentStatus} \n ";
$qr->text($str);
echo "<p><img src='" . $qr->get_link() . "' border='0'/></p>";
if (isset($_POST['type'])) {
    //here we got all data from submitted form
    //we include class file
    include "qrcode.php";
    //create an instance
    $qr = new qrcode();
    //then we check what type of information user wanted to create qr code
    //to know what are possible types and what information needs to inserted, check the example file
    switch ($_POST['type']) {
        case "url":
            //then we use submitted information here, word inside $_POST[] brackets must match value of name attribute in the input field
            //<p>http://<input type='text' name='url'
            $qr->link($_POST['url']);
            break;
        case "txt":
            $qr->text($_POST['txt']);
            break;
        case "sms":
            $qr->sms($_POST['sms_phone'], $_POST["sms_text"]);
            break;
        case "bookmark":
            $qr->bookmark($_POST['mms_phone'], $_POST["mms_text"]);
            break;
        case "tel":
            $qr->phone_number($_POST['tel']);
            break;
        case "contactinfo":
            $qr->contact_info($_POST["contact_name"], $_POST["contact_address"], $_POST["contact_phone"], $_POST["contact_email"]);
            break;
        case "email":
            $qr->email($_POST["email_address"], $_POST["email_subject"], $_POST["email_txt"]);
Exemplo n.º 3
0
 *
 * For more information, examples and online documentation visit: 
 * http://webcodingeasy.com/PHP-classes/QR-code-generator-class
 **************************************************************/
include "qrcode.php";
$qr = new qrcode();
//link
$qr->link("http://code-snippets.co.cc");
echo "<p>Link</p>";
echo "<p><img src='" . $qr->get_link() . "' border='0'/></p>";
//bookmark
$qr->bookmark("WebcodingEasy.com", "http://webcodingeasy.com");
echo "<p>Bookmark</p>";
echo "<p><img src='" . $qr->get_link() . "' border='0'/></p>";
//text
$qr->text("Any UTF8 characters like Ä&#65533;Ä“Å«");
echo "<p>UTF8 text</p>";
echo "<p><img src='" . $qr->get_link() . "' border='0'/></p>";
//sms
//First parameter - phone number
//Second parameter - sms text
$qr->sms("12345678", "sms text");
echo "<p>SMS with phone number and text</p>";
echo "<p><img src='" . $qr->get_link() . "' border='0'/></p>";
//phone number
$qr->phone_number("12345678");
echo "<p>Telephone number</p>";
echo "<p><img src='" . $qr->get_link() . "' border='0'/></p>";
//email
//First param - email address
//Second param - email subject