Tag: PHP

Refresh / Redirection

When you need your web page automatic refresh in 5 second or any second, use this meta tag.  It’s a simple code, put it between HEAD tag in your web page. This script easy but powerful. <HEAD> <meta http-equiv=’refresh’ content=’2;url=’file_name or URL’> </HEAD> // content = time (second) // file_name = name of file you …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/refresh-redirection/

cURL Function

cURL is a library which allows you to connect and communicate to many different types of servers with many different types of protocols. Using cURL you can: Implement payment gateways’ payment notification scripts. Download and upload files from remote servers. Login to other websites and access members only sections. PHP cURL library is definitely the …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/curl-function/

PHP sessions problem

Below are some of the common problems faced by beginners while using sessions in PHP. Headers already sent This is the most commonly faced error is also the easiest to fix. Lets first see what a typical HTTP response looks like. As can see from the image headers always precede (come before) the content. The …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/php-sessions-problem/

Set error reporting level to maximum

Configure your development environment to display all PHP warnings, notices and errors. This will help you code better and also help in catching potential bugs early in development phase. You can change the error reporting level at runtime by adding the following code at the top of your PHP script: <?php // Report all PHP …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/set-error/

SQL injections / Escape special characters like ‘,”,

In the simplest case, special characters may simply break your query. In a more extreme case, a hacker might use SQL injections to gain access to your application. So it is important that we escape these special characters with a (backslash). That is, insert a backslash before each special character. We can escape special characters …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/sql-injection-php/