简体   繁体   English

TYPO3 PHP在网站上不起作用

[英]TYPO3 PHP not working on website

On my Website with TYPO3 I want some PHP scripts to show some data on my Homepage. 在使用TYPO3的网站上,我希望一些PHP脚本在我的主页上显示一些数据。 Without TYPO3 it works well, however using TYPO3 it does not show results. 没有TYPO3,它会很好地工作,但是使用TYPO3,它不会显示结果。

I have some JS files included via TypoScript, which runs PHP files with the use of ajax. 我有一些通过TypoScript包含的JS文件,该文件使用ajax运行PHP文件。

I use the following AJAX call to my PHP scripts: 我将以下AJAX调用用于我的PHP脚本:

$.ajax({
        url : 'fileadmin/php/loadprices.php',
        type : 'POST',
        dataType : 'json',

        beforeSend: function(){
            $('#loadingSpin').show();
        },
....

The JS is executed properly, so it isn't the issue for that. JS已正确执行,因此这不是问题。 Without TYPO3, the PHP script is running properly too. 没有TYPO3,PHP脚本也可以正常运行。 On a local server (apache), the PHP script is executed. 在本地服务器(Apache)上,将执行PHP脚本。

On the IIS 6 Server the PHP script does not work. 在IIS 6服务器上,PHP脚本不起作用。

Does anybody know some tips? 有人知道一些提示吗? greets 打招呼

You probably run your website with realurl ? 您可能使用realurl运行您的网站吗? In that case if you are not working with baseUrl your link will be altered if it is opened from a "subdirectory" like yourdomain/link1/link2.html . 在这种情况下,如果您不使用yourdomain/link1/link2.htmlyourdomain/link1/link2.html ”之类的“子目录”中打开链接时,其链接将被更改。 The relative path fileadmin/php/loadprices.php becomes yourdomain/link1/fileadmin/php/loadprices.php that way. 这样,相对路径fileadmin/php/loadprices.php变为yourdomain/link1/fileadmin/php/loadprices.php

A simple solution is to change it to an absolute url: 一个简单的解决方案是将其更改为绝对URL:

url : '/fileadmin/php/loadprices.php',

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM