• Saran

  • Saran Chamling loves the web technology, and enjoys designing, exploring and writing about it @sanwebe.com. You can find him at Twitter, Google or Facebook.

Saran's Article(s)

  • Creating PDF Files using PHP FPDF library

    You can use FPDF library to easily create PDF file for your project. It’s a free alternative to other commercial PDF generators. It comes with many features too, which you can use to create a wonderful looking PDF files. FPDF is not an PHP extension, just include the class file in your project and you are ready to go, it works with both PHP 4 and PHP 5.
  • How to Handle JSON data using PHP

    Since JSON appeared on the web, all web services are offering JSON as their primary data format for data interchanging. The reason JSON is so popular is because it is lightweight and easy for humans to read and write. Today I want to show you how we can use this JSON data in our projects using PHP.
  • Redirect users to a new Page

    There are various methods we can use to redirect users to different URL. Let’s have a look at codes below with just one goal. HTML Meta Refresh Tag Most common way to redirect users to another location is using HTML refresh meta tag, just have this code placed within the <head></head> section of your HTML page :Javascript Location And here is another method using Javascript window.location, only downside is if browser doesn’t support Javascript, this code will fail to redirect user to new location://Will take you to sanwebe.com window.location.href = 'http://www.sanwebe.com';PHP Header We can use PHP header to redirect user to new URL easily, but remember there must be NO other output before this code, such as echo code which will trigger “headers already sent” error.Perl Location Here’s perl code to redirect user to sanwebe.com.#!/usr/bin/perl $url = "https://www.sanwebe.com/"; print "Location: $url\n\n";
  • PHP Redirect user to new URL

    To redirect users to new location, just drop this header() line in your PHP file. Remember that header() function must be called before any actual output is sent, otherwise you might run into error.