Author Archives: admin

Wheel Chair Competition…:)

We had a great competition on 15th July 2009 after work in office…hehehe.. It was really great fun. You will find it rare outside having this type
of competition. Check out some pics my flickr . We have to grab our wheel office chair. Who will go first will become the winner. Hehehe…what a game…:)But we enjoyed. Hope we will arrange this type of crazy stuff more. Hope this will increase our productivity.

Who Moved My Cheese?

I just read a book today.“Who Moved My Cheese?”-by Spencer Jhonson. This book is really great. I am sure it will change your life and make you adopt with change. Just go through the book it will not take more than 1 and half hour. But this book may be change lot in your whole life. Just let me know what do you think which one is your character in the book. I just give a brief about the book taken from the book.

Parts of All of Us

The Simple and The Complex

The four imaginary characters

depicted in this story —

the mice: “Sniff” and “Scurry;’ and

the Little people: “Hem” and “Haw” —

are intended to represent the simple and

the complex parts of ourselves, regardless of

our age, gender, race or nationality.

Sometimes we may act like

Sniff

Who sniffs out change early, or

Scurry

Who scurries into action, or

Hem

Who denies and resists change as he fears

it will lead to something worse, or

Haw

Who learns to adapt in time when he sees

changing can lead to something

better!

Whatever parts of us we choose to use,

we all share something in common:

a need to find our way in the Maze

and succeed in changing times.

Who Moved My Cheese?

Who Moved My Cheese? is the story of four characters living in a “Maze” who face unexpected change when they discover their “Cheese” has disappeared. Sniff and Scurry, who are mice, and Hem and Haw, little people the size of mice, each adapt to change in their “Maze” differently. In fact, one doesn’t adapt at all…

This timeless allegory reveals profound truths to individuals and organizations dealing with change. We each live in a “Maze”, a metaphor for the companies or organizations we work with, the communities we live in, the families we love places where we look for the things we want in life, “Cheese”. It may be an enjoyable career, loving relationships, wealth, or spiritual peace of mind. With time and experience, one character eventually succeeds and even prospers from the change in his “Maze”.In an effort to share what he has learned along the way, he records his personal discoveries on the maze walls, the “Handwriting on the Wall”. Likewise, when we begin to see the “writing on the wall”, we discover the simplicity and necessity of adapting to change.

Download Link

7 things you may not know about me!!

originally started by tony bibbs it is a funny thing indeed. I was tagged by nurul ferdous. Here is my seven secrets those some of you may don’t know.

1) I become fat. J
2) I am wearing glass.
3) I jump from class 3 to class 5. I missed class 4
L
4) My aim was to be a pilot. But now i am pilot of PHP.
5) I am in KSA from 1991. But my mind is in my country.
6) Sleep too much. I mean a lazy guy.
7) Trying to avoid bad habits and become a hard worker.

Here is 7 person I am tagging them
1) A.N.M. Saiful
2) Mahmud Ahsan
3) Arif Hossain
4) Sadiqur Rahman
5) Wei Dai
6) el NiNo
7) abir

And here goes the rules:

– Link your original tagger(s), and list these rules on your blog.
– Share seven facts about yourself in the post – some random, some weird.
– Tag seven people at the end of your post by leaving their names and the links to their blogs.
– Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.

get image width and height using PHP

Sometime we have to get the uploaded image name from database. But we don’t know the image width and height. Width and height may be variable. But we want to know the actual width and height of an image. We can use getimagesize() PHP function to get the width and height of an image.

array getimagesize ( string $filename [, array &$imageinfo ] )

This function returns an array of 7 elements. Index 0 and 1 contains respectively the width and the height of the image.

Example:

<?php

$image_Name = ‘ekram.jpg’;

list($width, $height) = getimagesize($image_Name);

echo “<img src=’$image_Name’ width=’$width’ height=’$height’ />”;

?>

Use any font in your website using SIFR


You like to use your favorite font in your website. But if the user doesn’t have that font installed in his computer then it will not show the proper font. What will you do now? Is there any solution of using font in a website that will show any browser and any pc correctly?
http://wiki.novemberborn.net/sifr3

Yup there is some solution of it. SIFR is one of it. Which recommended by W3C. I use it in one of my website(http://www.toasted2go.com/demo3/). It works well. But it takes little time to load the webpage because of flash. It’s free. You can download the package and know detail about SIFR from following link. Hope you will enjoy it. If you face any problem to use it feel free to ask me.

January, 2009

-> Started blogging in wordpress.com
-> Inspired by the number of visitors in my blog to write something everyday.
-> Inspired to do something in life.
-> Start to share my all ideas with knowledge seekers.
-> Also start to seek Knowledge.

May Allah Show us the right way.

Redirect visitors to new Page

Sometime we need to redirect a visitor to another webpage. There is so many solution to redirect a user. I will show some of them which I know.

HTML

Code

<html>
<head>
<title>Html Redirect Page</title>
<meta http-equiv=”REFRESH” content=”5; url=http://www.mydomain.com”>
</ head >
<body>
You will be redirect within 5 seconds..
</body>
</html>

Description

<meta http-equiv=”REFRESH” content=”5; url=http://www.mydomain.com”>

// This is the part which is redirecting the current page to www.mydomain.com

content=”5; // This means it will wait 5 second and then redirect. you can increase and decrease this number.

PHP

Code

header(“Location: index.php“);

// You have to call this line before any output.

JavaScript

Code

<SCRIPT language=”JavaScript1.1″>
Redirect to main Page
location.replace(“index.php”);
</SCRIPT>

In some server non of above work as redirection. I don’t know why. But the following code work well. Does
anyone know why?

<?php
header(“Pragma: public”);
header(“Expires: 0”);
header(“Cache-Control: must-revalidate, post-check=0, pre-check=0”);
header (“Location: http://www.mydomain.com/”.time());
?>

How to organize PHP Project files?

I am organizing PHP Project files in following way. I don’t know this is standard or not. But it makes my life easier. If anyone knows any standard for organizing PHP files please share with us.


/webroot
/image (all images)
/dev (scripts and images under development – this is a mess)
/doc (document and pdf files that is uploaded or my work description)
/etc (configuration, i.e. database un&pw, etc – restricted perms)
/home (this is where most of the website lives)
/inc (included files)
/func (included functions)
/class (included class)
index.php

Preventing Duplicate Record Insertion on Page Refresh

Most of beginners (including me) face these problems inserting data into database.

When clicking submit button after filluping a form if you refresh the form it will insert the duplicate data. There are two solutions that I know from Google search. May be you can find more by Google search.

And since you cannot avoid a refresh of the screen…

<form action=”insert.php” method=”POST”>
<input type=”text” name=”name”>
<input type=”text” name=”telephone”>
<input type=”text” name=”email”>
<input type=”sumbit” name=”submit”>
</form>

1) If you are doing a form post, you might consider sending a location
header AFTER you inserted the record:

insert.php
// after inserting the data
header(“Location: thanks.php“);
exit();
// do not forget the exit, since your script will run on without it.

In that way your script will process the posting, and then redirects the
browser to thanks.php. This page will contain a message (Thank You). A reload of thanks.php will not result in a fresh db insert.

2) If you’re using sessions, generate serial and supply it as hidden field with
every posting form. Increase it at every post and decline to store data if
serial in the _POST isn’t equal to the one stored in _SESSION.

Combining it with redirects (always good to have such protection), you’ll
probably never got the duplicated submits.

1. Al-Fatihah : The Opening

1. بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِِ

In the name of Allah, the Beneficent, the Merciful

2. الْحَمْدُ للّهِ رَبِّ الْعَالَمِينَ

Praise be to Allah, Lord of the Worlds,

3. الرَّحْمـنِ الرَّحِيمِ

The Beneficent, the Merciful.

4. مَالِكِ يَوْمِ الدِّينِ

Owner of the Day of Judgment,

5. إِيَّاكَ نَعْبُدُ وإِيَّاكَ نَسْتَعِينُ

Thee (alone) we worship; Thee alone we ask for help.

6. اهدِنَــــا الصِّرَاطَ المُستَقِيمَ

Show us the straight path,

7. صِرَاطَ الَّذِينَ أَنعَمتَ عَلَيهِمْ غَيرِ المَغضُوبِ عَلَيهِمْ وَلاَ الضَّالِّينَ

The path of those whom Thou hast favored; Not (the path) of those who earn Thine anger nor of those who astray.