Ask us if you have any question about PHP, MySQL, Apache,
Linux or optimizing your website for quick answers!!!

Download data as csv using PHP

This is a very simple example to download data in csv format using PHP and MySQL. I have used a table with two columns i.e. id and name.

The main point to download file is a proper use of header(). It has said many times in many places but I repeat here, "Make sure there must not be any sort of output (including whitespaces) before header()". We can also set a default file name for the file.

Here is the PHP code
Read the rest of this entry »

Comments (12)

Enable register globals

It is strongly recommended that you do not turn on the register_globals. But if you still want to turn on register_globals then follow these steps

Make a .php file containing only this code

< ?php phpinfo(); ?>

And upload this file to your new server and open in the browser. In the page output find the value for 'register_globals'. If it is off, then you can solve this problem in the following ways

Read the rest of this entry »

Comments off

enable mod_rewrite in Apache 1.3+WinXP

mod_rewrite provides an effective way to make short/friendly URLs and it also makes your site more attractive for search engine crawlers.

You can enable mod_rewrite for Apache 1.3 with the below steps easily.

First step
Remove '#' in front of
LoadModule rewrite_module modules/mod_rewrite.so
Make sure 'mod_rewrite.so' is available under 'apache installation directory/modules'.

Second step
Remove '#' in front of
AddModule mod_rewrite.c
Read the rest of this entry »

Comments (2)

« Previous Page « Previous Page Next entries »