Friday, September 15, 2017

Android Java to Get JSON Data from Server via PHP

The following Android Java codes are based on Android Studio 2.3. In order for Android to obtain information from a server such as the login password verification, the easiest way is to connect to a web server via PHP. Android then establishes a connection to the server through a URL or a link to a PHP script. The following shows the PHP portion of the codes. I named this file testJSON.php: <?php  error_reporting(0);  $all...
Read More »

Monday, August 28, 2017

Javascript to Limit HTML Width for Mobile Devices of Any Orientation

The viewport parameter in the HTML Meta Tag is used to limit the screen width. Another thing to pay attention for these codes is the neccessity to differentiate between tablets and phones. Phones tend to have less resolution whereas tablets can have resolutions comparable to that of PC or Mac. I use a simple criteria to differentiate the two by checking the screen width whether it is wider than 700 pixels. If so, tablets' width will be forced to limit to only 700 pixels. For non-tablets,...
Read More »

Tuesday, April 5, 2016

DIV mask layer not fully covered on top when there is a scroll bar

It's common to create a "mask" layer on top of the page in order to display photos, pop-up messages, etc.I used to use the "absolute" positioning to do the job under I lately discovered the so called "masked" will move if there is a scroll bar (when shrinking the window's size).This problem can be easily solved by just setting the DIV to "fixed" position.Another problem solved! But wait a minute. This solution doesn't work in IE! Let me see if there is a workaround for this...
Read More »

Best Way to Round Up Numbers Using Javascript

I previously found several solutions to round up (float) numbers to closest two decimal places. Some are using complicated function with sofisticated codes but I find this one-liner quite effective and efficient:Math.round(num*100)/100; // for two decimal placesMath.round(num*1000)/1000; // for three decimal places..I appreciate the author who did this and sorry for forgetting where I get it from....
Read More »

Wednesday, March 16, 2016

Login with Facebook using PHP with v5 SDK

It has been a long time since my last post about Facebook. Many things have changed since. This time I want to talk about the new version of Login PHP SDK for Facebook. The latest version of SDK can be found here. I think I can skip to codes directly as all the steps to install the SDK and obtain the app_id and app_secret can be easily found in the internet. But I need to point out the errors...
Read More »

Monday, March 7, 2016

Limit a DIV to Certain Scroll Height with Javascript

This is very popular nowadays. You can see major websites around the internet are having this feature. Why? Important information will not get left out if the web page is scrolled down a lot. This can improve the navigation experience of the website substantially. So how is it done? You may need to know how to fix a DIV before you can fully understand this post. Here are some of my earlier posts...
Read More »

Wednesday, February 24, 2016

Good Looking HTML Table Style

Creating a good looking HTML table sounds easy but when it comes to actual execution, it is not as easy as it seems. Consider the following most basic HTML textbook codes for a 3x3 HTML table: <table border=1> <tr><td>Apple</td><td>Book</td><td>Car</td></tr> <tr><td>1</td><td>2</td><td>3</td></tr> <tr><td>4</td><td>5</td><td>6</td></tr> </table> Here...
Read More »

Thursday, December 31, 2015

Problem Installing phpBB 3.1 Forum on IIS7 Machine

Anyone having this problem? I tried to install this latest phpBB free web forum into my Windows 7 IIS7 PC but I get this error page: I then download the earlier version which is 3.0 by clicking on a small button on upper right corner: After running 3.0 version in the localhost, it works fine: Anyone having this problem on IIS7 machine before? Maybe switching back to older version is the only...
Read More »