I downloaded a PHP code for minification of Javascript from here >> JSMin (PHP)
Along with, I made a php file to use that PHP class and minify the required js file, like this:
[PHP]<?php
//file name: minify.php
if (!isset($_POST['Submit']))
{
?>
<html>
<form action=minify.php method=post enctype="multipart/form-data">
<input type=file name=js></input>
<input type=submit name=Submit value=Minify>
</form>
</html>
<?php
}
else
{
include('jsmin-1.1.0.php');
if ($_FILES['js']['error']>0)
die ('Error Uploading File');
$file_js = fopen($_FILES['js']['tmp_name'],"r");
$js = fread($file_js,$_FILES['js']['size']);
//echo $js;
$min = new JSMin;
$minified = $min->minify($js);
//echo $minified;
}
?>[/PHP]
But it gives this warning...
Missing argument 1 for JSMin::__construct()
What to do... ?