Tag Archives: PHP

PHP CURL and AJAX

From http://stackoverflow.com/questions/19212293/mimicking-an-ajax-call-with-curl-php I’m scraping a site using curl (via PHP) and some information I want is a list of products which is by default only showing the first few ones. The rest is passed to the user when they click a … Continue reading

Share
Posted in JavaScript, PHP, Tips | Tagged , , | Leave a comment

A useful PHP function – get page url

Here is a function I got from the internet. It is a useful PHP function. I put here for my reference in the future. function getPageURL() { $isHTTPS = (isset($_SERVER[“HTTPS”]) && $_SERVER[“HTTPS”] == “on”); $port = (isset($_SERVER[“SERVER_PORT”]) && ((!$isHTTPS && … Continue reading

Share
Posted in Tips | Tagged , | Leave a comment

Error_reporting in PHP

I have rich experience in programming PHP and PERL. In Perl, I always add the following two lines to my scripts: use strict;  user warning; However, I could not find similar things in PHP. When I am working with a … Continue reading

Share
Posted in Tips | Tagged , , , | Leave a comment

A PHP example to generate WordPress-like category list

In one of my post I described a way to use SQL stored procedure to extract data in a particular order and then generate a list. you can find the post from the following link. A SQL stored procedure to … Continue reading

Share
Posted in PHP, Tips | Tagged , , , | Leave a comment

A generic PHP function to generate navigation bar for web applications

When you write a page with a long list in a web application, you may always want to break the list to pages to show only part of the list. And further, allow user use a navigation bar with page … Continue reading

Share
Posted in PHP | Tagged , , | Leave a comment