Opening multiple connection in MySQL


$handle_db1 = mysql_connect("localhost","myuser","apasswd");
$handle_db2 = mysql_connect("127.0.0.1","myuser","apasswd");
$handle_db3 = mysql_connect("localhost:3306","myuser","apasswd");
$handle_db4 = mysql_connect("localhost","otheruser","apasswd");

mysql_select_db("db1",$handle_db1);
mysql_select_db("db2",$handle_db2);
mysql_select_db("db3",$handle_db3);
mysql_select_db("db4",$handle_db4);

$query = "select * from test"; $which = $handle_db1;
mysql_query($query,$which);

$query = "select * from test"; $which = $handle_db2;
mysql_query($query,$which);

?>

Some useful links for Web Designers

http://webdesignledger.com/tutorials/28-powerful-photoshop-lighting-effects

http://webdesignledger.com/freebies/50-most-extreme-free-grunge-fonts

http://www.noupe.com/design/fresh-web-development-goodies-bag.html

http://www.smashingmagazine.com/2009/09/29/40-desert-island-web-development-tools/

http://www.webdesigndev.com/roundups/100-fantastic-resources-for-web-designers

Remove duplicate entries from MySQL database table

Step 1: Move the non duplicates entries into a temporary table

CREATE TABLE new_table as
SELECT * FROM old_table WHERE 1 GROUP BY [column to remove duplicates by];

Step 2: delete delete the old table

DROP TABLE old_table;

Step 3: rename the new_table to the name of the old_table

RENAME TABLE new_table TO old_table;

Lightbox, SSL and IE

Client complained about a security popup occurring only in IE, "This page contains both secure and nonsecure items. Do you want to display the nonsecure items?". My first thought was "Ah, I've seen that before - it must be an absolute URL to a non-https host in an image, script or link (css) tag" - but in typical IE style, it wasn't that simple. A check with a few debugging tools confirmed no non-SSL requests were being made.


Solution: Change the following line in lightbox.css:

#prevLink, #nextLink{ width: 49%; height: 100%;
background-image: url(data:image/gif;base64,AAAA);
/* Trick IE into showing hover */ display: block; }

to the following:

#prevLink, #nextLink{ width: 49%; height: 100%;
background-image: url(../images/blank.gif);
/* Trick IE into showing hover */ display: block; }

Then stick a blank.gif in the directory that contains the other lightbox images (or if you upgraded from Lightbox 2.03, you can just use the blank.gif that shipped with it).


15 SEO Tips and Hints

(1) First and foremost is regular update of content. Absolutely unique and fresh content with target business and resource keywords
(2) Video Content with product or service link and adding to You Tube videos and related sites
(3) Regular update on website page in RRS Feed and submit to feed directories
(4) Audio content for Pod casting, a new target of Google
(5) Optimizing photos and images with alternative (ALT) attributes and image name with related keywords or theme
(6) Add tags to your site or blog
(7) Add and set your site maps to authenticate your feeds in Google, Yahoo, and MSN
(8) Get high-quality Backlinks on a local and regional directories, yellow pages, classified apart from general directories so that you can get high priority in local search engines too like Google.co.uk, Google.in so on
(9) Get listed in Google Local Business Center
(10) Get socially informed listing in Twitter and related sites
(11) Press release and News submission so that you wont miss chance betting listed in Google news
(12) Regular update of you blog minimum one post a week and submitting to blog directories
(13) Work on measures to reduce your website bounce rate
(14) Modify and update your existing website comparing with SEO checklist and also update your checklist frequently to current SEO industry
(15) Keep checking your competitor’s progress. Learn what they do to target your customers.

Common Local SEO Mistakes

When people start a local business, they see the value of marketing their business on the internet, as that has become one of the most effective ways of making people realize a new business has opened in a local area. However, there are some mistakes which can be made in local SEO which they would do well to avoid.
1. They don"t get specific enough. Targeting keywords such as street names and neighborhoods will help people searching right in your area to be sure and find your business.
2. They use flash sites. Flash is difficult for search engines to index, and some people use it because it looks attractive without realizing the search implications of using the technology.
3. Spelling mistakes. These look even worse when you"re describing a business or an area that you own in the real world, especially involving an area you"re trying to make yourself a valuable part of.
4. Not enough link building from relevant sites. You need to spend some time building links from sites that are related both by the topic of your local business, and by the location in order to maximize your link value.
5. Forgetting press releases. Internet marketing for small business is as much about creating buzz as it is about driving people to your website, and a press release that is well written is a great way to get people talking about your new store.
6. Forgetting to use the structure of the website like headings and title tags which are SEO friendly.
7. Choose the wrong keywords. This mistake can kill your search efforts, as improperly targeted keywords will not bring any traffic at all to your site.
8. Picking too aggressive a battle. If you pick the same keywords as everyone else you"re just going to lose out on traffic to companies that have much more time and money to invest in their SEO efforts.
9. Making a site only for the search engines. It doesn"t matter how much traffic you push to a website if the website is bad. You need to make sure that your site is attractive and easy for customers to use so they"ll want to stay once they find it.
10. Forgetting the rest of the city and the state. Be sure to target wide as well as narrow so you can catch more people who might be interested in the services that your new local business could offer them.

Lightbox for Images/Videos

The most obvious use of modal windows is for the lightbox, which showcases images and video in a clean and usable fashion. By using a lightbox for images, users don’t have to load a new page just to view a single image or video. Modal windows also save space in the content layout by allowing you to show only the thumbnail of an image or video, which opens the modal window when clicked. By using a thumbnail instead of the entire element, you take up much less space and the layout looks more organized.

