How to get Client IP address in PHP?


There are a number of array name/value pairs provided in the PHP's "predefined" $_SERVER variable, which you can use to extract client's IP address. Some of the IP related $_SERVER parameters retrieved from the web server are passed by the client in the form of HTTP header, so they can be easily spoofed.

Trap spambots from submitting forms with honeypot and PHP


One of the duties of webmaster is to prevent spambots from submitting web forms. If spammers are not blocked, the data collected from the visitors will contaminated with spams and it's a real nuisance to clean out this data every so often. I have been researching ways to block spams on web forms we have on our website, and found a solution that works reasonably well.

[SOLVED] Google Chrome not loading external stylesheet.css


We have a webpage with a link to external stylesheet, but the Google Chrome doesn't appear to load the stylesheet while Firefox, Mozilla and IE displays the page correctly. Only some versions of the Chrome is not applying the styles defined in the external .css file.

We've found the cause of the problem to be one of the following two scenarios:

How to scroll to the top after a form submission in iframe?


This is not very likely scenario, but we use an iframe to embed a third-party content containing a multi-page form with a varying length of contents. The submit button on the earlier page is down near the bottom, but the resulting page is short and the content appears on the top. So, when a user submits the form the resulting page is empty as the contents are all the way on the top, and the browser is scrolled down too far. How do you get around this problem?

I did a google search, and found a couple of solutions:

[SOLVED] Outlook stripping newline character - Sendgrid


We've recently modified our ecommerce web application, and replaced the native PHP mail functionality with a phpmailer and SMTP. It was a pretty straight forward change, and we kept the mail format to "Plain/Text" format and changed the mail host to "". After the change, we've noticed that the newline "\n" wasn't interpreted correctly and the mail we received were all garbled up. After some investigation, we found 2 things that needed to be changed to correct the problem.

How to install Zend Framework 2 skeleton application?


For anyone getting started with Zend Framework 2 (or ZF2), the best way to get up and running quick is by installing the Zend Skeleton Application available on github. Here is the quick and easy way to get the skeleton application installed on Linux machine. You'll install the skeleton application first, and then we'll install ZF2.

1. Change directory to where you want to install ZF2 Skeleton Application.

How to edit Windows hosts file (C:\Windows\System32\Drivers\Etc\hosts)?


Windows users have a trouble saving plain TXT files without extensions on a Windows machine. For example, if you have to edit C:\Windows\System32\Drivers\Etc\hosts file and save as a plain text file, Windows will automatically add .txt file extension to the file and save it as hosts.txt. Also, Windows does not allow you to edit the file directly in the system folder such as the C:\Windows\System32\Drivers\Etc.

To get around this problem, you'll first have to change folder options of your Windows machine. To do this, please follow the instruction below.

Centos 6 (VMware) Sticking Mouse Cursor - PDF Viewer Related


I'm running Centos 6, and every once in a while the cursor changes to the one shown below

I am not 100% sure, but this has happened about 3 times and it may have to do with Adobe Acrobat reader. Clicking on the windows doesn't do anything, and the only way to solve this problem is by rebooting my VM instance. Any idea what may be causing this issue?

[SOLVED] Sendmail to remote server for local domain ignores MX record


Problem: You have a contact us form hosted on your website sending an email to your local domain, but the email never leaves your web server because your mail server is hosted elsewhere. The mail works fine for all other email domains (your customers receive confirmation emails), but your own domain fails to arrive (cc'ing to yourself).

This is really mind boggling problem, and it took me a while to find a solution that works in my environment. In a nutshell, there are a number of solutions but in certain environment first few options doesn't work.

Netsuite PHP Search Tutorials


To perform operations on Netsuite records and objects, it is crucial to understand search functionality provided by Netsuite. Netsuite offers basic and advanced search objects on various record types, and their operations are practically the same.

The search results are either an array if there are more than 1 record returned, or an object if there is only 1 record in its result set. As a programmer, the result set must be examined whether it's an array or an object before performing an operation on them.


Subscribe to Web Traffic Exchange RSS