Showing posts with label Articles. Show all posts
Showing posts with label Articles. Show all posts

Friday, November 30, 2012

Number of Users Online script in PHP

Sometime our clients demand for showing how many visitors are online currently on their website. This can be done by many ways. I am going to illustrate two methods of doing this. One is file based and other one is database based. Let us see how to achieve this by both methods one by one.

1) File Based Method:

In this method PHP script writes online visitors information in a text file. That text file is updated after a specific interval of time and script reads that file and show a counter of online visitors where required. Let us see the details of this method step by step,

Step 1) First of all you have to create a .txt file and place it on any folder in your server. In my case I am creating this file on root folder of my website and naming it ip.txt. After updating this file by code, it looks something like this,

127.0.0.1****1354262381++++
127.0.0.1****1354262381++++
127.0.0.1****1354262381++++

Step 2):Then copy and paste the code below where you want to show that counter,

<php
    $url = $_SERVER['SCRIPT_FILENAME'];
    $pp = strrpos($url,"/");
    $url = substr($url,0,$pp);
    $ura = $_SERVER['SCRIPT_NAME'];
    $host = $_SERVER['SERVER_NAME'];
    $ser = "http://$host";
    $ura= $ser.$ura; 
    $pp1 = strrpos($ura,"/");
    $ura = substr($ura,0,$pp1);
    $url1=explode('/', $url);
    $url=array_pop($url1);
    $url1=implode('/', $url1);
    $ura1=explode('/', $ura);
    $ura=array_pop($ura1);
    $ura1=implode('/', $ura1);

    $hm = "$url1"; 
    $hm2 = "$ura1"; 
    include "onlinevisitors.php";
?>


Step 3):  Next step is to create a file named onlinevisitors.php file and place in the folder where you included it in above code. In our case root folder,


<?php
$rip = $_SERVER['REMOTE_ADDR'];
$sd  = time();
$count = 1;

$file1 = "ip.txt";
$lines = file($file1);
$line2 = "";

foreach ($lines as $line_num => $line)
{
 //echo $line."";
 $fp = strpos($line,'****');
 $nam = substr($line,0,$fp);
 $sp = strpos($line,'++++');
 $val = substr($line,$fp+4,$sp-($fp+4));
 $diff = $sd-$val;
 if($diff < 300 && $nam != $rip)
 {
  $count = $count+1;
  $line2 = $line2.$line;
  //echo $line2;
 }
}

$my = $rip."****".$sd."++++\n";
$open1 = fopen($file1, "w");
fwrite($open1,"$line2");
fwrite($open1,"$my");
fclose($open1);

echo "<table width=180 height=30 bgcolor=#fdfdfd style=\"border: 1px green solid;\"><tr><td align=left valign=top>";
echo "</td><td align=center>";
echo "<span style=\"font-family: verdana,arial,helvetica; font-size: 11px; font-weight: bold; color: #aaccaa;\">";
echo "Total users online - <font color=red>$count</font></span><br>";
echo "</td></tr></table>";
?>

2) Database Driven Method:

comming soon...

Wednesday, November 14, 2012

Which Web Programming language to learn to keep you employed?

There are thousands of programming languages out there and have their own value over one and other. But there are a few programming languages which can keep you employed and you don't have to worry about earnings. Learning a right programming language on right time and right place is very necessary for your carrier. There are many examples out there who are not happy with their field and struggling in the market due to this fact. That's why I am going to share with my blog readers about the best programming languages and their scope in different areas of the world.
  • PHP
  • MySQL
  • Javascript
  • Perl
  • Ruby
  • Python
  • ASP.net

Tuesday, November 13, 2012

How to increase PTCL EVO signals

PTCL EVO is one of the best source of wireless internet connectivity and it offers coverage in more than 250 cities in pakistan nationwide. But sometimes eVo customers are returning their devices within 3 days because of dis-satisfaction or no signals at there homes or offices. So i thought there should be some method to strengthen the eVo signals so that customers can enjoy the great internet service out there.

Friday, November 9, 2012

