donglou1866 2014-02-20 22:06
浏览 13

我的标题有问题(位置)

I am very confused with this. I have a button which use JavaScript onClick. It should redirect to another page but it doesn't. It instead downloads the file.

Edit this is all the code

    <?php 
$getGoogleData="SELECT * FROM markers WHERE propid=$propID";
$QgetGoogleData=$db->query($getGoogleData)or die($db->error);
    if($QgetGoogleData->num_rows==1){?>
    <p style="color:#27AB00; font-size:16px; font-weight:bold;">There is already Map for this project, you can't edit it but you can reamove it and make a new one<br /><br /><input type="button" onClick="javascript:window.location.href='index.php?cid=9&proid=12&propId=<?php echo $propID?>'" value="Delete Current Map"></p>
    <?php }else{?>
    <p style="color:#CD0000; font-size:16px; font-weight:bold;">There are no Map for this project please make one<br /><br /><input type="button" onClick="javascript:window.location.href='index.php?cid=9&proid=11&p=<?php echo $propID?>'" value="Make Your Map"></p>
    <?php }?>

on the other page proid=11

case 11: header('Location:includes/pan/projects/google/face.php?p='.$p); break;

I found what is wrong but still this will not solve the problem. I have this file in the same directory .htaccess which content this code.

AddType application/x-httpd-php .js

AddHandler x-httpd-php5 .js

<FilesMatch "\.(js|php)$">
SetHandler application/x-httpd-php
</FilesMatch>

and I put this file because I have some php code witch will not work with the Js. without this file any help please.

  • 写回答

1条回答 默认 最新

  • dongling0519 2014-02-20 22:10
    关注

    If it downloads the PHP file then the odds are that the PHP is not being executed.

    PHP is (in this context) a server side language, it needs to run through a webserver. The most likely reasons for this not to work are:

    • You have no webserver
    • You have not installed PHP support on the webserver
    • You are running a webserver but are telling the browser to load the files with a file:// URI instead of an http:// URI so it isn't being used
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用