3

I'm trying to create a test webpage that has a hyperlink to another page. That page calls a php script that queries a mysql table.

The first page is called hello-world.HTML
The second page is called select.php

The HTML code is

<li><a href="select.php">PHP Page</a></li>

When I click on PHP Page, instead of opening it downloads the page.

Note, I am using cloud 9 IDE. Both hello-world.HTML and select.php are in same folder. Moreover, when I execute select.php individually it generates the page and successfully retrieves records from mysql.

How I can resolve this?

SuperBiasedMan
  • 9,814
  • 10
  • 45
  • 73
Tushar Saurabh
  • 687
  • 2
  • 13
  • 27
  • 1
    maybe this can help you : http://stackoverflow.com/questions/18422140/apache-is-downloading-php-files-instead-of-displaying-them – Harsh Makani Aug 07 '15 at 11:34
  • @HarshMakani OP also said `when I execute select.php individually it generates the page and successfully retrieves records from mysql` so the linked question doesnt help I guess – Umair Ayub Aug 07 '15 at 12:50
  • Have you try to add the full path in your a link like : PHP Page ? – Mayous Aug 07 '15 at 13:10

1 Answers1

0

Because you are able to execute the php file directly, I suspect that PHP execution is disabled in the script's directory. Configuration will depend on whether you are using an Nginx or Apache server. If you've changed the config file, you might want to try setting it to the default settings.

Finally, it's also possible that the server doesn't have PHP support enabled (for some odd reason).

Aeron R
  • 75
  • 8