What is radiotherapy treatment?

As x-Rays have been discovered almost 10 years ago and these are being used in medical science. These are used for the diagnosis purpose as well as for the treatment such as radiotherapy. There are two types of radiotherapy,

1. External radiotherapy

2. Internal radiotherapy

External radiotherapy is for external body and internal radiotherapy is used for internal body parts. Radiotherapy is actually used to distroye cancel cells but it may damage normal cells as well. But fortunately normal cells can repair themselves later on.

List of TOP 60 Insurance Companies in Pakistan

Tips on Accessing DSL Router, Modem or CPE

We are going to discuss that how can we access the DSL Modem, Router or CPE to put the internet settings and to configure it.

By following theses simple steps we can access the CPE and establish a connection to internet.

Keep reading this post for complete guide.

Connect the CPE to the Computer:

  1. Connect the Power Adapter to the AC power plug and attach the connector of adapter to the CPE and switch it on.
  2. Attach one end of LAN wire (RJ-45) to the LAN interface of CPE and the other end to the LAN wire to the LAN interface of computer’s LAN card.
  3. Link Indicator lights will lit up and show the connectivity.
DSL Configuration in CPE and Computer:
  1. Go to Start Menu > Control Panel > Network and Internet Connections > Network Connections. Check that the Local Area Connection is enabled. Right click local Area network and click properties.
  2. Double click “internet protocol (TCP/IP)”, Check “Use the following IP address” and make the following settings:
  3. IP Address: 192.168.1.5
  4. Subnet Mask: 255.255.255.0
  5. Gateway: 192.168.1.1
  6. Then, check “Obtain DNS server addresses automatically” and click "OK" to apply these settings.
Now open Internet Explorer and type “192.168.1.1” in address bar and press enter. There must not be any proxy setting in the internet Explorer.

A small pop up window will open as shown in the figure below and ask ”User Name” and “Password” for opening the CPE’s interface.

Enter User Name: “admin” and Password: “admin” and press OK.


You can read this http://our-knowledge-base.blogspot.com/2012/11/how-to-do-ptcl-dsl-modem-and-router.html to learn how to do router settings.

Thursday, November 8, 2012

Techniques of Adding New Widget Sections In Blogger On Different Places?

Adding new widget sections in blogger template is very easy task to do. There are many posts about this topic on the internet but those are very lengthy to read. Purpose of my post is to clear the concept.

If you want to add a widget which should be shown on home page of your blogspot blog then you have to follow these steps.

Step # 1. Go to templates section of your blog and click on html Editor.

Step # 2. Now decide where you want to add new widget section.

Step # 3. And past below code and save.

<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:section class='sidebar' id='magazine-left' showaddelement='yes' >
<b:widget id='Text51' locked='false' title='Test Title 1' type='Text'/> 
</b:section> </b:if>

If you want to add a widget which should be displayed on every page of your blog then you have to past below code in the corresponding area and save the template. All other steps will remain same.

<b:section class='sidebar' id='magazine-left' showaddelement='yes' >
<b:widget id='Text51' locked='false' title='Test Title 1' type='Text'/>
</b:section>

How to do PTCL DSL Modem and Router configuration

Hi guys, today i am going to share with you the most important and useful information regarding PTCL DSL modem configuration. This is a common problem that our internet stops working and we have no knowledge about what to do. There are two methods of configuring PTCL DSL router.


1. Call 1236 Helpline:

One method id to call 1236 PTCL line anf ask them, they should configure you DSL modem remotely and the other method is to configure you modem manually.


2. Manual Method:

2nd method is to do manual configuration. First of all open Internet Explorer and write “192.168.1.1” in address bar and press enter. There must not be any proxy setting in the internet Explorer. This will open a login window and will ask for username and password to access the router console. The default username and password for router is admin/admin. So write admin in username box and admin in password box and click on login button.

How to access router using browser can be found in this post http://our-knowledge-base.blogspot.com/2012/11/how-to-do-ptcl-dsl-modem-and-router.html

