Saturday, April 17, 2010

how to include PHP code in html files

As a scripting language, PHP offers the flexibility to be intermixed with HTML code, to enhance the functionality of web pages. To do this, you need to instruct the web server to pass the HTML pages trough the PHP interpreter, so that any snippets of code could get executed.

If you use Apache, one easy way to accomplish this is to use the .htaccess file in the folder of your app and add some clauses like this:

AddType application/x-httpd-php .html 
Addhandler x-httpd-php .html

You can place the .htaccess file in the parent folder that's closest to the html files containing PHP. Doing so will avoid any overhead in parsing files that wouldn't contain PHP code.

Wednesday, April 07, 2010

navigating the PayPal customer service maze

I use PayPal to process payments and implement the shopping cart on my website. Recently I got an order that went through with the sales tax incorrectly calculated. So I tried to contact them to find out the cause of this issue, as this would be having a major business impact if it continued on future transactions. 


My first attempt was via email, to which I got a reply saying that they have no access to my selling preferences, where the sales tax are set, so I should call a phone number to get better help. I called that number (long distance, no toll-free, FTW) jut to be placed on interminable holds and have suggested a ridiculous "solution", not applicable to the issue at hand. What pissed me off the most was the ease with which they brushed the whole thing aside, with no attempt to find the root cause of the problem.


I was pretty sure it was a bug on their side and what I needed was someone with some technical competence in investigating this. The good thing is that they have a developers' site, with a forum. Browsing through, I found a way to submit trouble tickets at https://www.paypal.com/mts. That's a very good way to reach the Merchant Technical Services. The nice thing was that within 5 minutes after my submission a reply came, apparently not automatic, acknowledging the issue and saying they are working on it.