Tag Archives | PHP

PHP & CURL: step by step – HTTPS Source grabber

Example 3: HTTPS Source grabber Result: Note:

Read full story Comments { 0 }

PHP: how to use AJAX to upload file

We create a simple example to learn how to use AJAX to upload file. HTML Create simple form with a file input, we use accept attribute to validate image Javascript: PHP: file testuploadajaxdo.php We use folder products to store all uploaded images. Done 😀 Demo online: Demo upload ajax

Read full story Comments { 0 }

WordPress: how to set Featured image in custom post type

When you create a new custom type in WordPress, you need to use Featured image, how to set Featured image in custom post type? Step 1: you must place thumbnail in supports array See example below (for post type: actor): Step 2: You must add theme support for this post type See example below (for […]

Read full story Comments { 0 }

How to install SSH2 extension of PHP on Centos

Step 1: Install EPEL repo How to Install EPEL repo on CentOS Step 2: install dependencies If you receive the error: Because you have php5.4 but the Epel repo has php5.3. You must use Remi repo Result: PHP upgrade from 5.4.26 to 5.4.45 Now, you can check php-devel: Now, install libssh2-devel Step 3: Build SSH2 […]

Read full story Comments { 1 }
PHP: some method of determining the sun’s longitude – part 2

PHP: some method of determining the sun’s longitude – part 2

(Copyright image: www-mars.lmd.jussieu.fr) In the previous part, we know 3 method to determine the sun’s longitude base on the time. Now, we offer more an method to do this. We search on the book Explanatory Supplement to the Astronomical Almanac, it had equations for roughly calculating the position of the sun relative to the earth […]

Read full story Comments { 0 }

Centmin Mod: How to upgrade/downgrade PHP

Step 1: Use command Step 2: Use command: Then use menu 5. Type your version you want to install like 5.5.9 Type y Now you have PHP 5.5.9

Read full story Comments { 0 }

How to upgrade PHP5.3 to PHP5.4 on LINUX

In the previous tutorial, we learn How to upgrade PHP on LINUX, but in that tutorial, we install PHP5.3. Now, how to upgrade PHP5.3 to PHP5.4 on LINUX? Step 1: Find out the version of Centos You can use 2 methods: In this example, we use CentOS 5.3. Step 2: Add new Repository CentOS/RHEL 7.x: […]

Read full story Comments { 0 }

How to upgrade PHP on LINUX

Step 1: uninstall httpd Sample output: Sample Output: Note: if you use KLOXO, you will see Now you must reinstall lxphp: Sample Output: Step 3: Verify which version of httpd and php must install Sample output: We can see httpd.i386 For PHP: We can see php53.i386 Step 4: install httpd and php Sample output: Step […]

Read full story Comments { 1 }
PHP: How to get size of a remote file – Part 2

PHP: How to get size of a remote file – Part 2

Part 1: PHP: How to get size of a remote file With a local file, we can get file size of it by using filesize, but with a remote file, how to get size of a remote file? We offer some methods to get size of a remote file. Method 7: Note: after use curl_getinfo, […]

Read full story Comments { 1 }
PHP: How to get size of a remote file

PHP: How to get size of a remote file

With a local file, we can get file size of it by using filesize, but with a remote file, how to get size of a remote file? We offer some methods to get size of a remote file Method 1: use CURL Example 1: Result: Example 2: Result: Method 2: Method 3: use fsockopen Method […]

Read full story Comments { 1 }