Execute php File - Not download

2 replies
  • WEB DESIGN
  • |
Hi

Old Hosting: Hostgator
New Hosting: Beyond Hosting
I moved one html site to a new hosting server.

In my button I have this code:
href="go2product1.php" title="Product Number One"

When the visitor clicks that button, on my old hosting the php script was executed (a tracking link inside the script).

On my new hosting the php file is downloaded.

What went wrong and how can I get the php program working again?

Thanks
Chris
#download #execute #file #php
  • Profile picture of the author Brandon Tanner
    IMO, the best way to do that is to put the button inside of a "submit" form, like...

    <form action="go2product1.php">
    <input type="submit" value="Product Number One">
    </form>


    If it still tries to download the PHP file instead of executing it, that could be caused by a few different scenarios...

    1) The 'go2product' file does not have a PHP extension (probably a dumb question, but worth mentioning just in case).

    2) PHP is not installed on your server. You can test this by creating a new PHP file with the following code, and then run it (navigate to the URL where it's at) to see if it displays the message ...

    <?php echo "PHP is installed!"; ?>

    3) PHP is installed but is improperly configured (php.ini file)

    4) The directory that the PHP file is in does not have the proper permission (execute).
    Signature

    {{ DiscussionBoard.errors[7399931].message }}
    • Profile picture of the author ChrisWF
      Hi Brandon

      thanks for your detailed answer.
      Because that sounded to "techie" for me I contacted the Beyond Hosting Support.
      Within an hour they fixed the error.
      In my htaccess file was an wrong entry. They commented out the entry regarding php execution and now all is working as it should.

      Now I have to check my other 50+ sites and blogs for more bugs related to the provider change.

      Thanks again
      Chris




      Originally Posted by Brandon Tanner View Post

      IMO, the best way to do that is to put the button inside of a "submit" form, like...

      <form action="go2product1.php">
      <input type="submit" value="Product Number One">
      </form>


      If it still tries to download the PHP file instead of executing it, that could be caused by a few different scenarios...

      1) The 'go2product' file does not have a PHP extension (probably a dumb question, but worth mentioning just in case).

      2) PHP is not installed on your server. You can test this by creating a new PHP file with the following code, and then run it (navigate to the URL where it's at) to see if it displays the message ...

      <?php echo "PHP is installed!"; ?>

      3) PHP is installed but is improperly configured (php.ini file)

      4) The directory that the PHP file is in does not have the proper permission (execute).
      Signature

      WAIT! Don't Buy The Expensive Amazon Course "Amazing Selling Machine" for $4K.
      Start With The Proven Amazon Course First!

      {{ DiscussionBoard.errors[7400938].message }}

Trending Topics