Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php ?>
- <html>
- <head>
- <title>Multiple File Upload</title>
- <script type="text/javascript">
- function show()
- {
- var n = document.myform.jumfile.value;
- var i;
- var string = "";
- for (i=0; i<=n-1; i++)
- {
- string = string + "Pilih File: <input name=\"userfile"+ i + "\" type=\"file\"><br>";
- }
- document.getElementById('selectfile').innerHTML = string;
- document.myform.n.value = n;
- }
- </script>
- </head>
- </html>
- <?php
- include 'index2.php';
- include 'fungsi_editanq.php';
- $con = mysql_connect("localhost","root","");
- if (!$con) {
- die('Koneksi ke database gagal: ' . mysql_error());
- }
- mysql_select_db("uji1", $con);
- mysql_query("truncate table `tbberita`");
- mysql_query("truncate table `tbkeyword`");
- mysql_query("truncate table `tbstem`");
- mysql_query("truncate table `tbtoken`");
- echo "<form name='myform' enctype='multipart/form-data' method='POST'>
- Pilih Jumlah File
- <select name='jumfile' onchange='show()'>
- <option value='1'>1</option>
- <option value='2'>2</option>
- <option value='3'>3</option>
- <option value='4'>4</option>
- <option value='5'>5</option>
- <option value='6'>6</option>
- </select>
- <br><br>
- <input type='hidden' name='MAX_FILE_SIZE' value='20000000' />
- <div id='selectfile'>
- </div>
- <br>
- <input type='hidden' name='n' />
- <INPUT TYPE=SUBMIT VALUE='Stem!' name ='submit'>
- </form>";
- if(isset($_POST['submit'])){
- for ($i=0; $i<=$n-1; $i++){
- $string = file_get_contents ($_FILES['userfile'.$i]['tmp_name']);
- stemming2($string);//tidak dapat mengeksekusi fungsi stemming2,kenapa ya???padahal sudah saya looping
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment