Convert uploaded file with php -
i want convert .bib files html using php script (http://www.monperrus.net/martin/bibtexbrowser/)
i have form
<form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="file1"> </form>
the upload.php
:
<?php $_get['library']=1; define('bibtexbrowser_bibtex_links',false); // no [bibtex] link default require_once('bibtexbrowser.php'); global $db; $db = new bibdatabase(); // $db->load('uploads/ref.bib'); $db->load("uploads/". $file_name); // printing 2014 entries // can $query = array('year'=>'.*'); $query = array('year'=>'2014'); $entries=$db->multisearch($query); uasort($entries, 'compare_bib_entries'); foreach ($entries $bibentry) { echo $bibentry->tohtml()."<br/>"; } ?>
in other form want convert upload file:
<form method="post" action="convert.php"> <input type="submit" value="convert" class="submit"> </form>
convert.php:
<?php $_get['library']=1; define('bibtexbrowser_bibtex_links',false); // no [bibtex] link default require_once('bibtexbrowser.php'); global $db; $db = new bibdatabase(); // $db->load('uploads/ref.bib'); $db->load("uploads/". $file_name); // printing 2014 entries // can $query = array('year'=>'.*'); $query = array('year'=>'2014'); $entries=$db->multisearch($query); uasort($entries, 'compare_bib_entries'); foreach ($entries $bibentry) { echo $bibentry->tohtml()."<br/>"; } ?>
if uncomment $db->load('uploads/ref.bib');
work. want filename first form.
where mistake?
here trying: https://novelettish-ballast.000webhostapp.com/
Comments
Post a Comment