Dr. Peter's Financial Systems Blog
Text to search for:
Blog Articles
  • 126. The three virgins
  • 125. My work as an inventor
  • 124. Bad programmers develop email systems at Google
  • 123. Fed & Worldwide interest rate hikes
  • 122. The End of Putin and Russia
  • 121. Disaster in Europe and the end of Ukraine Russia war
  • 120. Is this the end of Ukraine?
  • 119. Proton car salesman
  • 118. Coming worldwide catostrophic diasasters to come
  • 117. President Joe Bideen there is something wrong
  • 116. Does YouTube Malaysia hate non muslims?
  • 115. YouTube increase subscribers and views
  • 114. YouTube is broken
  • 113. open letter to Sundar Pichai, Sergey Brin & Mark Zuckerberg OAuth 2.0 and Contact Us Forms
  • 112. Visions regarding the church and the Chinese
  • 111. The coming worldwide cataclysm
  • 110. President Biden Declares Mass Killings of Armenians a Genocide
  • 109. Checking for clogged arteries
  • 108. President Biden tax revenue from stocks, commodities & forex
  • 107. Thank you President Trump
  • 106. Telecommunications companies billing flaws, bandwidth and other problems
  • 105. President Trump, What has happened to America?
  • 104. Is the China Virus an American Virus?
  • 103. Congratulations to President Elect Biden
  • 102. novel lithium ion battery protection circuit design for longer working life reduce toxic waste
  • 101. Did I cure myself of covid-19 coronavirus?
  • 100. President Trump bless you and recover from the China virus quickly
  • 99. Black lives matter too and so do the lives of the non-Chinese
  • 98. how to overclock cpu with technology that has not been invented yet
  • 97. vaccine lobby conspiracy theory the coming worldwide economic depression
  • 96. laptop refurbished cpu overheating with novel cooling techniques other errors.
  • 95. Letters to President Barack Obama during the great recession of 2008
  • 94. The Cedar of Lebanon is falling. Internet fake news fraud scams and pseudo communist social media companies
  • 93. coconut oil could cure viral diseases coronavirus hiv rubella hepatitis c influenza shingle rabies nipah.
  • 92. YouTube and the death of Western civilization by the coronavirus
  • 91. covid 19 and additional cures and relief for other health problems
  • 90. President Trump infections and the spread of covid-19 until 2024
  • 89. President Trump alternative cures for covid-19
  • 88. President Trump the corona virus and relief from neuropathy nerve pain
  • 87. a potential cure for Covid-19 virus
  • 86. President Trump a potential cure for Covid-19 virus
  • 85. President Trump the effects of the corona virus on the US economy
  • 84. A sad prophecy for Malaysia
  • 83. You are a hero President Trump
  • 82. do not make paul into a god and misunderstanding the laws of Moses.
  • 81. poor protestors rebellion revolution in many countries hong kong bolivia chile peru iraq
  • 80. Star of David Banner
  • 79. Prosperity God Jesus Christ in the churches in malaysia
  • 78. president trump jared kushner $50B palestinian peace plan would not work
  • 77. problems youtube video not showing homemade bread recipe.php
  • 76. php ziparchive not working apache server hard disk full problems
  • 75. LG fridge problems
  • 74. President Trump beware of scams
  • 73. open letter to Sundar Pichai, Sergey Brin & Mark Zuckerberg on proxies, caches and ip addresses
  • 72. open letter to Sundar Pichai, Sergey Brin & Mark Zuckerberg on auctions
  • 71. the tyranny of the turks
  • 70. formulae for Pythagoras Theorem
  • 69. A parallel processing theorem for machine and robotics control
  • 68. Angela Merkel should be nominated for the Nobel Peace Prize
  • 67. Why does the church not want the Ten Commandments?
  • 66. responsive web design for all devices using php superglobal variables
  • 65. We cannot block hackers anymore
  • 64. Books & e-books for sale
  • 63. Comparison of indices DJI, S&P 500, NYSE, NASDAQ and interest rates
  • 62. Predicting the NASDAQ trend from 2016 to 2020 and the S&P 500 from 2017 to 2022
  • 61. Forecasting the NYSE and the DOW Jones Industrial for 2018 to 2022
  • 60. my letters to the prime minister during the 1997 Asian Financial Crisis
  • 59. The way forward
  • 58. Wake up Israel it is time
  • 57. The Calling of the Lord
  • 56. Congratulations President Trump on the bombing of the Syrian military base
  • 55. President Trump and the 7 muslim nations
  • 54. Cure for diabetes and neropathy nerve pain
  • 53. Thank you President Barack Obama
  • 52. healing from ankle and knee joint pain with stem cell products.php
  • 51. Congratulations to President Trump
  • 50. Obamacare
  • 49. High cost of insurance premiums
  • 48. Past predictions and the price of gold
  • 47. Save the children
  • 46. Sino Russian world war and the end of America
  • 45. The Lord Gods blessing and generational curses and gays lesbians
  • 44. Slowing economic growth
  • 43. False teachings in the church in Malaysia
  • 42. Banking problems in Malaysia with AmBank
  • 41. Banking problems in Malaysia
  • 40. Historical-performance-of-my-commodity-price-prediction-charts
  • 39. Major changes to the earths continents to occur if Israel is divided
  • 38. Block hackers bad bots scrappers stop ddos attacks wordpress blog sites
  • 37. China starts world war 3 with rampant piracy and bullying smaller nations
  • 36. Powerful nontoxic insecticide used in my kitchen for exterminating ants
  • 35. Soybean prices forecast chart 2013 2014 2015 2016
  • 34. Palm Oil price trend prediction 2012 2013 2014
  • 33. NYSE Composite Index prediction of 2015 Bull Run
  • 32. Brent-crude-price-forecast-2012-2013-2014
  • 31. Congratulations-President-Barack-Obama
  • 30. Indian stock exchange nifty index prediction chart
  • 29. Soybean prices commodity chart prediction for day traders and others
  • 28. Huduh is not for malaysia and the errors in huduh
  • 27. My rapeseed commodity chart prediction useful for day traders and others
  • 26. Problems problems and more problems
  • 25. stock chart signals and price action patterns - by Steve Sollheiser
  • 24. Malaysian property prices and the property market
  • 23. Malaysian population growth and Malaysian property prices
  • 22. False teachings of the muslim terrorist
  • 21. The alternative technical analysis for commodity and stock market analysis
  • 20. Malaysian property price, bubble and crash in 2012
  • 19. The basics of stock market, forex, commodity and financial economy models
  • 18. Gold price and business opportunities
  • 17. US Economic recovery and growth part 4
  • 16. US Economic recovery and growth part 3
  • 15. Gold price forecast trend chart 2011 2012 2013 2014 2015 2016
  • 14. US Economic Recovery and Growth Part 2
  • 13. US Economic Recovery 2009 2010 2011
  • 12. How to predict gold price trend 2011 2015
  • 11. Malaysian property prices and the property bubble
  • 10. Distribution of Wealth Model and Supply and Demand
  • 9. Gold price forecast 2011 2015
  • 8. Explanation of inflation and model of inflation hyperinflation
  • 7. Approximate silver price trend prediction chart june sept 2011
  • 6. how to predict stock and commodity trends
  • 5. Causes of economic crisis recession and high inflation or hyperinflation
  • 4. What is inflation and how to manage inflation
  • 3. Making sound investment decisions
  • 2. forecasting commodity and stock market trends
  • 1. Dr. Peters Loan Calculator
    « We cannot block hackers anymore
    Money cannot intoxicate but greed can
    - Dr. Peter Achutha, 18 July 2009
    Why does the church not want the Ten Commandments? »

    responsive web design for all devices using php superglobal variables

    popup technology

    I have been a website programmer since about 2010. As a self-taught PHP & HTML programmer I did not have the luxury of being trained by an expert and most of my skills come from reading articles on the internet and from experimenting with different types of code.

    I remember in the early days we had to specify the dimensions of images shown on our websites. For example

    This was to improve load times and reduce the amount of work your browser had to do to generate a webpage and to improve your ranking in Google search results. All that is now outdated, thanks to the advent of Tablets, iPad's & Smartphones.

    HTML changed with IPad's, Tablets & Smartphones

    Now we should not specify the dimensions of the image. For example:-

    Furthermore, the web browser developers introduced viewports into meta data of PHP scripts and media queries into CSS (Cascading Style Sheets). For example

    Honestly, it appeared to me that the Cascading Style Sheets (CSS) required a degree course study before being competent in CSS. It was tough trying to go through all the literature on the internet and making sense of what you were looking for. Later I found out that some devices had different pixel dimensions from the actual the screen size. Was I correct about that?

    After struggling for many years, trying to make fancy website designs, our Lord Jesus Christ, two weeks ago, instructed me to look at the HTTP User Agent. That blew me away. It suddenly became very easy to design websites, doing responsive web design, for differing screen sizes.

    At the very beginning of PHP script I checked for the type of device used by the visitor of my website. See the code I am using below:-

    The variable $whichdevice informs me before any program execution which device the visitor is using. Wonderful!

    You can view the photos of the screens of the 3 different devices in a test example web site.

    A wide range of T-shirts for men and women. Fitted Cotton/Poly, Unisex, Hoodie . . . Now include Tote Bags, Mugs and Stickers. A wide range of T-shirts for men and women. Fitted Cotton/Poly, Unisex, Hoodie . . . Now include Tote Bags, Mugs and Stickers.

    Firstly for the PC screen

    PC screen view

    You will notice the screen has a row of 5 images.

    For the iPad view

    iPad screen view

    You will notice in the iPad view there are only 3 images per row on the screen view. I could not change the number of images in a row with CSS. With CSS, the iPad view would show 5 smaller images in each row instead of 3 original size images.

    For the smartphone view

    mobile screen view

    In the screen view of the smartphone there is only one photo per row.

    Personally, I don't think you can do this with CSS as I have failed at using CSS to achieve 3 different views. The advantage being that I can specify the image dimensions in PHP script so that the browser does not have to recalculate or adjust the image dimensions. The 'load to view' times will be much faster using $_SERVER['HTTP_USER_AGENT'] to identify the device used.

    The only other requirement that I need is the screen dimensions of the visitor. I don't think that modern browsers are sending the screen dimension anymore. It would be very helpful if a new global variable was assigned for this. For example:-


    As long as it returns, say, '800x600' or '320x450' or other dimensions, we will know the screen size, how to arrange the design of the webpage and know which image sizes to send to the visitor's browser. Furthermore, as they tilt the smartphone we can set < div > tags to show images of different widths using the current media CSS. For example, even this may be possible:-

    How to determine which images are sent to the visitor

    It is very straight forward to select which images will be sent to the visitor. In the simplified example, that I am using for one image on this page, I only check if the visitor is using a smartphone. If the visitor is using a smartphone I send smaller pictures. For all other devices I send the larger images. That was brilliant smartphone website design.

    Review of FireFox, Opera, Chrome Browsers

    After some initial investigation I found out that the almost best browser for smarphones is the Opera Mini (version 33.0.2254.125672) but sometimes it is just awful.

    Further more, FireFox (version59.0.2) shows the whole screen correctly but shows the PC view. You will need to click on the 'simplified' view button to show it as a mobile view. When in mobile view it does not display any writings that are in the HTML < textarea > ... < / textarea > tags.

    As for Chrome (version 65.0.3325.109) browser, it does show the whole page but the images are rescaled to smaller versions - sometimes. When you click on the 'simplified' button the < textarea > writings do overflow off the right of the screen even though the width of the < textarea > is limited to 300px. Other than that the 'mobile' images fit within the screen area.

    After further investigations both Chrome and Firefox displayed my OPPO A71 smartphone screen very well once you reloaded the web page. But Chrome kept reloading as a PC web page and can be unpredictable as sometimes it loads correclty as mobile view and sometimes as PC view. Opera became unstuck. After a while it would not display this page in mobile view, only in PC view. That was very irritating. Overall Firefox seems to be able to cope with the mobile web pages pretty well.

    I wonder if the browsers are looking for media css and if they don't find it they automatically display the page in PC view and not mobile view. Shouldn't they check if the images widths fit within or are smaller then the screen size before trying to view it in PC view instead of keeping them as mobile. Shouldn't the browsers try to load the page as mobile view before switching to PC view? I say this as when I retested the mobile displays I found differences in the response.

    Chrome has to be reloaded/refreshed to display in mobile view but sometimes it was stuck in PC view and would not respond to anything. FireFox appears to display the page correctly in mobile view - it didn't initially as it behaved like Chrome. For some reason Opera stopped showing the web page in mobile view and only in PC view and it would not limit the < textarea > to within 300px as in the script. And yes I know that the web browsers have a lot of work to do before they can display correctly and none of them are perfect - just some feedback.

    A world of difference using $_SERVER global variable

    In my previous article on blocking hackers I had recommended some new $_SERVER global variables. In this article I am recommending one more. Using $_SERVER global variables opens up a whole range of PHP design and processing options available to us. This webpage was created by using $_SERVER variables without inserting any media css code. Please use a smartphone, an iPad, a tablet (not yet tested with a tablet) and a PC to view the page.


    I spent some years developing a cache of WordPress. It is called the SuperFast Cache plugin for WordPress. The SuperFast Cache by its self is an average cache but when it is runs in parallel with the Bad Bot Exterminator Pro they have a blazing performance. For years I could not find a WordPress cache that was faster than the combination of the SuperFast Cache and the Bad Bot Exterminator. The Bad Bot Exterminator Pro will be relaunched in a few months' time as I am making many improvements to it.

    I mentioned my cache plugin as I noticed that I will have to upgrade it with this different approach to the different devices. All caches will have to identify the visitor's device and send them the cached page for that type of device. That means that all CDN's will have to implement minor upgrades to their services to handle the different webpages for different devices.

    Using PHP superglobal variables goes a long way to simplifying web site design and development for PC's, Mac's, iPads, Tablets and Smartphones.

    - Dr.Peter Achutha, 3rd May 2018

    Please do show me your appreciation of this article by Buying me a coffee.

    And do get the "I Won" t-shirt


    Copyright © 2013 - 2024 Peter Publishing - All Rights Reserved