为什么.php被保存/打开而不是我点击按钮时显示的新页面? [关闭]

I have the following generateLink function which say creates the page for LPE but when I click the button in the LPE page it asks me if I want to open the IAT.php file instead of showing the gInstruct1.html for it which is shown in the following. Can you please guide me what I am doing wrong?

enter image description here

So I expect the following page with the following html to show up when I click on the Concepts and Images Study : enter image description here

<html>
<!-- Thin People         Fat People -->
<p style="margin-left:30px">In this task, you will be classifying concepts and images 1. Each concept or image will appear in the center of the screen, for example,</p>
</br>
</br>
</br>
<img src="GSE-GPE-02.png" class ='instrItem' style="margin-left:33%;"/>
</br>
</br>
</br>
<div style="text-align:center">Press the <b>space bar</b> to continue.</div></html>

However when I click on that button I receive the following : enter image description here

Here's the index2_4.html generateLink function:

function generateLink() {
    var linktext;
    if (Math.random() < 0.5) {
        if (Math.random() < 0.5) {
            //GSE
            //linkText = "<p>In this study, you will complete a reaction-time GSE task using your computer. You can find the task at this link: </p><a href='http://langcomplab.net/Concepts&Images/GSE_new/IAT.php' target='_blank'> Concepts and Images Study</a>";
            linkText = "<p>In this study, you will complete a reaction-time GSE task using your computer. You can find the task at this link: </p><a href='GSE_new/IAT.php' target='_blank'> Concepts and Images Study</a>";

        } else {
            //GPE

            linkText = "<p>In this study, you will complete a reaction-time GPE task using your computer. You can find the task at this link: </p><a href='GPE_new/IAT.php' target='_blank'> Concepts and Images Study</a>";

            //   linkText = "<p>In this study, you will complete a reaction-time GPE task using your computer. You can find the task at this link: </p><a href='http://langcomplab.net/Concepts&Images/GPE_new/IAT.php' target='_blank'> Concepts and Images Study</a>";
        }
    } else {
        if (Math.random() < 0.5) {
            //LSE
            //linkText = "<p>In this study, you will complete a reaction-time LSE task using your computer. You can find the task at this link: </p><a href='http://langcomplab.net/Concepts&Images/LSE_new/IAT.php' target='_blank'> Concepts and Images Study</a>";

            linkText = "<p>In this study, you will complete a reaction-time LSE task using your computer. You can find the task at this link: </p><a href='LSE_new/IAT.php' target='_blank'> Concepts and Images Study</a>";
        } else {
            //LPE
            linkText = "<p>In this study, you will complete a reaction-time LPE task using your computer. You can find the task at this link: </p><a href='LPE_new/IAT.php' target='_blank'> Concepts and Images Study</a>";

            //                        linkText = "<p>In this study, you will complete a reaction-time LPE task using your computer. You can find the task at this link: </p><a href='http://langcomplab.net/Concepts&Images/LPE_new/IAT.php' target='_blank'> Concepts and Images Study</a>";
        }
    }
    $('#iatLink').html(linkText);
}

if you run the following commands on your machine they will install Apache/PHP so your php scripts will run correctly.

sudo apt-get install apache2

sudo apt-get install php5

sudo apt-get install libapache2-mod-php5

sudo /etc/init.d/apache2 restart

Once this is done place your website into:

/var/www/html/

then navigate in your browser to:

http://localhost/

and you should see your site.

Looking at the browser url input, it seems you are not using http server, but rather you are accessing the file straight from your desktop. Use a web server with http protocol and fcgi as Victory pointed out. Apache or if you like, go for WAMP or LAMP or MAMP depending on the platform you are using.