We're having a wierd issue, we're using an online ordering platform script that we bought few months ago. It was working very fine since all these previous months, until now ! The website's page doesnt load, checking Chrome and Firefox Inspectors, we're seeing an error saying : Uncaught SyntaxError: Unexpected token ILLEGAL on file list.php
that list.php is being called from index.php , throught this line :
<script type="text/javascript" src="panel/js/list.php"></script>
I think that the browser, sees/reads the file as a JavaScript, then it finds inside the file PHP code, and this is why it throughs up that nasty error and preventing the page from loading.
I just want to know how I can make that php to work, even it is inside the <script> </script>
PS: <?php include('panel/js/list.php'); ?>
nor <?php require('panel/js/list.php'); ?>
didn't work
PPS: I tried to put that line right before with no posetive result aswell
Here is the code inside list.php
<?php
function GetLangFile($lang)
{
$lang_file = 'lang.'.$lang.'.php';
return $_SERVER['DOCUMENT_ROOT'].'/languages/'.$lang_file;
}
// Get language from get or put default as en
$lang_file;
if(isset($_GET['l']) && $_GET['l'] != '')
$lang_file = GetLangFile($_GET['l']);
else
$lang_file = GetLangFile('en');
// Include the selected language file
include_once $lang_file;
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))ob_start("ob_gzhandler");else ob_start();
header("Content-type: text/javascript; charset: UTF-8");
include('md5.js');
include('front.js');
include('shopping.js');
include('paypal.js');
include('mercadopago.js');
include('adsmanager.js');
include('tags.js');
include('front-visuals.js');
include('browserdetect.js');
include('popup.js');
include('social.js');
include('forms.js');
include('uploader.js');
include('googlemap.js');
include('switch.js');
include('howbox.js');
include('tip.js');
include('jCarouselLite.js');
ob_end_flush();
?>