Netsuite invoke Saved Search in PHP - Example

May
08

I've created a fair amount of PHP code to create custom searches on Netsuite Platform. With introduction of 2012.2 endpoint late last year, my examples have to be rewritten using the 2012.2 PHP Tool Kit API.

Here are a few examples written with v2011.2 API.

How to change primary key values

May
06

To change values of existing integer field (`table` is the table name, and "id" is the column name), you may use the following update SQL command:

update `table` set id=id+10000;

Let's say that you have an ecommerce website, and you want your order number to begin 10001. But, you already have a handful of orders already so you'll just update the existing values.

If you're updating your primary key values, MySQL will automatically adjust auto_increment value to begin after the largest number stored in the database.

How to get Client IP address in PHP?

Apr
01

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

Mar
27

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

Feb
27

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?

Feb
27

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

Feb
21

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 "smtp.sendgrid.net". 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?

Feb
07

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)?

Feb
04

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

Nov
05

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?

Pages

Subscribe to Web Traffic Exchange RSS