Prevent SQL-injections within PHP

January 5th, 2009

I wrote a little PHP function against sql-injections which disables experienced attackers to get your sensitive data or even worse, executing commands through your SQL server.

//Use it like this:
//$inputId = cleanSQL($_GET['id']);
//$SQLStatement = "SELECT Text,Title FROM News WHERE Id = " . $inputId;

function cleanSQL($inputString){
if (get_magic_quotes_gpc()) {
$clean = mysql_real_escape_string(stripslashes($inputString));
}else{
$clean = mysql_real_escape_string($inputString);
}
return $clean;
}

PHP , ,

Five great Joomla templates for E-commerce!

December 25th, 2008

I’ve been working a lot lately, so I haven’t been able to write as much as I wished I should. I have been working on a webshop, so therefore I will give you a few hints if you are in the thoughts of starting a webshop.

Check out these great Joomla templates for E-commerce or E-trading!

JA Larix - Smart shopping Joomla template
Demo: http://www.joomlart.com/templates_demo.php?template=ja_larix
Info: http://www.joomlart.com/templates_club/club_portfolio/ja_larix.html

JA Mesolite - Ecommerce inside
Demo: http://www.joomlart.com/templates_demo.php?template=ja_mesolite
Info: http://www.joomlart.com/templates_club/club_portfolio/ja_mesolite_-_ecommerce_inside.html

IceTheme’s IT TheStore
Demo: http://demo.icetheme.com/index.php?template=it_thestore
Info: http://icetheme.com/Available-Joomla-Templates/IT-TheStore-Template.html

eShop plazza Templateplazza
Demo: http://demo.templateplazza.net/?template=eshop_plazza
Info: http://www.templateplazza.com/content/view/156/40/

Shape5 Aluma Photography (Excellent for selling pictures)
Demo: http://www.shape5.com/demo/aluma_photography/
Info: http://www.shape5.com/product_details/club_templates/aluma_photography_-_october_2008_joomla_club_template.html

Internet, Web development , ,

How to Install Apache, PHP And MySQL In 10 Minutes!

December 9th, 2008

Are you thinking of setting up your own web server for hosting your site or just play around a little? This is not hard and in this article we are going to install Apache, PHP and MySQL with the open source bundle WAMP.

First off we need to download the Windows package. Do that here.

Once the download is finished, we need to install the package.

When you run the setup, make sure that you check the Autostart option, this can be a nice feature which spares you the time to launch it from the start menu everytime you reboot. Except that, stick to the defaults unless you know what you are doing.

When the installation is completed, head to http://localhost. If you see the WAMP welcome page, everything went successful!


After that we succeeded the installation, we need to configure MySQL in order to make it secure. Click on the PhpMyAdmin link on the Wamp welcome screen or head your browser to http://localhost/phpmyadmin.
Click on the “Privilegies” link on the PhpMyAdmin welcome screen and then edit the privilegies for the user root.

Scroll down to the pane “Change Password” and set a new password for your root account. After we have set a password for the MySQL root account, we need to edit the PhpMyAdmin configuration file. This file can be found (in a default installation) under C:/wamp/apps/phpmyadmin2.*/config.inc.php. Open this file with Notepad or any other text editor and scroll down to the line $cfg['Servers'][$i]['password']      = ”;

Type in the password that you’ve set for the root account, for example:
$cfg['Servers'][$i]['password']      = ‘thisismysafepassword’;

You are now ready to start playing around with your very own web server.
Stay tuned for an article in how you install and configure your own WordPress weblog.

Software, Web development , , ,

Semi-automatic Web Directory Submissioner

December 9th, 2008

While surfing around the internet I found the DigiXmas Submitter tool! This tool might be old, what do I know, but I know for sure that it’s a hell-of-a-thing. What it basically does is that it adds your site to about 1000* web directories, semi-automatic! This is really a time saver! If you haven’t got it, get it at http://www.digixmas.com

* You get 150 sites for free and for 15$ you get about 900 additional web directories.

Software, Web development

How to get more visitors to your site (Part 1)

December 8th, 2008

I have started on a series of articles about how you increase your amount of vistor on your site. This is the first part and in this article I will mostly talk about Web Directories and Social bookmarking.

A good way to keep track of your visitors can be to subscribe to Google Analytics which is a statistic tool for keeping statistics over visitors of a website. Sign up at http://www.google.com/analytics/
The key to many visitors is always CONTENT, you can not expect a lot of visitors if you can’t offer them anything interesting. People visit a site because they wan’t to know more. A site without interesting content won’t survive.

This article won’t cover all of the information on how to increase your visitors, but this is always a good start!

Web directories
A web directory is not a search engine and does not display lists of web pages based on keywords; instead, it lists web sites by category and subcategory. The categorization is usually based on the whole web site rather than one page or a set of keywords, and sites are often limited to inclusion in only a few categories.
Web directories often allow site owners to directly submit their site for inclusion, and have editors review submissions for fitness. Since many search engines mirrors these sites, you should really submit your site to a couple of web directories.

http://www.agilelist.com
- This is a web directory of quality pages.

http://www.dmoz.org
- This is the largest web directory completly reviewed by humans. Your submission can take up to 5 months to be accepted, but it’s worth the waiting. The DMOZ is used by allmost all of the larger search engines on the web.

There are a few other big Web directories, but they often charge a fee for reviewing your site.
How ever, here are a few big who charge from 29$ to review your site.

Yahoo Directories ( http://dir.yahoo.com )
Starting point ( http://www.stpt.com/ )
Go guides ( http://www.goguides.org/ )

There are also some semi-automatic bots for submitting your page into several Web directories. You should use these with caution since many Web Directory owners don’t appreciate this. Here is a free one: http://www.submitterbot.com

Social bookmarking
In a social bookmarking system, users save links to web pages that they want to remember and/or share.
These bookmarks are usually public, and can be saved privately, shared only with specified people or groups, shared only inside certain networks, or another combination of public and private domains. The allowed people can usually view these bookmarks chronologically, by category or tags, or via a search engine.

Social bookmarking can give you a lot of new visitors based on your content. When posting something into a social bookmarking service you should specifiy the link to a specifik article or post, not your whole site. If people find your article interesting they might read some more of what you have written.

Delicious
- This is the biggest social bookmarking service.

Digg
- Digg.com is a very populated site with categories. When signing up, you should really take the time to import your Outlook contacts etc. Due to very many submissions of articles, images and videos, an article with only 1 digg can appear very uninteresting to other people but if you can get 30 co-workers and friends to digg it, other people may follow them.

Stumbleupon
- Register at stumbleupon, download their toolbar and you are ready to go!

Reddit
- Reddit is a bit smaller than the other sites I’ve mentioned. That can actually be an advantage for the small site owner. With a smaller number of competitors, your article have a bigger chance to reach the toplists.

Forums and blogs
By being active on several different forums and blogs you can get a lot of vistors! Be nice and interested in helping others. This is a bit of social networking and if you help them, they will help you!
If someone posts a forum thread wondering what Internet Browser he should use and you have written a Internet Browser test, why don’t you link to your site? You should also participate in newer discussion, comment the last two posts on each blog you visit! You should also visit Yahoo Answer and try to answer a couple of questions with links to your site. If the sitelink is irrelevant to what the person asks, then skip this.

Link exchange
Find a webmaster in your niche, ask him if he want to participate in a link exchange, you put his link on your site and he puts yours on his. Simple, huh?

Use your contacts
Mail all your friends, relatives and co-workers and tell them about your site! This can easily give you 50-100 loyal visitors.

This was the first part of the tutorial, stay tuned for Part 2

Internet, Web development , , ,

Notepad++: A very good source code editor!

December 8th, 2008

Notepad++ is a source code editor that I’ve been using daily for a while. Before that, I used Notepad, so switching to Notepad++ was a giant step for me. I love the syntax highlightning and the great implementation of regular expressions in the search and replace feature. This is very useful when it comes to Web programming.

These are the features I love the most:

  • Syntax highlightning
  • Auto-completion
  • Multi-Document
  • Mutli-View
  • Regular expression search/replace
  • Full Drag and drop
  • Auto-detection of file status
  • Zoom
  • Bookmarks
  • Macro recording and playback

Check it out at http://notepad-plus.sourceforge.net

Software, Web development ,

Firetune - Makes Mozilla Firefox even faster!

December 8th, 2008

Are your internet browsing taking time? Are you tired of getting browser crashes? Try to tune Firefox with Firetune to get some faster browsing!

I think that everyone, who is a frequent Firefox user, have heard about the “about:config” tip to tune Firefox with like 200 setting strings. What if you could to do that with a freeware? Actually, you can with the excellent freeware FireTune.

Firetune allows you to optimize Firefox for your computer, without any installation or uninstallation. Just extract the files and fire it up to start tuning.

Here are a full list of features:

  • Speed improvements according to your computer speed
  • Improves browsing speed according to your internet connection speed
  • Speed improvements for slow, medium and fast computers / connection speeds
  • Enables some hidden tweaks of Firefox for even more browsing speed
  • Includes a configuration backup and restore function
  • Optimizes Firefox memory usage

Download it here!

Internet, Software , , ,

Database humor

December 8th, 2008

This comic strip, which is a bit old, is still one of my favourites. It might not be brilliant to the ones not working with databases, but to me, who do, it’s hilarious.

Go to http://www.xkcd.com/ to get some more of these hilarious comic strips!

Internet, Web development , ,

The top 10 in free Mozilla-addons for Web developing

December 7th, 2008
  • Firebug - Download!

    Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.
  • YSlow - Download!

    YSlow analyzes web pages and tells you why they’re slow based on Yahoo’s rules for high performance web sites.
  • SENSeo - Download!

    SenSEO is an extension checking the most important on-page-SEO-criteria and calculating a grade of how good your site fulfills these criteria.
  • FireFTP - Download!

    FireFTP is a free, secure, cross-platform FTP client for Mozilla Firefox which provides easy and intuitive access to FTP servers.
  • IETab - Download!

    This is a great tool for web developers, since you can easily see how your web page displayed in IE with just one click and then switch back to Firefox.
  • Searchstatus - Download!
    Display the Google PageRank, Alexa rank and Compete ranking anywhere in Mozilla Firefox, along with fast keyword density analyser, keyword/nofollow highlighting, backward/related links, Alexa info and more.
  • Web Developer - Download!

    Adds a menu and a toolbar with various web developer tools. This add-on has great features for disabling javscript and css. Outlining div’s, TR/TD’s and complete tables. It comes with validators for HTML and CSS, a must have!
  • ColorZilla - Download!

    With ColorZilla you can get a color reading from any point in your browser, quickly adjust this color and paste it into another program. You can Zoom the page you are viewing and measure distances between any two points on the page. The built-in palette browser allows choosing colors from pre-defined color sets and saving the most used colors in custom palettes
  • Javascript Debugger - Download!
    Venkman is the code name for Mozilla’s JavaScript Debugger. Venkman aims to provide a powerful JavaScript debugging environment for Mozilla based browsers.

Tips & trix , , ,

Beta 2 of Mozilla Firefox 3.1 soon to be released

December 5th, 2008

The biggest change from 3.1b1 to 3.1b2 is the addition of the feature called “web workers” which gives Firefox the ability to process tasks in
the background. The feature, part of the ,still under development, HTML 5 specification, adds another level of sophistication for programmers writing Web applications and gives multicore processors a better way to allocate processor power.

“We have been hard at work with folks from Apple and Google to complete this feature”, said Ben Turner.

Apple and Google are also building their own browsers and with the browser wars back in full force, those organizations are racing to outdo each other
on features and performance.

Paul Rouget wrote on the Mozilla Add-ons Blog that a Firefox 3.1 Beta 2 will be released in the first week of december. He also said that there
are plans on schedueling a Beta 3 of the Mozilla 3.1.

Internet, Software , , ,