RSS

Home

  • Website Development and Website Hosting

    Parampal 1:19 pm on March 27, 2009 | 0 Permalink | Reply

    In need of a website, CRM or a web application but don’t really know where to start?

    Please send me an email contact@parampal.com outlining what you need and I can help.

    • I work at competitive rates, and guarantee excellent results.
    • I have a strong knowledge base in all major web programming languages such as PHP, ASP, CGI and AJAX.
    • I have experience in using all popular CMS technologies such as:
    • I have worked commercially in the CRM field, using Sugar CRM and have developed a separate CRM portal myself.
    • Web hosting for all applications that I develop is given at a minimal cost price fee.
    • I also offer hosting for applications not developed by myself, and provide other hosting services such as CPanel, email, domain registeration.
     
  • Ajax Tutorial

    Parampal 6:34 pm on August 28, 2009 | 0 Permalink | Reply

    What does Ajax mean?

    Well it basically stands for Asynchronous JavaScript and XML and basically allows you to interact with your webserver using javascript on the fly (without having to refresh your page).

    What can Ajax do?

    AJAX can communicate directly with the server, with the XMLHttpRequest object. With this object, a JavaScript can trade data with a web server, without reloading the page! AJAX technique makes Internet applications smaller, faster and more user-friendly!!

    How do I communicate with my webserver on the fly?

    Create the XMLHttpRequest object

    Like I said, AJAX can communicate directly with the server using the XMLHttpRequest object. To create a XMLHttpRequest object you need to use the following code snippet


    var xmlhttp;

    if (window.XMLHttpRequest) {

    // code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }

    else if (window.ActiveXObject) {

    // code for IE6, IE5
    xmlhttp=new ActiveXObject(”Microsoft.XMLHTTP”);
    }

    else {

    alert(”Your browser does not support XMLHTTP!”);
    }

    Send the request to the web server

    To send a request to the web server you need to use two methods from the XMLHttpRequest object, open (which tells the object which file on the server you are requesting) and send (which sends the request out to the server). See the example below


    xmlhttp.open(”GET”,”test.php”,true);
    xmlhttp.send(null);

    Get the response from the web server

    Now you need to use the onreadystatechange method of the XMLHttpRequest object, which gets called to process the response from the server.

    Inside the onreadystatechange method you need to retrieve the response from the web server. Before you do, you need to check to see if the response has been sent (ie. the XMLHttpRequest object is in a ‘ready’ state).


    // Gets called to process the response from server
    xmlhttp.onreadystatechange=function() {

    // Check the status of the response
    if (xmlhttp.readyState==4) {

    // Data sent back from the web server
    responseFromWebServer=xmlhttp.responseText;
    }
    }

    Final Code

    function ajaxFunction() {

    var xmlhttp;

    if (window.XMLHttpRequest) {

    // code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }

    else if (window.ActiveXObject) {

    // code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

    else {

    alert("Your browser does not support XMLHTTP!");
    }

    // Gets called to process the response from server
    xmlhttp.onreadystatechange=function() {

    // Check the status of the response
    if (xmlhttp.readyState==4) {

    // Data sent back from the web server
    responseFromWebServer=xmlhttp.responseText;
    }
    }

    xmlhttp.open("GET","test.php",true);
    xmlhttp.send(null);
    }

    Practical example

    Below is a practical example using AJAX to retrieve the current time from the webserver, once the user has started entering there username.

    The Webpage Form

    The form has two fields, the first is the username, and the second is for the current time. As you can see, once you start typing in the username field the ajaxFunction(); will be called, this is where the ajax will go.


    form name="myForm">
    Name: input type="text" name="username" onkeyup="ajaxFunction();" >
    Time: input type="text" name="time" >
    /form>

    The Ajax code

    This is the ajax/javascript function which will retrieve the date from the server and place it in the date text field we made in the form. Its essentially the same as the previous example in the tutorial except we are now doing something with the data we retrieve from the server.

    function ajaxFunction() {

    var xmlhttp;

    if (window.XMLHttpRequest) {

    // code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }

    else if (window.ActiveXObject) {

    // code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

    else {

    alert("Your browser does not support XMLHTTP!");
    }

    // Gets called to process the response from server
    xmlhttp.onreadystatechange=function() {

    // Check the status of the response
    if (xmlhttp.readyState==4) {

    // Data sent back from the web server is now being stored into the date text field
    document.myForm.time.value=xmlhttp.responseText;
    }
    }

    xmlhttp.open("GET","date.php",true);
    xmlhttp.send(null);
    }

    The Server code

    This file is called from the Ajax code and its output is sent back as a response to the browser (which is given by xmlhttp.responseText in the ajax code). All I am doing here is outputting a date using PHP, nothing complicated at all :) . Note you can make the server file as complicated as you like, for example many people use it to retrieve records from the database, allowing users to make database interactions on the fly!

    echo date("Y/m/d");

    And thats it! For more comprihensive tutorials on Ajax visit some links below which I strongly reccommend.

    http://www.w3schools.com/Ajax
    http://www.tizag.com/ajaxTutorial/

     
  • Mos Def The Ecstatic

    Parampal 8:06 pm on June 25, 2009 | 0 Permalink | Reply

    Album Cover

    Mos Def's new Album 'The Ecstatic' Album Cover

    Mos Def has a new album out called ‘The Ecstatic’. Musically, Ecstatic is diverse, rhythmic, and gritty. Beats by Madlib, J Dilla, and Oh No serve as a backdrop for Mos Def’s thoughtful musings on politics, society, and relationships. The album is light on guests. Slick Rick shows that he hasn’t lost his storytelling chops on “Auditorium,” while “History” reunites Mos Def with his Black Star partner Talib Kweli over a grim J Dilla beat.

    My Favourite tracks from the albums:

    1. Auditiorium ft Slick Rick
    2. Priority
    3. Life in Marvelous Times
    4. History ft Talib Kweli
    5. Casa Bey
     
  • Most viewed video's online

    Parampal 10:13 am on May 7, 2009 | 0 Permalink | Reply

    What are the most viewed viral videos of all time? Visiblemeasures.com recently came out with an estimation which compilies the hits recieved from every video from the most popular video sharing websites. See below for those who made it into the 100million club:

    The Visible Measures 100 Million Views Club: May 1, 2009
    Rank Title Type Label / Studio True Reach Months Available
    1 Soulja Boy: Crank That Music Video Universal 356,300,000 21
    2 Twilight Movie Trailer Summit 266,500,000 14
    3 Mariah Carey: Touch My Body Music Video Universal 230,200,000 14
    4 Jeff Dunham: Achmed the Dead Terrorist User Generated - 196,500,000 19
    5 Susan Boyle (Britain’s Got Talent) TV Show Freemantle/iTV 186,000,000 0.7

    Source: http://www.visiblemeasures.com/news-and-events/blog/bid/9262/The-100-Million-Views-Club-the-Most-Watched-Viral-Videos-of-All-Time

     
  • Barack Obama meets Brian Lara

    Parampal 10:13 pm on May 2, 2009 | 0 Permalink | Reply

    I came across this image of the Brian Lara and the US president Barack Obama. The image is copyrighted by the white house

    Brian Lara and Barack Obama

    Brian Lara and Barack Obama

    See cricinfo blog post for more details: http://blogs.cricinfo.com/thebuzz/archives/2009/04/the_president_meets_the_prince.php

     
  • Improve your self confidence

    Parampal 12:26 pm on April 23, 2009 | 0 Permalink | Reply

    Recently I have been doing some research on ways I can improve myself generally and found the most common way people try to go about doing this is by improving there self confidence.

    Although some factors are out of our hands, there are some simple ways we can improve our self confidence:

    • Dress Sharp : An easy way for people to notice you (in a good way) will be to dress well, im gives a good first impression and helps you stand out of a crowd. Being noticed is key to overcoming shyness and improving self confidence.
    • Walk Faster : When you walk fast im makes you (and others) feel like ‘you have places to be, people to visit’.
    • Good Posture : Standing tall projects confidence to a T, the more confident people think you are, the more confident you are going to feel.
    • Write and Recite a speech about yourself : Highlighting your strengths and goals in a speech, saying positive things outloud about yourself will eventually make you believe them
    • Gratitude : List everything you have to be grateful for. Recall your past successes, unique skills, loving relationships, and positive momentum.
    • Compliment other people : Easiest way to recieve complements back yourself and feel better about yourself. Avoid getting into discussions / gossip about putting people down, think of other people in a positive light instead of negative.
    • Sit in the front row : Get noticed by the important people, avoid hiding and being shy in front of a large crowd and meet new (possibly smarter) people who want to listen to whats being said.
    • Speak up : Be heard, people are usually very accepting of what people say (not matter how silly).
    • Work out : Improving your appearance will make you feel good about yourself, and it will noticeable.
    • Focus on contribution : Trying focusing on things other than yourself, for instance finding ways to help people (im tring that by writing this blog post :p)
    • Start to like yourself : There are a lot of people out there a lot worse off than you. Does your current ‘issue’ about your body hurt you in anyway or affect your life in any major negative way, again the answer is no.
    • Define your attitude : Especially towards things you dont want to do – dont get pressured into things you dont want to do.

    Sites that I found very useful in this area, which might help you:

     
  • The human brain described using the internet, computers and IT

    Parampal 9:10 am on April 19, 2009 | 0 Permalink | Reply

    I was reading this article the other day written by a Dr/researcher, Dr Seth Grant, and he was explaining the brain in terms of computers and networks, so I thought id share.

    The human brain is considered the most complex biological entity known to man;

    • It is built from 100 billion nerve cells (neurons)
    • Each one of the these nerve cells is connected to perhaps 1000 other nerve cells
    • These connections are called Synapses

    Where is the IT stuff?

    • Well, each Synapses can be considered as a computer! Which processes and stores information
    • So we can think of the brain as we do the internet – an enormous network of computers
    • And it may surprise you to know that one human brain has a million more times the connections than the entire WWW
    • Its this enormous computational power that generates the numerous behaviours we use every day!

    The article by Dr Seth Grant goes on to talk about human behaviour and how animal and human behaviour isn’t dis-similar. And if we were to have a greater understanding of how humans or animals think we could get a blueprint of how the brain works. This in turn would give us a great understanding of thought and may help diagnose / treat mental disorders and other brain diseases.

    To find out more about Dr Grant click here. Please note this blog post was paraphrased from an article written by Dr Seth Grant (SAM, Autumn 2009, USYD)

     
  • Using Wordpress as a CMS

    Parampal 9:25 am on March 28, 2009 | 0 Permalink | Reply

    Recently I chose to use the popular PHP blogging software Wordpress as a fully blown CMS for a recruiting website that I needed to develop. Coming from a Joomla, CMS Made Simple background I found wordpress completely satisfied my needs as a CMS developer. It showed to have:

    1. A customisable User login / registration (using the Register Plus plugin)
    2. Customisable forms which allow you to process form data and error handling during all stages of a form submission. (using the cforms plugin)
    3. Accessing and understanding the database was relatively easy
    4. I could easily locate a large number of free themes to pick from, which look professional and elegant (see themes websites: http://topwpthemes.com and http://wordpress.org/extend/themes)

    One obvious fact I noticed straight away was that wordpress relies on plugins to do anything beyond the basic blogging task. Fortunately there are already existing plugins for most advanced features that you might require – below I talk a bit about the above points in more details.

    1. Register Plus

    http://wordpress.org/extend/plugins/register-plus

    I used this plugin to extend my user registration form, to contain beyond the basic fields such as name and email. The installation and configuration is all done in the admin area under the Users tab and is all self explainatory. See screen shot below for what the admin area looks like

    Register Plus Admin Console Screenshot

    Register Plus Admin Console Screenshot

    2. cForms

    http://www.deliciousdays.com/cforms-plugin

    Allows you to create customised forms, with fields of all types. It gives you the option of using ajax in your forms for submission and error checking and is very easy to install and configure.

    To handle data submitted by forms you simply place your code within the wp-content/plugins/cforms/my-functions.php file. In this file you will find numerous functions commented out, each function serves its own purpose and allows you to retrieve the form data during different stages of the form submission process. For example, if you need to do something after validation, but before processing has been completed by cforms you will put your code in the my_cforms_filter() function (or the my_cforms_ajax_filter() function if you chose to use ajax). If you need to run code after all the processing by cforms is complete you should place your code in the my_cforms_action() function. See below for an example my_cforms_action() function


    function my_cforms_action($cformsdata) {

    $formID = $cformsdata['id'];           /* This is the form id used when you create your form - this is so you can perform processing for a specific form */
    $form   = $cformsdata['data'];         /* This contains all the form data posted */

    //job application form
    if ( $formID == '2' ) {

    $application_data = array (

    'email' => $form['Email'],
    'first_name' => $form['First Name'],
    'last_name' => $form['Last Name'],
    'date_applied' => $date_applied,
    'note_id' => $note_id,
    'note_file_extension' => findexts($form['Resume[*2]']),
    'comment' => $form['Comment'],
    'file' => $form['Resume[*2]']
    );

    .....

    }

    3. Understanding the wordpress database

    Understanding the wordpress database structure was not a difficult task. When manipulating the database there are only really 4 tables you need to concern yourself with:

    • wp_terms: Creates a generic term
    • wp_term_taxonomy: Allows you to label a term as something more significant, such as a category
    • wp_posts: Stores all posts, pages and revisions
    • wp_term_relationships: Stores all the labels for a given post. For instance this would store every category a single post has been placed under. This therefore needs to store a reference to the wp_posts and wp_term_taxonomy tables

    4. Wordpress Themes

    Wordpress themes are similar to plugins, they basically control the way your page looks. You can freely find themes on the web, here are a bunch of my favourite theme sites:

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel