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.

 

 

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.