Friday, May 18, 2012

Balanced Diet Plane

Hey guys, if you want a perfect diet plane chart, then this post is just for you.

Cereals (per 100 grams) Calories
Breads (per slice) Calories
Vegetables (per 100 grams) Calories
Fruits (per 100 grams) Calories
Desserts (per 100 grams) Calories
Milk Products (per cup) Calories
Others Calories
Bajra 360

Maize flour 355

Rice 325

Wheat flour 341
Chapati (wheat bread) (medium) 119

White bread 60

Paratha (not stuffed) 280
Cabbage 45

Carrot 48

Cauliflower 30

Corn (baked) 84

Cucumber 12

Eggplant (Fresh) 24

Eggplant (Cooked) 69

Fenugreek (methi) 49

French Beans 26

Lettuce 21

Peas 93

Potato 97

Potato (fried- 1 cup) 450

Potato (baked- 1 cup) 100

Potato (mashed- 1 cup) 245

Potato (boiled- 1 cup) 83

Pumpkin (cooked) 33

Spinach 26

Tomato (fresh) 21

Tomato (stuffed and baked) 58

Tomato (baked) 39
Apple 56

Banana 153

Black Grapes 45

Chickoo (Sapota) 94

Cherries 70

Dates 281

Guava 66

Litchies 61

Mango 70

Muskmelon 74

Orange 53

Papaya 32

Peach 50

Pears 51

Pineapple 46

Plums 56

Pomegranate 77

Watermelon 16
Biscuits 399

Boondi ladoo 150

Cake (with icing) 302

Cake (without icing) 218

Cookies (butter cookies) 482

Custard 205

Fruit pie 236

Fruit salad 80

Gujia 501

Gulab Jamun 387

Halwa (atta) 263

Halwa (rawa) 181

Halwa (sohan halwa) 399

Jalebi 494

Jelly 65

Kheer (rice) 141

Kheer (rice-carrot) 226

Malpua 325

Sandesh 57
Buffalo milk 115

Butter (100gms.) 750

Buttermilk 19

Cheese 315

Cow milk 100

Cream (100gms) 210

Ghee (100gms) 910

Skimmed milk 45
Coconut water (100 ml) 25

Coffee 40

Honey (1 tbsp) 90

Orange juice (100 ml) 47

Sugar (1 tbsp) 48

Tea 30

Tomato juice (100ml) 22

Wednesday, May 2, 2012

Tips to Improve Self Confidence

1. Groom yourself

This seems like such an obvious one, but it’s amazing how much of a difference a shower and a shave can make in your feelings of self-confidence and for your self-image. There have been days when I turned my mood around completely with this one little thing.



2. Dress nicely

A corollary of the first item above … if you dress nicely, you’ll feel good about yourself. You’ll feel successful and presentable and ready to tackle the world. Now, dressing nicely means something different for everyone … it doesn’t necessarily mean wearing a $500 outfit, but could mean casual clothes that are nice looking and presentable.


3. Photoshop your self-image

Our self-image means so much to us, more than we often realize. We have a mental picture of ourselves, and it determines how confident we are in ourselves. But this picture isn’t fixed and immutable. You can change it. Use your mental Photoshopping skills, and work on your self-image. If it’s not a very good one, change it. Figure out why you see yourself that way, and find a way to fix it.

4. Think positive.

One of the things I learned when I started running, about two years ago, what how to replace negative thoughts (see next item) with positive ones. How I can actually change my thoughts, and by doing so make great things happened. With this tiny little skill, I was able to train for and run a marathon within a year. It sounds so trite, so Norman Vincent Peale, but my goodness this works. Seriously. Try it if you haven’t.

5. Kill negative thoughts

Goes hand-in-hand with the above item, but it’s so important that I made it a separate item. You have to learn to be aware of your self-talk, the thoughts you have about yourself and what you’re doing. When I was running, sometimes my mind would start to say, “This is too hard. I want to stop and go watch TV.” Well, I soon learned to recognize this negative self-talk, and soon I learned a trick that changed everything in my life: I would imagine that a negative thought was a bug, and I would vigilantly be on the lookout for these bugs. When I caught one, I would stomp on it (mentally of course) and squash it. Kill it dead. Then replace it with a positive one. (”C’mon, I can do this! Only one mile left!”)

