Thursday, February 24, 2011

run cron.php using Windows Scheduled Task.

I used Windows 7.
1. Go to Start - Control Panel -Administration tools- Scheduled Tasks
(For Windows Server 2003, Control Panel - Add Scheduled tasks, for
view old scheduled tasks, double click scheduled tasks)
2, Create basic task, Name: cron.php, Description test
3. Trigger: weekly
4. Action: Start a program
5. Program/script:
c:\php\php-win.exe -f c:\LMS\cron\cron.php
6. Click Finish


How to embed stock market index in your website or blog?

Go to Google Financial Gadget:
Find the financial gadgets you like and embed in your website.
Below are two gadgets I embeded:
1) Canada S&P/TSE (^GSPTSE)

2) Forex Market TV

How to add RSS Feeds to your website?

Step 1: Search the topics you are interested with rss feed. For example:
I am interested in:
Step 2:Go to  and paste the URL in the digest. You can create an account
for free. 
Step 3: Following step 2, you can get JavaScript, or  flash, pdf etc to embed in your website.
Step 4: A sameple of embed RSS feeds in my website as follows:
(One note: about free account in, if your webpage name contains chat, your webpage will be directed to The free account does not support chat. This bug took me long time to figure it out. I need to embed video chat. I have to change the name from chat to talk:

Monday, February 21, 2011

Create an Online public survey form using Google Docs

Step 1 - Create the Google Form

The first step is to create a Google Form from within Google Docs.  You can use form template or survey template. I created a form template as follows:

Remember this address with gform?key, in future you need this address to edit your form

Step 2 - Share

Go to Google Docs, click the document you just created. Then Action->Share->Share setting
->anyone with this link can view, you can see the address for anyone to view in popup
This is a spreadsheet and you may need to let others input in nice web form.

Step 3 -  Find the key for view and user enter data

Go to Google Docs, click the document you just created. View page  source and search formkey and you can find something  like this
Your form address for user enter the data will be:
When user enter data, you can see all entries  in Step 2 URL (Spreadsheet)
Advanced: Submit data to a Google Form with PHP:
Source code:
    $formURL = ";ifq";
    function buildMultipleChoice($group, $heading, $options)
        echo '<div>' . $heading . '</div>';
        echo '<ul style="list-style-type: none;">';
        foreach ($options as $option)
            echo '<li><input type="radio" name="entry.' . $group . '.group" value="' . $option . '">';
            echo $option;
            echo '</li>';
        echo '</ul>';

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<html xmlns="">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>PHP Google Forms</title>
            echo '<form action="' . $formURL . '" method="POST">';
            buildMultipleChoice(0, 'What is your favourite colour?', array('Red', 'Green', 'Blue'));   
            buildMultipleChoice(1, 'What is your favourite fruit?', array('Apple', 'Banana', 'Pear'));
            echo '<input type="submit" name="submit" value="Submit">';
            echo '</form>';  

Saturday, February 19, 2011

create a JavaScript tutorial Website

I created a JavaScript tutorial Website
Using JavaScript to make dynamic website is very interesting.

Friday, February 18, 2011

Create a PHP online tutorial website

I created a PHP online tutorial website:
In this tutorial, I summarized   my experience in PHP programming and  provided practical examples.
In future, I will develop JavaScript, CSS, Actionscript and other computer programming tutorial.

Wednesday, February 16, 2011

Difference between id and class in CSS div

Ids are to be used only once in your html layout. Ids are used for the main elements of the page, such as header, main content, sidebar, footer, etc. Ids have priority over classes. Ids start with # in css

Classes are used for elements that will appear several times on your page. Classes start with . in css

<!--CSS part:-->
<style type="text/css">
#blueidstyle {color:blue}
.redclassstyle {color:red}
<!--HTML part:-->
<p id="blueidstyle">Blue for id</p>
<p class="redclassstyle">Red for class</p>


Blue for id
Red for class

Thursday, February 10, 2011

Actionscript and Flash Media Server (FMS) tutorial from Adobe TV

1)An introduction to basic interactivity and ActionScript 3. Learn how to create a simple UI slider component, invisible buttons, and add basic interactivity in Flash Professional CS3.
2) Lisa Larson-Kelley reveals tips and tricks on working with video in Flash. Get up to speed with demos, how-tos, and interviews in this fast-paced, info-packed series!
Click links to display in the same window.
Flash media server developer center

1) ActionSCript -episode 5 2) Hooking up with FMS 3) Video Encoding Basic

My son's flash work

Saturday, February 5, 2011

Come and Post in My new Forum

I just setup a new forum:
Come and Post. You need to register first by clicking the 6th icon at the top (register). I am quite satisfied the theme.

"Fast Edit" - edit your content Online

You can edit your webpage online using Fast Edit. Fast Edit can also manage your html file online. Fast Edit is free software based on PHP. Unlike other editable software, Fast Edit does not use MySQL.

Please go to the official Fast Edit website at for a full breakdown of features, live demo and downloads.

My Webpage using Fast edit (ou need password to login for editing):

Friday, February 4, 2011

SSL Checker

1 This SSL Checker will help you diagnose problems with your SSL certificate installation.
You can go to
input your server name, you can get information when your SSL will expire
 and which company (such as StartCom) issued the certificate.
2) Another method:

./ssl-cert-check -s -p 443
(replace to your sever)

3) Method 3: Click at the beginning of web address in the navigation bar
to get SSL information.
1. What is SSL and what are Certificates? 

Thursday, February 3, 2011

Install Apache2 SSL on Windows for https

Test in my Windows 7  for localhost, you may need to change localhost to real servers.
 The steps are as follows:
1) Download Apache OpenSSL binary for indows using the links below:
2) Download Win32OpenSLL from
I download two binaries
3) Install Openssl in C:\OpenSSL-Win32
4) Download openssl.cnf from
and save in C:\OpenSSL-Win32\bin, in command prompt
set  OPENSSL_CONF= C:\OpenSSL-Win32\bin\openssl.cnf
5)  cd  C:\OpenSSL-Win32\bin
openssl genrsa -des3 1024 > servername.key
openssl req –new –key server.key –out server.csr
(type password, such as wife*7*9*)
5. openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365
This creates a self-signed certificate that you can use until you get a "real" one from a certificate authority. (Which is optional; if you know your users, you can tell them to install the certificate into their browsers.) Note that this certificate expires after one year, you can increase -days 365 if you don't want this.6.  Save those key files in: C:/Servers/ssl/certs/
6.  Open the httpd.conf file and add (un-comment)
 LoadModule ssl_module modules/
 ( I use the log, I install another module log_rotate_module
LoadModule log_rotate_module modules/

<VirtualHost *:443>
     ServerName egps.localhost:443
     DocumentRoot C:/Users/jiansen/Desktop/CAS/jiansen_dir/www/
     <Directory />
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
       <IfModule rewrite_module>
          #RewriteEngine On
          #RewriteRule !maintenance_msg\.php$ /maintenance_msg.php [R,L]
          RewriteEngine On
          RewriteCond %{HTTP_REFERER} !^$
          RewriteCond %{HTTP_REFERER} !^*$ [NC]
          RewriteRule .*\.(jpe?g|png|gif|bmp|swf|flv) - [NC,F,L]


    SSLEngine on

     SSLCertificateFile "C:/Servers/ssl/certs/server.crt"
     SSLCertificateKeyFile "C:/Servers/ssl/keys/server.key"
     SSLCertificateChainFile "C:/Servers/ssl/certs/server.crt"

     BrowserMatch ".*MSIE.*" \
     nokeepalive ssl-unclean-shutdown

7. To redirect http to https, add following in httpd.conf
<VirtualHost *:80>

    ServerName egps.localhost:80
   # ServerAlias
    Redirect permanent / https://localhost


Tuesday, February 1, 2011

Add facebook like and unlike button in each post in your blog

Result: see my blog. The step is as follow:
1) Log into your blogger account, then go to Layout and click Edit Html.
2) Check Expand Widget Templates box.
3) Find the Code
<div class='post-header-line-1'/>
4) Copy the following code just right under <div class='post-header-line-1'/>

<iframe allowTransparency='true' expr:src='&quot;; + data:post.url + &quot;&amp;layout=standard&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&quot;' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:450px; height:40px;'/>
5) Click save template
6) Done!