Ways to avoid duplicates due to browser refresh

Below are scenarios that may cause duplicates

  1. browser refresh upon successful form submission
  2. browser refresh while the page still processing/loading
  3. resubmit the form again (by clicking on the button more than once)


  1. Post-redirect-get (PRG) – on wikipedia
  2. One easy way is to have injected a hidden parameter with a random hash/number (e.g called token). Upon submission you’ll have to check that the token you expect (which you’ll have probably stored in the http session) is being sent together with the other POST parameters. On valid submission you’ll remove/invalidate this token. That way when a POST comes which a non recognised token then it’s most probably a duplicate or out of date request. source
  3. To check whether the data submitted exist in the database. This is the most tedious part to do and you need to have a unique data for this. i.e. the data must be unique in the table or create a unique data for this purpose sent together with other data.
  4. Add a one-time token to your forms and save it to the $_SESSION-variable. Then if it is used (form is submitted), remove it from the session (or create a new token). If the form is then sent again, the two tokens don’t match and you have a duplicate entry (you can ignore the second for example). source 


Notes on Azure

Some notes on Microsoft Azure

3 type of services provided

  1. App Service –  Scalable Web Apps, Mobile Apps, API Apps, and Logic Apps for any device
  2. Cloud Service – Highly available, scalable n-tier cloud apps with more control of the OS
  3. Virtual Machines – Customized Windows and Linux VMs with complete control of the OS

Important steps you should know in creating an application

  1. Create a “resource group”. All your services will be grouped under this resource group
  2. Create an “app service plan” – package of data center location, cpu and memory size
  3. Create an “web app service” – based on plan and under resource group created in step 1 and 2

More resources and references

  1. More info on services
  2. Azure calculator
  3. VM sizing options – compute, memory
  4. Azure roadmap – see what’s in preview and what have gone generally available (GA)

Summary of Azure services (click to enlarge)

Other readings/resources:

  1. Running a High Volume Website on Azure Infrastructure Services
  2. Azure documentation
  3. Step by step PHP on azure (starting from create resource, web app, transfer file via git, mysql etc)


Some general info for reference regarding MRSM TAR (MRSM Tun Abdul Razak), Pekan Pahang

Jadual pulang bermalam (2017)

  1. 22/07 – 23/07
  2. 26/08 – 03/09
  3. 07/10 – 8/10
  4. 21/10 – 22/10
  5. 26/11 – 31/12

Download borang pulang bermalam
(untuk tarikh yg tidak tersenarai di atas)

Cara penghantaran borang

  1. Isi borang PB di atas
  2. Scan dan email kepada mrsm_pekan @ yahoo.com
  3. Minta anak pergi ke pejabat pada hari Khamis/Jumaat untuk semak keputusan



Maktab Rendah Sains MARA Tun Abdul Razak
KM 29, Jalan Kuantan-Pekan,
Pulau Serai,
43100 Pekan,
Pahang Darul Makmur


No Tel Pejabat: 09-4260163/175/176
No Tel Pengetua: 09-4260170
No Fax: 09-4260170

Related links

  1. tar.mrsm.edu.my
  2. sync
  3. FB official
  4. FB muafakat
  5. mrsmpekan.weebly.com – last updated 2012

Looking for a used car

Getting yourself a used car has some advantages. The most severe one is you save thousands of your money. But need to be very careful in order to get a used car with good condition.

If you are looking for a used car, try out the following websites.

  1. mudah.my – huge list of cars available
  2. carlist.my – most of the list are more or less the same with mudah. especially from car dealer
  3. motortrader.com.my – there is a rating from Goo KANTEI for the condition of the car. For some cars. Can find more cars directly from owners
  4. oto.my – related to paultan.org and carbase.my

the rest not worth to mention here. Don’t have many listings

Some general tips to purchase second hand car

  1. if possible check why previous owner sell
  2. before go to see, ask questions over the phone. The most important one whether the car still available
  3. ask to see the grant
  4. ask for any other charges on top of car price – insurance, roadtax, change name, puspakom service, loan processing etc.

Some tips on checking the condition of the car

  1. sign of accident (normally with uneven paint)
  2. any leaking on engine and absorber etc
  3. the hose and belts are in acceptable condition
  4. test drive to check on engine is smooth and no irregular sounds from the car body or engine
  5. tyre tread still ok, manufactured not more than 3 years