How to test if a form is submitted?

Feb
16

We live in a very busy world, and sometimes we try to get things done quick-and-dirty. One of the most popular example is to create a PHP script that renders a view and also handles form submission (action). So, what is the best way to test if a form has been submitted?

For example, let's look at the HTML form snippet below:

Posted By scott read more

PHP Soap Client Example

Feb
09

1. What is SOAP?

SOAP (Simple Object Access Protocol) is an XML-based communication protocol designed to exchange information between applications. The protocol itself is not tied to a particular operating system or programming language, so the client and server running any platform written in any programming language can exchange soap messages. Web service is gaining popularity, and there are quite a few protocols available but SOAP is probably one of the most popular protocol used today. SOAP server publishes a service over a HTTP, and SOAP client consumes the service.

Posted By scott read more
Posted By admin read more

My serial printer doesn't work. What shall I do?

Feb
04

Serial printers generally do not require a device driver to work in a desired software application. If POS software cannot print directly to the serial printer, it is preferable to make sure we can print from the running operating system such as Windows or Linux. Here are a few things to do to diagnose serial printer problem.

Use the right cable. When trying to connect DTE (PC) to a DTE (such as printer), you'll need to use a null model cable. For information about RS232 Cabling, refer RS232 Cables, Wiring and Pinouts.

Posted By admin read more

TCP Sweep - What is causing it?

Feb
04

Running a company as a reseller web host, you'll often receive an email from your upstream provider reporting security violations. If you do not correct the problem in a timely manner, your upstream provider may block inbound and outbound traffic from the affected server.

Today, we received a security report from Savvis indicating that one of our Windows 2003 server is sweeping TCP port 445. This obviously violates their "Acceptance Use Policy". Here is the snippet of their log entry.

Posted By admin read more

How to find duplicate values in a table column?

Feb
04

There was an error with one of our application, and I needed to find table rows with duplicate values. The table column was not defined to have a unique index, but we weren't anticipating duplicate values. I needed an easier way to identify duplicate values in a table with simple SQL statement.

Consider the following "employee" table:

Posted By admin read more

How to install php-imagick on CentOS 5

Feb
04

ImageMagick is a software suite to create, edit, compose or convert bitmap images. To use this utility in PHP, you'll need to install ImageMagick Linux package and also build and install a PHP extension.

Prerequisite for installing imagick PHP extension is php-pear and gcc packages, so let's get those packages installed.

# yum install php-pear gcc

Now, that you have php-pear and gcc, you may install ImageMagick packages.

# yum install ImageMagick ImageMagick-devel php-devel
# pecl install imagick

Posted By admin read more

Multiple Constructors in PHP

Feb
04

In most object-oriented programming languages such as Java, C++ and C#, you can define multiple constructors each having different signatures. The class calls correct constructor based on the number of parameters, and data type of input parameters. In PHP5, however, you can have one and only one constructor. Constructor in PHP is defined with a reserved keyword, __construct(). If the __construct function doesn’t exist, PHP5 will search for the old-style constructor function by the name of the class.

Posted By admin read more

Copy and Paste Word document to HTML form

Feb
04

Many users without computer knowledge copy contents from a word document, and paste them into a HTML form (<textarea></textarea>) and expect to retain formating as well as special characters such as smart quotes and emdashes. You may opt to translate smart quotes to regular quotes and emdashes to regular dashes with a PHP script. If any user submits a non-ASCII character contents, you'll probably see weird characters in the database and HTML page. Finding and fixing just a few of them (curly quotes and em dashes) isn't going to solve the real problem.

Posted By admin read more

PHP $_SERVER environment variable

Feb
04

PHP provides a large number of predefined variables to all scripts, and $_SERVER array is commonly used to refer server-specific environment information. Per PHP.net documentation, the $_SERVER variable is defined as:

Posted By admin read more

Pages

Subscribe to Web Traffic Exchange RSS