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"]);
         break;
     case "geo":
         $qr->geo($_POST["geo_lat"], $_POST["geo_lon"], $_POST["geo_above"]);
Ejemplo n.º 2
0
//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
//Third param - email text
$qr->email("*****@*****.**", "Testing email subject", "Testing email text");
echo "<p>Email with subject and message text</p>";
echo "<p><img src='" . $qr->get_link(250) . "' border='0'/></p>";
//geo location works on smartphones
//First param - latitude