duanhuiuw12555 2014-05-29 23:05
浏览 46

为什么.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);
}
  • 写回答

2条回答 默认 最新

  • duanbiyi7319 2014-05-29 23:15
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值