Posts

Showing posts from July, 2007

How to Redirect Using PHP

Image
A simple PHP script could be use to redirect visitor from the page they entered to a different web page. There is lot of reason you may want to do this including: You may have links that is no longer exists in your domain You don't want anybody to browse your parent directory where you don't have any index page in it Or maybe you may want to shorten your long url like TinyUrl. Using this simple method, they can be seamlessly transfered to the new page without having to click a link to continue. Why use PHP for redirecting? Here's some reason on why we are using PHP for redirecting. Users are redirected quickly and seamlessly When using the 'Back' button, the user is taken to the last viewed page, not the redirect page Works on all browsers However, you have to make sure that your web host do support PHP in order to do this. In this example, assuming Mikey want to redirect his visitor who go to his domain http://mikey.com to his blog Url which is at http://mikey.com/

How to Show and Hide Text in Blog Post

Image
I would like to share on how to make a Show/Hide text in your blog post. I'm sorry if I didn't explain detail enough because I want to keep my post short as I'm in a hurry. However, you can read the detail explanation on Blogger Help . In this example, I assume you have sub topics that you want to make it hidden until reader clicks on the headline. Without the show/hide trick, it would look like this... Title One This is the example text for title one. Title Two This is the example text for title two. Title Three This is the example text for title three. Here's my step to do this... Firstly, edit your template and add the following code in the CSS area. .posthidden {display:none} .postshown {display:inline} Then add the following javascript code on your blog template between the <head></head> tag. <script type="text/Javascript"> function expandcollapse (postid) { whichpost = document.getElementById(postid); if (w