Posts Tagged ‘problem’

seo:Canonical Issues

Monday, July 14th, 2008

These occur when a search engine treats www.yourdomain.com, yourdomain.com, and yourdomain.com/index.html as different web sites. When Google does this, it flags the different copies as duplicate content, and penalizes them. If yourdomain.com is not penalized and all other sites link to your web site using www.yourdomain.com, then the version left in the index will have no ranking. These are basic issues that other major search engines, such as Yahoo and MSN, have no problem dealing with. Google’s reputation as the world’s greatest search engine (self-ranked as a ten on a scale of one to ten) is hindered by its inability to resolve basic indexing issues.

Php:Cookie Expiry

Monday, June 30th, 2008

Problem
Short expiry cookies depend on users having their system clocks set correctly.

Solution
Don’t depend on the users having their clocks set right. Embed the timeout based on your server’s
clock in the cookie.

<?php
$value = time()+3600 . ‘:’ . $variable;
SetCookie(’Cookie_Name’,$value);
?>
Then when you receive the cookie, decode it and determine if it is still valid.

<?php
list($ts,$variable) = explode(’:',$Cookie_Name,2);
if($ts < time()) {

} else {
SetCookie(’Cookie_Name’,”);
}
?>

Php:Adding an extension

Monday, June 30th, 2008

Problem

You need PHP’s built-in ftp functions for the ultra-cool script you are writing, but your service
provider does not have PHP compiled with the –enable-ftp option.

Solution

If you have a shell account on a system with the same operating system as your web server, grab the
PHP source tarball and build using:

–with-apxs –enable-ftp=shared
You can check which flags your provider used by putting a phpinfo() call in a script on your server.

<?phpinfo()?>
Once compiled, you will find a “modules/ftp.so” file which you can copy to your web server and
enable either by putting:

extension=ftp.so
in your php.ini file or by adding this to the top of your script:

<?php dl(”ftp.so”) ?>

SEO:The Problem With Keyword Searching

Monday, June 30th, 2008

Keyword searches have a tough time distinguishing between words that are spelled the same way, but mean something different (i.e. hard cider, a hard stone, a hard exam, and the hard drive on your computer). This often results in hits that are completely irrelevant to your query. Some search engines also have trouble with so-called stemming — i.e., if you enter the word “big,” should they return a hit on the word, “bigger?” What about singular and plural words? What about verb tenses that differ from the word you entered by only an “s,” or an “ed”?

Search engines also cannot return hits on keywords that mean the same, but are not actually entered in your query. A query on heart disease would not return a document that used the word “cardiac” instead of “heart.”

PHP:Debugging PHP

Monday, June 30th, 2008

It really begun at the last Copenhagen php-meetup; Joakim Nygård and Jacob Oettinger made a presentation of their project, WebCacheGrind. I casually mentioned something about having played with the dbgp-protocol (The debugging part of Xdebug) and that it ought to be simple enough to write a fontend for it. That prompted some snickering from the back row. Apparently some guys had this rule at their workingplace, that whomever said that something ought to be easy to do, had to do so himself.Spectator is a XUL application, which should make it cross platform. I have tinkered a bit with XUL before, but not a full application. If you’re wondering what XUL is, it’s the GUI toolkit, in which the frontends for Firefox and Thunderbird are written. It’s a markup language — much like HTML, which can be scripted with Javascript. This makes it very easy to work with. The only problem seems to be a rather …

Javascript:IE (Internet Explorer) red X or X-box picture placeholder workaround

Monday, June 30th, 2008

<div id=”problem_image1″>
<img border=”0″ id=”img1″ ONERROR=’problem_image_handler();’ src=” alt=” />
</div>
<script>
function problem_image_handler() {
document.getElementById(”problem_image1″).style.visibility = “hidden”;
}
</script>

Getting results from a select multiple HTML tag.

Saturday, June 28th, 2008

The select multiple tag in an HTML construct allows users to select multiple items from a list. These items are then passed to the action c for the form. The problem is that they are all passed with the same widget name. I.e.
<select name=”var” multiple=”yes”>
Each selected option will arrive at the action handler as var=option1, var=option2, var=option3. Each option will overwrite the contents of the previous $var variable. The solution is to use PHP’s “array from form element” feature. The following should be used:
<select name=”var[]” multiple=”yes”>
Now first item becomes $var[0], the next $var[1], etc.

Office 2007 Converter

Saturday, June 28th, 2008

Microsoft released it’s much-anticipated 2007 version of its Office product in January 2007. Years in the making, Office 2007 contains a number of new features, the most notable of which is the entirely new graphical user interface called the Ribbon, replacing the menus and toolbars that have been the cornerstone of Office since its inception. Students and faculty purchasing new computers since January have been purchasing this new version. Although there are many improvements to Word, PowerPoint, Excel and Access, one thing that you should be aware of is that the default file formats are not only different from all past versions, they are not readable by past versions. This means that if a student creates a document in Word 2007 it will automatically be saved in a format called .docx. Since this file type is not recognized in Word 2003 or XP, you will not be able to open it. Some of you may have already run into this problem with student submissions.

Virtual Private Server (VPS) Web Hosting

Thursday, June 26th, 2008

Shared hosting allows thousands of people to host their own sites at a very reasonable cost. It has some drawbacks, however. Since hundreds of sites can be hosted on a single server resources such as CPU, disk space, and bandwidth have to be shared with your virtual neighbours.

Shared resources are usually not a problem for small to medium sized sites. Your main limitation is the lack of control over system level software – http servers, mail servers etc. You don’t have any choice of operating system and you cannot compile programs or do administrative tasks such as setting up Spam filters or firewalls.

Many people would say ‘So what? I don’t want to do that stuff anyway!’ It’s true that the majority of website owners have no interest or ability to handle this kind of work and are happy to leave it to the hosting company. Those who desire more control over their server environment or wish to experiment with new software, however, can get access to this level of management with a Virtual Private Server.

A virtual private server (VPS) is a physical server that has been divided (using software) into several virtual machines, each acting as an independent dedicated server. The physical resources such as RAM, CPU and disk space are still shared, but each VPS acts independently of the others. Each VPS can have a different operating system and can be configured in any way possible.

The key advantage of VPS is allowing each VPS administrator access to the root level of his virtual server. This kind of access allows the administrator to install and delete software, set permissions, create accounts – in short, do everything that the administrator of a ‘real’ sever can.

As well as providing more control over your hosting environment, a VPS is more secure than shared hosting. Websites on a shared server all have the same operating system, so if a hacker were to find access to the root of the server he could damage any or all of the websites on that server. A VPS, on the other hand, is divided in such a way that even if a hacker were to gain entry through one account, there is no way to access the others. Each VPS is invisible to the others and there is no way to set up root level access from one VPS to another.

Virtual Private Servers can be set up in various ways so be sure to understand how the hosting company has allocated resources. The most common configuration is to divide all the physical resources evenly by the number of accounts. Thus, if there are 10 virtual servers, each would receive 10% of the total bandwidth, CPU, memory and disk space.

The disadvantages of VPS are almost the same as the advantages. The control that a VPS account provides can be dangerous if you don’t know what you are doing. You have the ability to delete files, set permissions improperly, allow virus-laden software on the system and, in general, really screw things up. If you don’t have the knowledge to administer a server, or are not willing to learn, VPS is not for you.

If your website has outgrown shared hosting, however, VPS offers an affordable alternative to dedicated hosting. When shopping for a VPS host, be sure to find out how system resources are divided up, the number of VPS accounts on each physical server, the method for upgrading, and the choices of operating systems.

How To Change A Cmos Battery

Wednesday, June 18th, 2008

The inside of a computer is a bad place full of electricity and sharp edges. On the electricity side always when working on you computer make sure that it’s still plugged in to the power socket and the power is turned off, this is to ensure that any static From you is discharged through the earth. The inside of most computer cases are unfinished metal and has very sharp edges so be careful.

The first signs of a battery failing are:-

1) your clock starts running slowly
2) when you boot (start) your computer it has a problem finding your hardware (no hard drive, no cd rom)

To change the battery you need the following tools:-

1) a X-point screwdriver
2) an anti-static strap(optional)
3) a new battery (seems logical)

Then unplug all the cables from the back of the computer as you remove them make a note where they came from. (So when you finished you can put them back)

Move the computer somewhere where you can work on it with ease

Remove the cover by locating the screws around the outer edge (back) of the computer
Some computer cases only require you to remove 2 screws on one side then a panel can be removed allowing you access to the computers insides, others you must remove 6 screws and remove the whole case by sliding it to the rear and lifting it off.

Now make sure that you read the safety instructions about static.
Look inside you will see a round silver thing that looks about the size of a 10p piece (quarter). This is the battery itself, carefully lift the retaining clip and slide the battery out. That’s it removed now go to your local computer retailer, electrical retailer (Tandy/Radio shack) taking the old battery with you and get a new battery.

Back to your computer insert the new battery by lifting the clip and sliding the battery in.

Reinstall your case and plug all the cables back (you did remember to label them didn’t you)

Now for the fun part.

You will now need to go into you bios….

Right the bios is the god of your computer.

To access it, when your computer first starts you will see a black screen with white text.

If you look carefully you will see a line that says something like “press del for setup” or some other key (F2 or ESC or tab) this will take you to god’s house where you can make lots of changes to the way your machine works.

It is also the place where you can make your nice computer in to a rather expensive door stop so be careful and don’t go playing with anything.

You will now be presented with a blue screen with a lot of options on it,
The one we want is load optimized/default settings.

Press the F10 key and type y the computer should now reboot.

If every thing went well then your computer will now be up and running.