0

I have just found this code that promises to show publications as bib file in webpage using a php script.

But I have no idea of using php (though I know working on html5).

As from the FAQ of his site How to embed a publication list in an home page? I have created a basic html page as:

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

With this, I am expecting to see the foo.php's content in the page, but all I am getting a blank page.

But, as I said, I have no idea of using php in html, this is not working (The tutorials in w3school is not of much use). So, kindly help.

NB: I am attaching a minimal foo.bib:

@misc{ Nobody06,
       author = "Nobody Jr",
       title = "My Article",
       year = "2006" }

NB: As per Nick's reply

$ 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

And for i.html as the code:

$ 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>

but in webpage its still empty.

4
  • does the file `bibtexbrowser.php' exist, and is it in the same folder as the file you show in your question? Also, follow the adcive of @Nick to get error messages. Commented Jul 31, 2015 at 14:13
  • 2
    Ugh, why are you assigning values to $_GET like that? Commented Jul 31, 2015 at 14:13
  • @ʰᵈˑ - this is how the software works... Commented Jul 31, 2015 at 16:42
  • php -f i.html - this show normal page. try executing test.php and i.php via webserver and the browser. Commented Jul 31, 2015 at 16:43

1 Answer 1

2

Make sure your server have PHP support.

To check this, create small file test.php :

<?php phpinfo(); ?>

Upload ad check if you can see proper page.

Then you need to make sure you have required PHP version. test.php will show you PHP version and you need to compare it to the requirements.

Then, check if you are not getting error from the included file. Do this:

<!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>

Upload and check.

Hope this helps.

Sign up to request clarification or add additional context in comments.

2 Comments

Note: Setting error reporting like that (with display_errors) is not advised in a live environment.
Yes, but if you see white page? :) Also I do not think this is live environment.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.