Alternating Table Row Colors

Posted by Santhosh Kuma on May 22nd, 2008
* * * *   3 votos

This tutorial will provide you with a basic concept for creating alternating row colors. Using while loops and generating a list from the mysql table.

Firstly, Save the sql structure below as data.sql and upload the sources to your mysql database

#
# Table structure for table data_list
#
CREATE TABLE `data_list` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(50) NOT NULL default '',
PRIMARY KEY  (`id`)
) TYPE=MyISAM;
#
# Dumping data for table data_list
#
INSERT INTO `data_list` VALUES (1,'Ford');
INSERT INTO `data_list` VALUES (2,'Toyota');
INSERT INTO `data_list` VALUES (3,'Mitsubishi');
INSERT INTO `data_list` VALUES (4,'Honda');
INSERT INTO `data_list` VALUES (5,'Chevrolet');
INSERT INTO `data_list` VALUES (6,'Mercidez Benz');
INSERT INTO `data_list` VALUES (7,'Isuzu');
INSERT INTO `data_list` VALUES (8,'Jeep');
INSERT INTO `data_list` VALUES (9,'Suzuki');

Secondly, Once you have done creating and uploading your database structure. You can start working on table.php.

1
2
3
4
5
6
7
8
9
<?php
$dbhost = 'localhost';  // Change to your host. 
$dbuser = 'USERNAME';  // Change to your user. 
$dbpass = 'PASSWORD'; // Change to your password.
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
// $dbname relates to the database name you gave when setting up the mysql settings.
$dbname = 'DATABASENAME';
mysql_select_db($dbname);
?>
10
11
12
13
<table border="1"><tr>
<td bgcolor="#FF9900"><strong>No.</strong></td>
<td bgcolor="#FF9900"><strong>Company</strong></td>
</tr>

This section above is the start of the table with its headers

The last section above is self explanatory.

To view a live Demo : Click Here!
To Download the script above : Click Here!

Unique Hit Counter

Posted by Santhosh Kuma on May 21st, 2008
* * *     1 votos

This is a PHP hit counter that logs one occurrence of each visitor’s IP address. It then displays an accurate count of the total number of unique visitors to your website.

The script is placed on your page wherever you would like the hit count to show (usually on a home page). Every time that page is accessed, the script checks a log file for the user’s IP address. If it finds a match, the count is not advanced. If it does not find a match, the count is incremented by one and the new IP is appended to the log file. The count is displayed on screen.

Files You will need crip_hits.php and crip_hits.txt (should be blank).

Brief explanation on crip_hits.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Don't forget to CHMOD $file to 777 */
$file = "crip_hits.txt";
 
// Obtain users IP address
$ipadd = getenv(REMOTE_ADDR);
$addip = "TRUE";
$hits = 0;
 
if (file_exists($file))
{
} else
{
echo "$file does not exist!";
exit;
}

The above code will obtain the ip of the visitor and also checks for the log file, it displays a error message when the log.txt file is missing and ends the script.

This part opens the log file and checks for the ip of the visitor and ends if the ip is already logged.

Lastly, if the ip of the visitor is NOT logged. The script will open the .txt file and log the ip. It than displays the count on the page.

Embedding PHP in HTML
If you want to embed the counter to your html pages, you will need to edit the .htacess file in your Apache Server.

1
AddType application/x-httpd-php .htm .html

INSTALLING

  1. Copy the script from crip_hits.php and paste it directly into your HTML code where you want the count to show. Save the file.
  2. Upload the saved file and crip_hits.txt to the same directory (folder).
  3. Upload the .htacess file to where your main index page is located
  4. CHMOD crip_hits.txt to 777.
  5. CHMOD .htacess to 777.

NOTE: You must upload the blank crip_hits.txt file for the script to work correctly. If crip_hits.txt is not present when the script is executed it will display an error message in the count! The file will not be automatically created!

To Download the script above : Click Here!

Maintaining the Relationship

