@ sign in front of variable

Sometimes in your programming you’ll need to use @ sign in front of a variable. For example, @$_REQUEST[“username”]; The @ sign is an error control operator. When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored. For example: $value = @$cache[$key]; // will not issue a notice if the index $key doesn’t exist.

Continue reading »

imagegrabscreen function in php5

imagegrabscreen function is only available in PHP 5.2.2. This function is useful when it’s necessary to make a screenshot of a website or a private application web page. For example, when a lender wants to view credentials of an appraiser before an appraisal job is assign. That appraiser should reveal his/her credentials of their license/certificate/reports in an image rather than in html format. Here is how you’re going to use it. Remember to upgrade your server to php version 5.2.2, or if you have a hosting provider, ask them…

Continue reading »

How to send emails out using PHPMailer and GMail

I’ve been working on a schedule calendar project that can be iframed into any kind of website. This schedule will be a real-time calendar which can be used for class registration, training classes, webinar registration, cooking schools, camping registration, and more …. The calendar will be run on Linux server and MySQL Database. Step 1: download class phpmailer on sourceforge.net Step 2: unzip the package and place all files in a folder called /includes/ anywhere on your server. However, you need to access to this folder…

Continue reading »

Display Source Code of a page

Sometimes, you may want to show just the source code of a file rather than having it translated in a web browser. For example, if you want to show your visitors how to write a certain php/asp or even an html source codes as tutorial scripts, you can instruct your server to display just the contents of the file rather than executing them by using your htaccess file to block the execution. This method will ensure the security of your blog website. In order to do this, you must create a folder for…

Continue reading »