Using the javascript date/time function is easy because its a client-side language so it displays your system time. But its not the same case with PHP. Since its a server-side language it displays the server’s time which can be irritating because you might have your server located in another country and you might live somewhere else. But changing the timezone is just a few clicks away and whats more, you can even set different timezones for different pages/directories.Continue Reading…
Disabling PHP Display Errors
Identifying the errors are very important when learning a new computer language or coding a program. Languages like C and C++ have compilers which display the error message and the lines which contain them only to the programmer (thats you). But with PHP when you’re running a live website and commit any errors in the programming it’ll be displayed to the entire world. Now there is nothing to feel ashamed because everyone commits errors (to error is human, right) the bad thing is that these errors reveal a treasure of information that a potential hacker can use against you and your website. This article will guide you through disabling PHP from displaying errors.Continue Reading…
Change the default Directory Index in Apache Server
For years after the internet became widespread, technology changed tremendously. From snail pace dial-up to lighting fast broadband and static bland web pages to dynamically changing websites with over the top eye-candy everything changed within the blink of an eye. But what we see throughout most of these websites is that the home page is named as index.html or index.php/.asp
It seems web programmers got so accustomed to old fashion ways of file names. One more thing to note, if you divide your website into several categories using directories e.g. http://website.com/category1 , category2 …. and have items within each category like http://website.com/category1/item1 , item2 ….. you would expect item1 to be displayed if a user enters http://website.com/category1/Continue Reading…
Disable Directory Listing in Apache
Securing your web server is very important than the security of other computers on the network, because you can make other computers invisible on the internet using the “stealth mode” feature available on many firewalls. But the same cannot be done on the web server as it is meant for the complete public access. And the “public” might include beginner level users trying to curiously explore every nook and corner of you website and advanced hackers intentionally trying to find vulnerabilities on your website. And directory listing can be a boon for such people to start looking for juicy information.Continue Reading…
Running PHP code in HTML files
PHP can be useful when used in conjunction with html. Even if you don’t plan create full blown dynamic pages certain functions like server side includes can help you repeat the code less for commonly used things like menus and advertisements. But it can be irritating to end the file with a .php extension just because you’ve added a snippet of PHP code. Also some people say that pages with a .html extension rank more in search engines when compared to .php. I don’t know how far its true and I’ll leave it in your hands to experiment.
In this article I’ll focus on the things needed to be done for html to be parsed by the server. (More about this word later)Continue Reading…
How to create custom error page in Apache
Web Designing can be fun and interesting. Using the current cutting edge of web programming courtesy HTML5, CSS3 and jquery a beginner can easily create mind blowing web templates that look cool and refreshing. But all the hours of work to decorate the face of your site is wasted if the user encounters a bland looking error page containing technical jargon that leaves visitors scratching their heads. So custom error pages are the order of the day!!!Continue Reading…