Thursday, 5 November 2020

Very simple way to create barcode on web page in PHP.

 barcode or bar code is a method of representing data in a visual, machine-readable form. I have seen many programming techniques to create barcode, but all looks very complex to utilize in your code. Here I have found a simple way to create a barcode in a single line of code. Please see -

You need to download barcode generator file (barcode.php) from here :-

 https://github.com/davidscotttufts/php-barcode/

You will have to use this file on page where you want to generate the barcode like this-

<img alt="arvind" src="path_of_file/barcode.php?text=123456789&print=true" />

Resulted barcode will be -

Another variant of barcode is-
 
<img alt="arvind" src="path_of_file/barcode.php?codetype=Code39&size=60&text=123456789&print=true" />

Result will be -

And if you want it to create vertically then use this code -

<img alt="arvind" src="path_of_file/barcode.php?text=123456789&orientation=vertical&size=40" />

Result will be -

You will have to put your data into text property.

If you want to generate create bar code of dynamic data then you can use it as

<img alt="arvind" src="path_of_file/barcode.php?text=<?php echo $data; ?>&print=true" />

For more please visit-







Monday, 2 November 2020

Host your web page on Google drive.

 It is very easy to host your web page on Google drive. Many people like me do not want to purchase hosting services and sometimes it is not required.

So let see how we can do this. Follow the steps. 

  • Create a folder on your Google drive.


  • Upload your HTML files in this folder. You can also upload a folder instead of creating a new one, but make sure if there are many files in this folder, the home page should be named index.html.
  • Now on your folder, "right click" and select "Get link".



  • Also, click on "Anyone with the link" below the link.


  • Now open a website "https://drv.tw/", and select google drive.


  • Login in with your Gmail account and allow access to DriveToWeb, Admin panel will be opened with a link, which can you share or use to open your web page.

  • Done and enjoy!!! Your web page URL may look like https://etkwv2565bmwgh3ujmnrag-on.drv.tw/test/



You can do the same to host your page on OneDrive.

Note:- Make sure that you trust DriveToWeb
You may be sharing sensitive info with this site or app. Find out how DriveToWeb will handle your data by reviewing its terms of service and privacy policies. You can always see or remove access in your Google Account.

Sunday, 1 November 2020

Textbox to input only number/numeric value in HTML5.

 In this post, we will learn, how to make any textbox in HTML to take the only number or numeric value. This value can be either decimal or float.

It is very easy to create such a textbox using HTML5.

Use the input tag and set type property number

<input type="number" />

So this will not take any value other than numeric, remember that it will take only decimal value, not floating type of number.

If you will input float data like 2.3, it will again be denied like this- 


To take float value you will be required to use step property like this:-

<input type="number" step="0.01" />

Above will take 2 numbers after the decimal and like so on you can define the number to accept.

If you don't want any restriction than use 'any', like this:-

<input type="number" step="any" />



Change image source dynamically on hyperlink

 Changing image source dynamically using JQuery. Here in this example I have created there hyperlink and stored all images in the same folde...