I have a link in an html file. This link points to a .php file. It's like<a href="file.php">. But when I click the link there pops out a small window prompts me to download the file instead of showing the page in the browser. Why's that?
Thanks,
Your PHP is either not installed correctly an therefore not working or you have to add the MIME type in your server configuration.
Varasurf
But how could I set MIME type? You mean in Apache configuration file?
In Apache the httpd.conf file there needs to be a line
AddType application/x-httpd-php .php
So it understands the php extension. You can also add .php3 extension to this too by doing this AddType application/x-httpd-php .php .php3
I added it and tried but it still showed "file download" window instead of showing the page.
Try looking here
Usually, the page will go to a .php file by clicking on a button in a form. This is I want to execute a .php file by clicking a link. But it didn't work. Can I make the html page jump to a page generated by php by clicking a link, like this <a href="file.php">to php page</a>?
Can I make the html page jump to a page generated by php by clicking a link, like this <a href="file.php">to php page</a>?
Yup. But you can't pass form contents that way. If you're using Linux, can't you just install the distro's own apache and mod_php rpms?