Furthermore, you would usually blur or fade out the background behind a modal window, putting the focus on the image or video itself, thus creating an excellent environment in which site visitors can view the media. For details on fading and blurring out the background of a modal window, see the styling practices outlined below.

When using a lightbox for an image gallery, be sure to link every image to the same lightbox, providing “Next” and “Previous” buttons to allow users to navigate the image set with ease. The user then does not have to close and re-open the modal window to view each image in the gallery.

Use an SQL Injection Cheat Sheet

This particular tip is just a link to a useful resource with no discussion on how to use it. Studying various permutations of one specific attack can be useful, but your time is better spent learning how to safeguard against it. Additionally, there is much more to Web app security than SQL injection. XSS (Cross-Site Scripting) and CSRF (Cross-Site Request Forgeries), for example, are at least as common and at least as dangerous.

We can provide some much-needed context, but because we don’t want to focus too much on one attack, we’ll first take a step back. Every developer should be familiar with good security practices, and apps should be designed with these practices in mind. A fundamental rule is to never trust data you receive from somewhere else. Another rule is to escape data before you send it somewhere else. Combined, these rules can be simplified to make up a basic tenet of security: filter input, escape output (FIEO).

The root cause of SQL injection is a failure to escape output. More specifically, it is when the distinction between the format of an SQL query and the data used by the SQL query is not carefully maintained. This is common in PHP apps that construct queries as follows:
view plaincopy to clipboardprint?


In this case, the value of $_GET['name'] is provided by another source, the user, but it is neither filtered nor escaped.

Escaping preserves data in a new context. The emphasis on escaping output is a reminder that data used outside of your Web app needs to be escaped, else it might be misinterpreted. By contrast, filtering ensures that data is valid before it’s used. The emphasis on filtering input is a reminder that data originating outside of your Web app needs to be filtered, because it cannot be trusted.

Assuming we’re using MySQL, the SQL injection vulnerability can be mitigated by escaping the name with mysql_real_escape_string(). If the name is also filtered, there is an additional layer of security. (Implementing multiple layers of security is called “defense in depth” and is a very good security practice.) The following example demonstrates filtering input and escaping output, with naming conventions used for code clarity:
view plaincopy to clipboardprint?


Although the use of naming conventions can help you keep up with what has and hasn’t been filtered, as well as what has and hasn’t been escaped, a much better approach is to use prepared statements. Luckily, with PDO, PHP developers have a universal API for data access that supports prepared statements, even if the underlying database does not.

Remember, SQL injection vulnerabilities exist when the distinction between the format of an SQL query and the data used by the SQL query is not carefully maintained. With prepared statements, you can push this responsibility to the database by providing the query format and data in distinct steps:
view plaincopy to clipboardprint?

1. prepare('SELECT *
5. FROM users
6. WHERE name = :name');
7.
8. // Provide the query data and execute the query.
9. $query->execute(array('name' => $clean['name']));
10.
11. ?>

prepare('SELECT *
FROM users
WHERE name = :name');

// Provide the query data and execute the query.
$query->execute(array('name' => $clean['name']));

?>

The PDO manual page provides more information and examples. Prepared statements offer the strongest protection against SQL injection.

9 Common Usability Mistakes In Web Design

  1. Tiny clickable areas
  2. Pagination used for the wrong purpose
  3. Duplicate page titles
  4. Content that is difficult to scan
  5. No way to get in touch
  6. No way to search
  7. Too much functionality that requires registration
  8. Old permalinks pointing nowhere
  9. Long registration forms

For more information please visit :


http://www.smashingmagazine.com/2009/02/18/9-common-usability-blunders/

What are The Returns of Working with Dreamweaver?

The rewards of using Adobe Dreamweaver over simple html coding from start are gigantic. Adobe Dreamweaver generates a lot of the coding for the user ready to us, which makes it extremely practical for beginners, for those who have no inspiration on what they want to make, but also for people who do know how to code html, they can always insert it to the written code a lot simpler.

How to get Google cache for a web site or domain

First Method

There are few simple steps to check any website or domain in Google’s cache.

  • Open google.com or any Google extension like google.co.in
  • Search a query in Google search box like this cache:url or cache:domain

after these steps if your required site or domain is in Google’s cache or index then Google will return a snapshot of that website.

You can view a Google cache or Google index page for this blog by click the following URL.


http://72.14.235.132/search?hl=en&q=cache%3Ahttp%3A%2F%2Fmohtashimjamal.blogspot.com&btnG=Google+Search&meta=&aq=f&oq=

Second Method


If you have installed Google toolbar in your browser (Internet Explorer or Mozilla Firefox) then you can try same search query via toolbar.

cache:domain or cache:url

Bookmarks Script for all the Browsers

12 Keyword Suggestion Tools

Dar Keyword Analysis Tool
Web Design, SEO & Tools
Keyword Popularity Tool
SE Promotion & SEO Tools
Domain Age Tool
SEO Tools
Link Quality Assessment
SEO Services
Multi DC PageRank Checker
SEO Tools
Search Engine Ranking Report
SEO Forum, Blog & Tools
Link Popularity Checker
SEM, SEO Tools & Monthly Report
Dogpile Search Comparison
Web Search
Online XML Sitemaps Generator
XML Sitemaps
Backlink Check Tool
Internet Marketing Services
Check Rankings
Online Keyword Ranking
Backlink Anchor Text Analyzer
Search Engine Optimization Tools