6. Get to know yourself

When going into battle, the wisest general learns to know his enemy very, very well. You can’t defeat the enemy without knowing him. And when you’re trying to overcome a negative self-image and replace it with self-confidence, your enemy is yourself. Get to know yourself well. Start listening to your thoughts. Start writing a journal about yourself, and about the thoughts you have about yourself, and analyzing why you have such negative thoughts. And then think about the good things about yourself, the things you can do well, the things you like. Start thinking about your limitations, and whether they’re real limitations or just ones you’ve allowed to be placed there, artificially. Dig deep within yourself, and you’ll come out (eventually) with even greater self-confidence.

7. Act positive

More than just thinking positive, you have to put it into action. Action, actually, is the key to developing self-confidence. It’s one thing to learn to think positive, but when you start acting on it, you change yourself, one action at a time. You are what you do, and so if you change what you do, you change what you are. Act in a positive way, take action instead of telling yourself you can’t, be positive. Talk to people in a positive way, put energy into your actions. You’ll soon start to notice a difference.

8. Be kind and generous

Oh, so corny. If this is too corny for you, move on. But for the rest of you, know that being kind to others, and generous with yourself and your time and what you have, is a tremendous way to improve your self-image. You act in accordance with the Golden Rule, and you start to feel good about yourself, and to think that you are a good person. It does wonders for your self-confidence, believe me.

9. Get prepared

It’s hard to be confident in yourself if you don’t think you’ll do well at something. Beat that feeling by preparing yourself as much as possible. Think about taking an exam: if you haven’t studied, you won’t have much confidence in your abilities to do well on the exam. But if you studied your butt off, you’re prepared, and you’ll be much more confident. Now think of life as your exam, and prepare yourself.

10. Know your principles and live them

What are the principles upon which your life is built? If you don’t know, you will have trouble, because your life will feel directionless. For myself, I try to live the Golden Rule (and fail often). This is my key principle, and I try to live my life in accordance with it. I have others, but they are mostly in some way related to this rule (the major exception being to “Live my Passion”). Think about your principles … you might have them but perhaps you haven’t given them much thought. Now think about whether you actually live these principles, or if you just believe in them but don’t act on them.

11. Speak slowly

Such a simple thing, but it can have a big difference in how others perceive you. A person in authority, with authority, speaks slowly. It shows confidence. A person who feels that he isn’t worth listening to will speak quickly, because he doesn’t want to keep others waiting on something not worthy of listening to. Even if you don’t feel the confidence of someone who speaks slowly, try doing it a few times. It will make you feel more confident. Of course, don’t take it to an extreme, but just don’t sound rushed either.

12. Stand tall

I have horrible posture, so it will sound hypocritical for me to give this advice, but I know it works because I try it often. When I remind myself to stand tall and straight, I feel better about myself. I imagine that a rope is pulling the top of my head toward the sky, and the rest of my body straightens accordingly. As an aside, people who stand tall and confident are more attractive. That’s a good thing any day, in my book.

13. Increase competence

How do you feel more competent? By becoming more competent. And how do you do that? By studying and practicing. Just do small bits at a time. If you want to be a more competent writer, for example, don’t try to tackle the entire profession of writing all at once. Just begin to write more. Journal, blog, write short stories, do some freelance writing. The more you write, the better you’ll be. Set aside 30 minutes a day to write (for example), and the practice will increase your competence.

please share your thoughts about "how to improve self confidence"...keep reading :)

Tuesday, February 7, 2012

The 8 things that your employees need it most


Here you get a raise, like buying a bigger house in the near future, the more normally again.

And a high salary does not cause employees to do their best unintentional. Not based on the dedication, work ethic, and the inspiration for the wage gap.

If you really care about employees of the company, these things, and eight, we need: