Web development by PHP-Web-Host.com   Website Hosting by PHP-Web-Host.com
Web Hosting by PHP-Web-Host.com

SoftSmart Blogs!

SoftSmart Technical, Software and Web Related Blogs

Tel (Lon, UK): 020 8133 3460

 

 

Blogs

Archive for the ‘Web Development’ Category

Create your own free website in minutes

Tuesday, July 6th, 2010

Need a good looking website but you don’t have time to learn how to create your own one, and you’re on a tight budget? Don’t know too much about on-page SEO, except that its important? While this used to be a real problem, we’ve got a great solution for you.

We have developed easyCMSlite, the free, easy content management system. easyCMSlite is, as its name implies, a lite content management system. That is, lite, yet powerful. We’ve tried hard to take away the complexities of so many of the CMS systems available. I personally have tried using some of them, and I couldn’t fathom them. I am a web / software developer, so I can’t imagine what it must be like for non technical users.

easyCMSlite avoids that. For instance, to add a new page, you don’t need to be in some admin menu where you add text to a list. In easyCMSlite, you are in the actual web page, and when you want to add a page you see it as it would appear to your users. This is termed ‘What you see is what you get’ (WYSIWYG).

Another important consideration is SEO (Search Engine Optimisation). This is the important task of optimising your website so that the search engines can find you faster and hopfully rank you higher. Most CMS do have SEO capabilities, but you need to download and install plugins for that, then you need to configure and enable them. For instance, many CMS’s allow you to install a plugin to convert the URL’s they produce to one which is search engine friendly (and human friendly). So, using a plugin, you might be able to change your url from www.yoursite.com?cat=12&subcat=6&pid=34 to www.yoursite.com/category/sometitle.php. With easyCMSlite, this is automatic. If you have a main menu item called ‘Products’ and a product page you are linking to called ‘widget’, then your URL will be www.yoursite.com/products/widget.php. This is automatic and requires no plugins or configuration.

easyCMSlite has an easy to use text editor, very similar to word and excel. In fact, you should be able to copy and paste most content from word or excel into this editor, making  it even easier to manage your site.

To give easyCMSlite.com a try, go to easyCMSlite.com, the free, easy content management system, or go to www.demoserver.co.za to test the CMS in a live test environment. The username is [email protected] and the password is demo.

 


 

Protect your PHP code by obfuscating it!

Thursday, June 24th, 2010

The ionCube PHP Encoder makes it easy to protect your PHP files from easy observation, theft and change. With optional licensing features built in, licensing your scripts to control which server your code runs on is easy too, and you can even give your files a time expiry!

Available in three versions, Basic, Pro and Cerberus, all versions offer bytecode PHP encoding plus optional encryption of non-PHP files. Pro and Cerberus also include the optional PHP licensing features for time expiry and restricting where code can be used, allowing licensing models to be effectively and easily implemented.

The PHP Encoder is available for Windows, Linux, FreeBSD and Intel OS X. All versions offer command line access for encoding and creating license files (Pro and Cerberus), which is ideal if you wish to automate processing. The Windows Encoder also includes an easy to use GUI, and the Windows Pro and Cerberus version includes a Linux based license generator for PHP scripts for FREE, which is great if you wish to encode on Windows and create license files from a Linux based web server for example.

Encoded files run on a wide range of operating systems such as Linux, Windows, FreeBSD and more.

Encoding BenefitsAs PHP scripts can be easily read, changed and run on any PHP enabled system, encoding PHP offers important benefits:

Product Developers: protect and license your code before distribution. Ideal for protecting evaluation copies, the low once only purchase cost can quickly deliver a significant return on investment from increased sales.

Website Designers: protect your creative work and a revenue stream from future script updates.

Enterprise Customers: successfully enforce internal change control policies by avoiding untracked software tweaks that may get lost on a site reinstall or server move.

Website Owners: hide sensitive data and protect scripts from unauthorised changes that may go unnoticed indefinitely and be a serious security and data protection risk.

Example of code

Here is a section of code from an index.php file

=========================================================================================================

START OF PHP CODE

=========================================================================================================

<?php
session_start();
include(“./includes/Functions.inc”);
include($_SERVER["DOCUMENT_ROOT"].”/includes/Variables.inc”);
?>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head><title><?php print GetTitleTag(“1″); ?></title>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<meta name=”description” content=”<?php print GetMetaDescription(“1″); ?>”>
<meta name=”keywords” content=”<?php print GetMetaKeywords(“1″); ?>”>

=========================================================================================================

END OF PHP CODE

=========================================================================================================

and here is the encoded code segment

=========================================================================================================

START OF PHP CODE

=========================================================================================================

<?php //003ac
if(!extension_loaded(‘ionCube Loader’)){$__oc=strtolower(substr(php_uname(),0,3));$__ln=’ioncube_loader_’.$__oc.’_’.substr(phpversion(),0,3).(($__oc==’win’)?’.dll’:’.so’);@dl($__ln);if(function_exists(‘_il_exec’)){return _il_exec();}$__ln=’/ioncube/’.$__ln;$__oid=$__id=realpath(ini_get(‘extension_dir’));$__here=dirname(__FILE__);if(strlen($__id)>1&&$__id[1]==’:'){$__id=str_replace(‘\\’,'/’,substr($__id,2));$__here=str_replace(‘\\’,'/’,substr($__here,2));}$__rd=str_repeat(‘/..’,substr_count($__id,’/')).$__here.’/';$__i=strlen($__rd);while($__i–){if($__rd[$__i]==’/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}@dl($__ln);}else{die(‘The file ‘.__FILE__.” is corrupted.\n”);}if(function_exists(‘_il_exec’)){return _il_exec();}echo(‘Site error: the file <b>’.__FILE__.’</b> requires the ionCube PHP Loader ‘.basename($__ln).’ to be installed by the site administrator.’);exit(199);

?>
4+oV57VUu30z8za7B6zr4sV2Cx2z8oGItODXXTboXYkTpB0jT1p+6ASGIRkQT5ujcsgFVWLV7rg1
fr17JxPlCTK+aVsqbjaZgMEn+I7VPEtB4N2mXDPTMRxtZCp5QQsHrngYFGQDEcv2mGVr4+O0iXVx
jUx8lUJ9/YhNRTpQHKZcyplCkUYQs6qMfWHGR1H8v1h5BdvSVUcCuyYBn4U0fGGOLGQWil2hDXh1
pe0U8QYNPykRDyivD/p2q/2rRSZ8hZEV3yL55roojBINMMQerm61Xkua6YfGdoICapac9sd3cIFI
+vLhGT4bYhYAAvqDSCcPXl/dy+1E3CB2RIr1LFD7UCoPPdYsSMH7wwf18IjIKFE/7Xg5m47pl2U3
GxZP6lKaXoWQ3LK6JQuwigN1eobfvrH1058s+w1WhsBCTCJqmhDgeIu3TzL+odxK/MM9oyva/gEX
ruX5DNdd28ouDWVJp0JNjVytRJL4jX8M1XpXAZYmf966toDAdW/Dms1AMWM9GK5d/rE/jxlHT9om
CqMaRb/5ljDrXFdoAcTFelL7CnkH73i5hC6jTzTtlyS1UwILHao6mGRBwya5dJgOO5iXImA1pDY7
H6n6HYSZE8BPg08JgotrnIpf0atZ5hdtK7Uy6/zTD3cWlN2HJ2Fn+7mWY1N6/HXJRZl7GPv3BI8e
alaIokyeT9Qq92dhY48/vPbj5n1fuGnfSDEzh315iWLHMz7YnIs/kRpBB5A8dEYJT4BTkY5SjfzY
mb65CixXBVVE3q7dkckwYmbwphe6+nKj2WbdfiC6s44rcNF4kpaLswB3Y2dM5TKZpASHs88ID7BE

=========================================================================================================

END OF PHP CODE

=========================================================================================================

Best of all, if someone tries to change your code, even the comments sections, the code won’t run. We use it on our freeware easyCMSlite, free, east content management project

To find out more about PHP code encryption click the link. There is a demo version that you can download!

ionCube PHP  Encoder

 


 

Make Money From Your Blog or Website

Wednesday, June 23rd, 2010

Many people wonder how they can make money from their website or blog. If you’ve ever asked the question how to make money then here is a proposal to monetize your website.

We at PHP-Web-Host.com have an affiliate program which allows you to place a link on your website to us, and, if someone purchases a web hosting package through that link, you will earn a commission. To see how much commissions you may earn, take a look at our Affiliate Program page.

How does it work?

You sign up at the link above as an affiliate. This will generate a unique affiliate id for you. You then use this link as either a plain text link in your website, or you use the code with an image which we provide.

We also write a cookie to the web surfers browser which will track any sales up to a year after they clicked through from your site. In other words, if someone clicks on a banner on your site today, but they only make a purchase next 10 months later, you will still earn a commission, EVEN though they don’t go through your link when they actually make the purchase.

Some examples of the banner links are below. You are welcome to request more colors or sizes, or just check back at the affiliate’s page as we do add new image links from time to time:

Affiliate Program Link 1

Affiliate Program Link 2

Affiliate Program Link 3

You will notice that we have a variety of banners. For instance, if you are targetting UK based traffic, you can use the versions which point to www.php-web-host.co.uk and show prices in pounds. You can also show international banners with $ and the .com domain name, as well as choose different colours and sizes.

Joining the affiliate program is absolutely free, and its instant. You sign up and are immediately able to start earning commissions.

Go ahead, Sign Up Now!

 


 

Your own fully editable website using WordPress

Thursday, June 10th, 2010

Do you need a website that’s good looking, quick to set up, fully editable by you, the non-technical web user, and, a site that is as cheap as our cheapest hosting package?

Try WordPress (this blog is a WordPress blog). So, in our opening paragraph we promised you it was for non technical users. Here’s how:

Register for your hosting account with us. You can see on the web hosting pages that this is very cheap if you register for the 500mb package. Once you have registered, you will receive an email with all of your hosting details, including your cpanel user name and password.

Log into cpanel and select fantastico. From the fantastico page, you can select to install a WordPress blog. This will automatically install your wordpress blog, ready for you to use. But, if you want to make it look a little nicer, log into your WordPress admin panel. Click on Appearance –> Add New Themes.

From that menu, you can select a theme of your choice. There are hundreds, if not thousands of templates to choose from. Click on the install link in your chosen theme, and that’s it!

To see what a blog with a theme looks like, take a look at http://www.getfitloseweight.info. This website was setup and “themed” within about 1 hour. The discussion boards there were also set up within about an hour, also using the fantastico installer in cpanel.

Should you wish to do something like this, but you are not sure how, please contact us using the links in the navigation menu above…

 


 

Using AJAX to load content dynamically without refreshing the page

Thursday, May 6th, 2010

AJAX (wiki) is a great way of performing tasks which would usually require you to reload the web page. For instance, in an estate agent website I developed, logged in users could do a search for properties. If they found a property that they liked, they could click on the “Save to Favourites” link. This would redirect the page to another page which would save this property ID in the client’s favourites list, then redirect back to the search results page. When it reached the search results page now, this property obviously did not have a “Save to Favourites” link anymore…

Enter Ajax. By applying ajax to this page, I could have the user click the link, and save the property and remove the link without needing to reload the page. This saves bandwidth (no reloading pages), saves time (don’t have to run the search query again), and it just looks slick and professional.

Ajax basically works (in layman terms, read the wiki above for a more detailed explanation) by calling a web page from a javascript, and making the result of that page available to use in the script.

So, lets say I had a form on my page which asked the user to enter the name of a city. When they click on the submit button, it should look up the current temperature of that city and display it. Usually, we would submit the form and redirect between pages to display the result. Using ajax, the javascript can call a page that does the lookup, and it can then display the information on our page using the innerHTML property of the document….

Here is an example:

<html>
<head>

<script type=”text/javascript”>

xmlhttp = null;
count = 0;

var d = new Date();

function ClearFile(StartTimer)
{
xmlhttp = null;
if (window.XMLHttpRequest)
{
// IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{
// code for IE6, IE5
xmlhttp=new ActiveXObject(“Msxml2.XMLHTTP”);
}

RndString = d.getFullYear() + “” + d.getMonth() + “” + d.getDate() + “”  + d.getHours() + “” + d.getMinutes() + “” + d.getSeconds() + “” + count++;

xmlhttp.open(“GET”,’http://localhost:81/test/DeleteFile.php?C=’ + RndString,false);
xmlhttp.send(null);

if(StartTimer == 1)
{
setTimeout(‘DoXMLPart()’, 2000);
}

}

function DoXMLPart()
{

InnerHTMLText = “”;

setTimeout(‘DoXMLPart()’, 5000);

xmlhttp = null;
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{
// IE6, IE5
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}

RndString = d.getFullYear() + “” + d.getMonth() + “” + d.getDate() + “”  + d.getHours() + “” + d.getMinutes() + “” + d.getSeconds() + “” + count++;

xmlhttp.open(“GET”,’http://localhost:81/test/tags.txt?C=’ + RndString,false);
xmlhttp.send(null);

if(xmlhttp.responseText != “”)
{
InnerHTMLText = document.getElementById(“File”).innerHTML + xmlhttp.responseText;
document.getElementById(“File”).innerHTML = InnerHTMLText;

ClearFile(0);
}

}
</script>

</head>

<body onload=”ClearFile(1);” onunload=”ClearFile(0);”>

<div id=”File” name=”File”></div>

</body>
</html>

What this page does is the following:

When the page is loaded, the onload event in the body tag calls a function ClearFile(1). In clear file we set up our XMLHttpRequest  object and load a page called DeleteFile.php. Delete file simply opens a text file on our server called tags.txt and makes it blank.

It then sets a timer to 2 seconds (2000 milliseconds). When the time times out after 2 seconds, it will call a function called DoXMLPart().

The first thing we do in this function is set a timer to call this function again after 5 seconds. We do this because we want to continually check the server for data in this file. Obviously you could use ajax without  timers, for instance you could respond to the onclick event of a button.

Next, we set up our XMLHttpRequest object again and then call a page called tags.txt.

The property xmlhttp.responseText will contain any data from that call. In otherwords, it will contain the complete text of that file.

The line if(xmlhttp.responseText != “”) checks to see if there is anything in the file. If there is, we add it to the contents of the div called File. We then delete the contents of the file tags.txt

Using this method, we can add content to tags.txt and as we do it gets displayed to the user. Of course, we could call a php page as we did with DeleteFile.php.

A very important point is that IE 7 does not handle ajax terribly well. Internet explorer 7 (I haven’t tested the other versions)  uses some extreme caching. The  first time the ajax script is called it works fine, but thereafter it just keeps calling the ajax script that you called first. So, in our timed script above it would usually just repeat the first action over and over. It does not display new content, and even if the file is made blank, it keeps displaying what was in the file the first time. Its a real nuisance.

There is a work around though. We do two things.

1) You will notice that I have made the variable that holds the ajax xml request (xmlhttp = null;) a global variable.

2) By passing a unique query to the page you are querying, IE7 does not use the cached version.

That is the reason for this line of code:

RndString = d.getFullYear() + “” + d.getMonth() + “” + d.getDate() + “”  + d.getHours() + “” + d.getMinutes() + “” + d.getSeconds() + “” + count++;

We create a random  string which is made up of the current date and time, and an extra portion which is count. Count is a numeric value that starts at 0 and is incremented each time it is used. Note that it is not good enough to just use the count portion without the date and time portion. If the user presses refresh, the count starts at 0, but there are already cached versions of 0, 1, 2, etc, so the user will start to see actions which occured in the past repeating themselves… very confusing.

We then use this random string in our request:

xmlhttp.open(“GET”,’http://localhost:81/test/DeleteFile.php?C=’ + RndString,false);

This solves the problem with ajax (XMLHttpRequest) and IE7 perfectly. This problem does not occur in firefox.

If you have any comments or questions about this topic, please feel free to ask….

Click here to download the demo code

 


 

Get Adobe Flash playerPlugin by wpburn.com wordpress themes

 

 

We accept PayPal

 

Web Hosting by PHP-Web-Host.com Website Hosting by PHP-Web-Host.com

[ Home ] | [ Software ] | [ Web Development ] | [ Resources ] | [ Contact ] | [ Privacy Policy ] | [ Acceptable Use Policy ] | [ Terms of Service ] | [ Sitemap ] | [ Clients ] | [ Affiliates ]

[ PHP Web Hosting ] | [ Linux Web Hosting ] | [ 500mb PHP Web Hosting ] | [ 1Gb PHP Web Hosting ] | [ 3Gb PHP Web Hosting ] | [ 6Gb PHP Web Hosting ] | [ 10Gb PHP Web Hosting ]

[ HTML Tutor ] | [ CSS Tutorial ] |