Posted by Santhosh Kuma on March 20th, 2008
          0 votos

Once you have established a relationship with your customers, you’ll need to find ways to maintain the rapport. You have several options for implementing maintenance, but they all boil down to one issue: Customer Satisfaction.

Because relationship commerce relies on customer-oriented activities, customer satisfaction is key. If customers find themselves against a wall with your customer service, you will lose the relationship you build with them. To maintain customer service, consider the following:

  • Be accessible. Give out as much contact information as your customers need to contact you. Also help them give you as much information as you need with appropriate prompts within contact forms. For example, ask them to define exactly the ares of the site where they experienced a problem.
  • Be prompt. Reply immediately to their correspondence with am auto responder that tells them when their e-mail will receive attention and what they should do if, for some bizarre reason, they don’t receive a reply within a certain time period. Then reply to them as soon as possible.
  • Be available. Consider using a real-time customer service forum for customers to chat live with customer service representatives who are able to answer questions.
  • Empower your customer service representatives. Give them the authority to do what they need to in order to resolve an issue or to placate an upset customer.
  • Follow up. Use a customer service hierarchy that allows a supervisor to personally contact customers who have experienced problems. The supervisor then can ensure that the issues were resolved to the customers’ satisfaction or make amends otherwise.

Displaying Privacy, Security, and Refund Policies

Posted by Santhosh Kuma on January 6th, 2008
* *       1 votos

When customers consider whether to do business through your site, they may be very interested in the posted policies regarding privacy, security, and refunds. If you provide information to them, customers realize your company is open about its dealings and is willing to guarantee certain rights that customers retain.

Posting these policies actually places control back into the hands of the consumer. Afterall, if you state at your site that you offer a 30 day money-back guarantee for dissatisfied customers, they know you’ll stick to it or riskĀ a lawsuit. How does each policy type, privacy, security, and refund protect the customer and add to trust?

Privacy policies let customers know pieces of information they provide will be used by your company, and it allows them to discern whether they should provide certain information. If you are frank about who will have access to what sensitive information, and you allow them to modify, add to, or delete certain information, they remain in control, and trust increases.

Security policies let customers know the lengths you will go to in order to protect their information from crackers, as well as any guarantees you offer about the security of your site in general. For example, if your company stores information for the customer, and if some catastrophe, whether physical or cracker, results in the loss of that data, you might guarantee that off-site backups will restore information within a certain time period. Again, when customers know what you’ll do to protect their interests, they’ll trust your company more.

What if customers have a problem with the quality of the product or service they receive? Do you make guarantees to your customers, giving them control of the situation if they find the delivered goods unacceptable? Or are they stuck with the deficient product and out whatever money they spent receiving the goods? IF you let them know ahead of time what to expect from you by including a refund policy on your site, your trustworthiness will increase.

Offering Anonymity/Identity

Posted by Santhosh Kuma on January 1st, 2008
          0 votos

Never, ever be anonymous to your customers, but allow them to be anonymos to you. Let customers know exactly who you are. Include pictures of employess, if appropriate, on your company information pages. Let the customers see that there are actual people and NOT SCHEMING THIEVES!

Give them a physical address so they know your company isn’t a fly-by-night operation. Show them that you are in the public eye and don’t mind the spotlight because you have nothing to hide.

Allow your customers to shield their identity from you as much as possible, however. Sure, if you have to deliver a product to their door, you’ll need a shipping address. you’ll need a name and credit card information if they want to pay by credit card. But do you really need to know their household salary, the number and ages of their children, and what types of junk mail they like to receive? Absolutely not. The information is helpful to you from a marketing standpoint, but it won’t make or break your company.

Don’t require customers to give any information that isn’t absolutely necessary. If customers is anonymous, you, as a company, are less able to take advantage of them or to compromise their privacy, security, or peace of mind. By default, trust level increase.


Copyright © 2007 Cripperz Articles! Your Daily Dose Of Materials. All rights reserved.