在网页中使用php

在网页中使用php,php,html,Php,Html,我刚刚发现了一些代码,它们承诺使用php脚本将出版物显示为网页中的bib文件 但是我不知道如何使用php(尽管我知道如何使用html5) 从他的网站的FAQ中,我创建了一个基本的html页面,如下所示: <!DOCTYPE html> <body> <?php $_GET['bib']='foo.bib'; $_GET['all']=1; $_GET['academic']=1; include( 'bibtexbrowser.php' ); ?> </

我刚刚发现了一些代码,它们承诺使用
php
脚本将出版物显示为网页中的
bib
文件

但是我不知道如何使用php(尽管我知道如何使用html5)

从他的网站的FAQ中,我创建了一个基本的html页面,如下所示:

<!DOCTYPE html>
<body>
<?php
$_GET['bib']='foo.bib';
$_GET['all']=1;
$_GET['academic']=1;
include( 'bibtexbrowser.php' );
?>
</body>
</html>
NB:根据尼克的回复

$ php -f test.php |more
PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/tmp/bibtexbrowser/test.php on line 1
phpinfo()
PHP Version => 5.6.11
对于
i.html
作为代码:

$ php -f i.html 
<!DOCTYPE html>
<body>
<ul><li><a href="#OtherPublications">Other Publications (1)</a></li></ul>
<a name="OtherPublications"></a><h2>Other Publications (1)</h2>
<table class="result">
<tr><td colspan="2" class="theader">2006</td></tr>
<tr class="bibline"><td class="bibref"><a class="bibanchor" name="1"></a>[1]</td><td class="bibitem"><span itemscope itemtype="http://schema.org/ScholarlyArticle"><span class="bibtitle"  itemprop="name">My Article</span> (<span class="bibauthor"><span itemprop="author"  itemtype="http://schema.org/Person">Nobody Jr</span></span>), <span itemprop="datePublished">2006</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.btitle=My+Article&amp;rft.genre=report&amp;rft.pub=&amp;rfr_id=info%3Asid%2F%3Afoo.bib&amp;rft.date=2006&amp;rft.au=%3Cspan+itemprop%3D%22author%22++itemtype%3D%22http%3A%2F%2Fschema.org%2FPerson%22%3ENobody+Jr%3C%2Fspan%3E"></span></span> <span class="bibmenu"><a class="biburl" title="Nobody06" href="bibtexbrowser.php?key=Nobody06&amp;bib=foo.bib">[bibtex]</a></span></td></tr>
</table></body>
</html>
$php-f i.html

但在网页中它仍然是空的。

确保您的服务器支持PHP

要检查这一点,请创建小文件test.php:

<?php phpinfo(); ?>
上传并检查


希望这有帮助。

文件'bibtexbrowser.php'是否存在,是否与您在问题中显示的文件位于同一文件夹中?另外,按照@Nick的adcive获取错误消息。呃,为什么你要这样给
$\u get
赋值呢?@ᵈˑ-软件就是这样工作的…
php-f i.html
-显示正常页面。尝试通过Web服务器和浏览器执行test.php和i.php。注意:在实时环境中不建议设置类似的错误报告(使用
display\u errors
)。是的,但如果看到白页?:)我也不认为这是生活环境。
<?php phpinfo(); ?>
<!DOCTYPE html>
<body>
<?php

error_reporting(E_ALL);
ini_set("display_errors", 1);

$_GET['bib']='foo.bib';
$_GET['all']=1;
$_GET['academic']=1;
include( 'bibtexbrowser.php' );
?>
</body>
</html>