Tuesday, May 24, 2011

QRcodes: PHP based QRcodes in the cloud

Following on from my Javascript based QRcodes in the cloud here

The same guy who wrote the javascript engine also has a PHP based generator released under the MIT license. The php code can be found here

So, with the help of phpform.org I have created my very own webpage on my very own free Amazon micro cloud.

The form looks like this,

As you may be able to tell I have further plans to use php and create a bigger and better site.

I created the above form with phpform.org and downloaded the code. I put all the code from phpform.org and http://www.d-project.com/ in one directory.

I then manually changed the submit action in form.html to call the adapted example qrcode php code.

Here is the adapted php code to generate the qrcode from the text in the form.
 <?php
  
 $bt = $_POST['element_1'];
  
 $ty = $_POST['element_2'];
  
 require_once("qrcode.php");
  
 $qr = new QRCode();
  
 $qr = QRCode::getMinimumQRCode( $bt , QR_ERROR_CORRECT_LEVEL_L);
  
 $qr->make();
  
 $qr->printHTML();
  
 ?>
  

And I added some google ads to the code and it looks like this.



Below is the live Amazon EC2 page. link here

Its my test Amazon server so the server may be shut down at any time.

No comments:

Post a Comment

Google +