Jump to content

[SOLVED] Browser wants to download .PHP file


dosdoctor

Recommended Posts

Hi.  I am a newbie to php and am working on an online form.  The form is named contactForm.php

 

I was told that the filename has to have the .php extension to work.  Problem is, when I link to the file from an .html page, the browser wants to download the file.

 

I thought I found a solution, but it only works in Firefox.  This solution is one I found in a php forum.  The solution was instead of linking to the .php file, to link to a file named contactForm.html which had this content:

 

<html>

<!--Redirect form to .php form processing-->

<body>

<meta http-equiv='refresh' content='0;url=contactForm.php />

</body>

</html>

 

I'm not sure why it works, but in Firefox it works beautifully.  The form opened, re-posted to itself, validated, and processed.

 

But NOW...I tried it in Internet Explorer and all I get is a text message:

<meta http-equiv='refresh' content='0;url=contactForm.php />

 

Can anyone tell me how to make this .php file open/run in both browsers?

 

Any help is greatly appreciated.

 

Thank you.

 

 

if your file is named.php and the server is configured correctly this should not be happening.

 

test your server by placing a file up with just

 

<?php

phpinfo();

?>

 

in it and put the pages address in the address bar. If the server has php enabled for your site then it spit out the installation details - if not then get your server dudes to sort it...

Thank you.  I'll try that.  But I did find the answer...

 

I had to add the following tag in the <head> section:

<link rel="alternate" type="text/css" href="contactForm.php" />

 

Now I can link the the contactForm.php as usual.

 

Thanks for your help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.