PHP - Post_max_size And Upload_max_filesize, How To Control Them In A Php Page Not A Php Ini File
As we know , A post_max_size used to limit the size of posted data via POST method while the upload_max_filesize used to limit the size of file to be uploaded
I assume. post_max_size = 8m upload_max_filesize = 2m
When i limit the user to only upload 100kb file, i say <pre>
if (!empty($_FILES["myfile"]["tmp_name"]) && ($_FILES["myfile"]["size"] > 100000)) { </pre>
This message occur even when the file is greater than 8 m
The problem come when the file is greater than 10m the warning message for post content is on the page is
Warning: POST Content-Length of 9767236 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
What i want? I want to create my own warning as an error
ie <pre>
if (post_max_size > 18388608)) { </pre>
NB: some developers says we have to adjust the post_max_size i.e 200M what if user upload the file with 210M, the warning message will come back again
Warning: POST Content-Length of 9767236 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
In short i want to give a normal user a meaningful warning
Similar TutorialsHi, I created the code below for uploading anywhere from 1-15 PDF files at once. Originally I was hitting 8M limit and (as per my research) I asked my server admin to expand the post_max_size to 100M. Now he did and I verified it, but somehow now I can not upload more than cca 2MB files. What could be causing that? Thanks Code: [Select] $forms = array("form_1", "form_1A", "form_1B", "research_plan", "abstract", "form_1C", "form_2", "form_3", "form_4", "human_consent", "form_5A", "form_5B", "form_6A", "form_6B", "form_7"); foreach ($forms as $form_name) { if ($_FILES[$form_name]['name'] != "") { $allowed_filetypes = array('.pdf','.PDF'); $max_filesize = 104857600; $upload_path = 'upload/'; $extension = substr($_FILES[$form_name]['name'], strpos($_FILES[$form_name]['name'],'.'), strlen($_FILES[$form_name]['name'])-1); $filesize = filesize($_FILES[$form_name]['tmp_name']); $filesize_MB = $filesize / 1048576; $full_name = $_FILES[$form_name]['name']; $filename = "$_REQUEST[project_no] - $form_name$extension"; if (!in_array($extension,$allowed_filetypes)) {$error_1 = "yes";} if (filesize($_FILES[$form_name]['tmp_name']) > $max_filesize) {$error_2 = "yes";} if ($error_1 == "yes") { echo "One or more of the uploaded froms are not in allowed file format. Please upload only <strong>.pdf</strong> files <br/><br/><INPUT TYPE='button' VALUE='Go Back' onClick='history.go(-1);'>"; die (); } if ($error_2 == "yes") { echo "Maximum upload file size of <strong>100MB</strong> has been reached. <br/><br/><INPUT TYPE='button' VALUE='Go Back' onClick='history.go(-1);'>"; die (); } move_uploaded_file($_FILES[$form_name]['tmp_name'],$upload_path . $filename); mysql_query("UPDATE project_registrations SET $form_name = 'yes' WHERE project_no = '$_REQUEST[project_no]'"); } } echo "ISEF files for project number <strong>$_REQUEST[project_no]</strong> have been successfully uploaded."; mysql_query("UPDATE project_registrations SET isef_forms = 'yes' WHERE project_no = '$_REQUEST[project_no]'"); require ("upload_forms_email.php"); echo "<script language='javascript'> window.location.href='search_results.php?project_no=$_REQUEST[project_no]';</script>"; im trying to make an art gallery site for my sister with free hosting, i need upload_max_filesize to be at least 3m ive tried many free hosting services and they are all 1.5m ive tried what these guys say http://www.openg.info/entry/php-cpanel-change-upload-max-filesize-cpanel-access-php-ini which is put this in htdocs: .htaccess Code: [Select] #Enables mod_rewrite, otherwise all Rewrite directives below will not work RewriteEngine on #Activates php.ini config located in main folder to work also recursively for all subfolders, obviously replace your_cpanel_user with your full path, you find it in cPanel home page on the left it's called 'Home Directory' suPHP_ConfigPath /home/vol2/20x.cc/20x_6657899/public_html php.ini Code: [Select] upload_max_filesize = 3M post_max_size 8M memory_limit 128M max_input_time -1 which just gives me a 404 and ive tried running this, and it gives me the same old 1.5m every time index.php Code: [Select] <?php phpinfo(); ini_set("upload_max_filesize", "3M"); // Think that's right... phpinfo(); ?> im trying to make an art gallery site for my sister with free hosting, i need upload_max_filesize to be at least 3mb ive tried many free hosting services and they are all 1.5mb ive tried changing it with .htaccess files and php.ini files, seems the free hosts are cracking down on that stuff does anyone know of a free hosting service that has at least 3mb upload_max_filesize? or perhaps someone knows of a service where it can be changed with php.ini files or .htaccess files Do any of you know how to override the php.ini file on a webhost to allow uploads using php to be set for 2gig mx file size? .htaccess is not working and my host says it supports changing the php.ini but nothing seems to be working. Hello: I have a question. I use to - when I was doing Classic ASP - make a single navigation file to include all aspects of site navigation. I'm trying to do that now in PHP, but keep getting errors. Can some set me straight (I am assuming what I want to do can be done in PHP). I have my myNav.php file (in an "include" subfolder): Code: [Select] <?php function showLinks() <script type="text/javascript" src="include/spNewWindow.js"></script> <script type="text/javascript" src="include/openSesame.js"></script> <link rel="stylesheet" type="text/css" href="include/StyleSheet.css" /> ?> <?php function showTopMenu() <a href="#">Link 1</a><br /> <a href="#">Link 2</a><br /> <a href="#">Link 3</a><br /> ?> This is the myPage.php I am trying to pull it in to: Code: [Select] <?php include('include/myNav.php'); ?> <html> <head> <title></title> <?php echo $showLinks; ?> </head> <body> <div id="myMenu"> <?php echo $showTopMenu; ?> </div> ... REST OF SITE, ETC ... </body> </html> However, this is not working at all. I have figured out how to make files for each individual aspect - Menu, Footer, META tags, etc - but I would like to do this with one file as shown above. Is this possible? Thanks! Hi, I've done some serious google'ing... I'm all googled out and it doesn't appear there is a solution to this the way I'm attempting it and it's probably more a case of my early ventures into development that I'm missing something that may or may not be a better and if not more obvious way to do this... Here's the principle, Customer Logs into webpage - greeted by profile page (all cushty so far) - Can choose to move to view 'audio files' which relate to the products they have purchased (this is where it gets silly...) The idea is that both the profile page and the audio page are controlled by a $_SESSION within PHP scripting so the pages are dynamic. I want to include all of the audio files for every product on the 'audio.php' page BUT I only want the ones that they have purchased to be visible... All the setup is fine because the following works fine: Code: [Select] if($info['halftimerock'] == 1) { echo "<p>Half Time Rock</p>";} Which essentially checks the db, finds a 1 in the appropriate product and displays the name of the product in a list, if no products then nothing in the list etc. What I want to do is control the visibility of some <div>'s using the same kind of idea, so: Code: [Select] if($info['halftimerock'] == 1) { CODE TO DISPLAY DIV IN HERE } I have a 'toggleelement' JS function available which works for mouse clicks but obviously php and js don't exactly go well together so that is probably not the way to go, I'm already running a lot of PHP at the top of the page before the HTML to stop session header errors. A couple of web searches have suggested I insert a <script> tag into the echo command but I can't get that to work and I guess it's a really messy way of trying to do things! So here's the question, any ideas about how to toggle <div> visibility within php or is that purely something for js to handle?... Is there a better/cleaner way of doing it all, perhaps redirecting users to different pages based on their entries in the DB (which could all be handled with headers but I'll end up with a million different pages and combinations eventually? I could always create a .htaccess/.htpasswd file system and handle the folders with audio content in manually so that all files are visible but only a valid username and password will be able to access the file but that's going to get annoying for people having to put in user/pass for every file and also for me updating the users for each individual file every time some1 buys something... Any ideas? Anybody done anything similar? Cheers Below is the screenshots and script for user page level access i have used it for one of my old projects. Code is working as it was intended. But it needs to be improvised. Users table
pages table , which has all the pages and links
Access level table. which has user id from users table and page id from pages table (for which user has access)
Once the user is created, admin gives access to the user on page basis, the permissions.php page looks like this The modules
Menus inside the modules
Pages in each menu
Here is my code for permission.php <div id="demo2-html"> <ul id="demo2" class="mnav"> <li><a href="#">Sales</a> <ul> <li><a href="#">Lead</a> <ul> <table class="table table-bordered table-striped table-hover"> <?php $s1 = mysqli_query($con, "SELECT pages.page_id as pid, pages.code, pages.page, pages.href, access_level.aid, access_level.page_id as pgid, access_level.user_id FROM pages LEFT JOIN access_level ON (pages.page_id=access_level.page_id AND access_level.user_id=".$user." ) WHERE pages.code='led'") or die(mysqli_error($con)); while($s2 = mysqli_fetch_array($s1)) { ?> <tr><li><td><?php echo $s2['page']; ?> </td><td><input type="checkbox" name="sn[]" value="<?php echo $s2['pid']; ?>" <?php if($s2['pgid'] === $s2['pid']) echo 'checked="checked"';?> /> <input type="hidden" value="<?php echo $s2['pid']; ?>" name="page_id[<?php echo $s2['pgid']; ?>]"> </td></li></tr> <?php } ?> </table> </ul> </li> <li><a href="#">Customer</a> <ul> <table class="table table-bordered table-striped table-hover"> <?php $s1 = mysqli_query($con, "SELECT pages.page_id as pid, pages.code, pages.page, pages.href, access_level.aid, access_level.page_id as pgid, access_level.user_id FROM pages LEFT JOIN access_level ON (pages.page_id=access_level.page_id AND access_level.user_id=".$user." ) WHERE pages.code='cst'") or die(mysqli_error($con)); while($s2 = mysqli_fetch_array($s1)) { ?> <tr><li><td><?php echo $s2['page']; ?> </td><td><input type="checkbox" name="sn[]" value="<?php echo $s2['pid']; ?>" <?php if($s2['pgid'] === $s2['pid']) echo 'checked="checked"';?> /> <input type="hidden" value="<?php echo $s2['pid']; ?>" name="page_id[<?php echo $s2['pgid']; ?>]"> </td></li></tr> <?php } ?> </table> </ul> </li> //code goes for all the other modules </ul> </li> </ul> </div> <input type="hidden" name="user" value="<?php echo $user; ?>" /> <div class="row" align="center"> <input type="submit" name="submit" class="btn btn-success" value="Save" /> </form> // form Submission if(isset($_POST['submit'])) { $user = $_POST['user']; $sql = "DELETE FROM access_level WHERE user_id = ".$user.""; $query = mysqli_query($con, $sql) or die (mysqli_error($con)); foreach($_POST['sn'] as $sn) { $sql = "insert into access_level (page_id, user_id) values (".$sn.", ".$user.")"; $query = mysqli_query($con, $sql) or die (mysqli_error($con)); } if($query) { header("location:users.php?access=1"); } }
So against each user i am storing all the page ids here. When i edit any of the users, it deletes all the records and again insers new records. Which i feel is not a proper way to do. And in codewise also, i am redirecting the user to no_access.php (as below) page if the user do not have access. <?php ob_start(); include("connect.php"); include("admin_auth.php"); $q1 = basename($_SERVER['REQUEST_URI'], '?' . $_SERVER['QUERY_STRING']); $q2 = $_SERVER['REQUEST_URI']; $var1 = "/".$q1; $qa_path=explode('/', $q2); $right_path = $qa_path[2].$var1; $parsedUrl = parse_url($q2); $curdir = dirname($_SERVER['REQUEST_URI'])."/"; $m4 = "select p.page_id, p.code, p.page, p.href, al.aid, al.page_id, al.user_id FROM pages p INNER JOIN access_level al ON p.page_id=al.page_id WHERE al.user_id=".$_SESSION['user_id'].""; $m5 = mysqli_query($con, $m4) or die (mysqli_error($con)); while($nk1 = mysqli_fetch_array($m5)) { $href1[] = ($nk1['href']); } if(in_array($right_path, $href1)) { echo "<script type='text/javascript'> document.location = ".BASE_URL."/".$right_path."</script>"; } else { echo "<script type='text/javascript'> document.location = '../no_access.php' </script>"; exit(); } ?> I need help in improve and better/effective (structural) way to do this both in database and php script. I was wondering how I would go about doing a sorting of a new element being added on the page. This element would have to be alphabetically sorted into the existing elements onto the page. For example: I am making a file manager, so when a user creates a new file, it would be sorted into the already existing files and displayed in the spot that it should.
All necessary details would be provided by PHP, so I would only need help with the JavaScript part.
Honestly, I have no clue how I would get around to doing that. I was thinking earlier that it would involve looping through each class of file_name and getting the text() value. Then add all of the values into an array and sorting it somehow. Then it would be getting the <tr> of which file_name is before it, and then append under it somehow.
I'm not asking for any free code, but I was wondering which (JavaScript/JQuery) functions I would be looking for. I was also wondering if the idea I had would be beneficial or not, or if there were any other ways. Here is how the files are displayed as is:
<?php // There may be undefined variables, this is only part of it $return = '<table id="manager" class="table table-bordered"> <thead> <tr class="table_header"> <th><input id="select" type="checkbox"></th> <th>Name</th> <th>Size</th> <th>Last Modified</th> <th>Type</th> <th>Permissions</th> <th></th> </tr> </thead> <tbody>'; $path = $_SERVER['DOCUMENT_ROOT']; // Scan the directory and remove the paths from the result $files = array_diff(scandir($path), array(".", "..")); // Get the number of files in the directory $num_files = count($files); // If there are no files in the directory, return the empty directory variable we defined earlier if($num_files == 0) return $empty_dir; $directory_array = array(); $file_array = array(); foreach($files as $file) { // Set the path correctly $file_path = $path."/".$file; // If the item is a directory if(is_dir($file_path)) $directory_array[] = $file; // The item is a file else $file_array[] = $file; } // Sort each of the arrays alphabetically sort($directory_array); sort($file_array); // Merge the directories and files into one array - directories shown first $files = array_merge($directory_array, $file_array); // Loop through the items foreach($files as $file) { $file_name = $file; // Set the path correctly $file = $path."/".$file; // Get the information for the file if(is_dir($file)) $file_size = "--"; else $file_size = @filesize($file); if($file_size === false) { $checkbox = '<input id="files_check" type="checkbox" name="files[]" value="'.htmlentities($file_name).'">'; $file_name = htmlentities($file_name). " - <b>Fatal Error Reading</b>"; $file_size = "--"; $last_modified = "--"; $type = "--"; $permissions = "--"; $actions = "--"; } else { $finfo = finfo_open(FILEINFO_MIME_TYPE); $checkbox = '<input id="files_check" type="checkbox" name="files[]" value="'.htmlentities($file_name).'">'; if(is_dir($file)) { $file_name = '<i class="icon-folder-open"></i> <a href="manager.php?path='.htmlentities($file_name).'/">'.htmlentities($file_name).'</a>'; } else { $file_name = '<i class="icon-file"></i> <a href="manager/view_contents.php?file=/'.htmlentities($file_name).'&token='.htmlentities($_SESSION['secure_token']).'">'.htmlentities($file_name).'</a>'; } $file_size = htmlentities(get_appropriate_size($file_size)); $last_modified = htmlentities(get_appropriate_date(filemtime($file))); $type = htmlentities(finfo_file($finfo, $file)); $permissions = htmlentities(substr(sprintf('%o', fileperms($file)), -4)); $actions = '<i class="actions"></i>'; } $return .= "<tr> <td>{$checkbox}</td> <td class='file_name'>{$file_name}</td> <td>{$file_size}</td> <td>{$last_modified}</td> <td>{$type}</td> <td class='permissions'>{$permissions}</td> <td class='action'>{$actions}</td> </tr>"; } $return .= '</tbody> </table>'; return $return; ?> I need to convert the following table and graph to PDF when button is clicked. Please help I am using fusion charts and generated graph will be swf file // Table and graph for all students if(isset($_POST['ReportAll'])){ $strQuery = ("SELECT registration_number,SUM(Fine) AS Total_Fine FROM lended_book_cd GROUP BY registration_number"); $result=mysql_query($strQuery); if (!$result){ Error (mysql_error()) ; } if (mysql_num_rows($result)!==0){ $table=1; echo $input_table; echo "<center>Fine report for All Students </center>"; echo "<br>"; echo "<table border='2' align='center'>"; echo("<tr>"); for($i=0;$i<mysql_num_fields($result);$i++){ echo("<th>".mysql_field_name($result,$i)."</th>"); } while($data=mysql_fetch_array($result)){ echo("<tr>"); for($i=0;$i<mysql_num_fields($result);$i++){ echo("<td>".$data[$i]."</td>"); } } echo "</table>"; } else{ Info ("No Fine Reports found for Student $_POST[regnum]"); } $strQuery = ("SELECT registration_number,SUM(Fine) AS Total_Fine FROM lended_book_cd GROUP BY registration_number"); //Where lended_book_cd.registration_number = students.registration_number $result=mysql_query($strQuery); $strXML = "<graph caption='Fine report for All Students' showLabels='1' xAxisName='Student Registration Number' yAxisName='Fine Value' showNames='1' showValues='1' useRoundEdges='1' palette='3'>"; while($ors = mysql_fetch_array($result)) { // Append the names of the countries and their respective populations to the chart's XML string. $strXML .= "<set name='$ors[registration_number]' value='$ors[Total_Fine]' />"; } $strXML .= "</graph>"; echo renderChart('charts/FCF_Column2D.swf', // Path to chart type '', // Empty string when using Data String Method $strXML, // Variable that contains XML string 'chart1Id', // Unique chart ID '560', '400', // Width and height in pixels false, // Disable debug mode true // Enable 'Register with JavaScript' (Recommended) ); } I have an excel file that I want to show in PHP page. I dont want this to first download and then view. I want it something like gmail where you just click on the file name and it opens up. Can you please give me an idea as how to do this. Regards, Faisa This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=327233.0 Hey im having troube making this code as i have no idea how to do it... basically what im trying to do is for example if the index.php?id=XXX i want to echo "this" and if it is just index.php i want to echo "that" your help would be nice thanks <?php $id_lang = $_GET['id']; if($id_lang == $id_lang){ $result = mysql_query("SELECT * FROM pages WHERE id='$id_lang' ",$connect); while($row44 = mysql_fetch_assoc($result)) { $js_langdir = $row44['lang_dir']; }} else{ $js_langdir = "LTR"; } ?> I need to get the page count of a multi-tiff and pdf file using php. I've looked into imagick but i'm having a hard time getting it to work. i'm using windows 2k3 iis, and php 5.2.8. Any suggestions? Thanks.
I have a snippet of code like this below. If I have it directly on my page, it works fine. But if I move this snippet of code into an include file and use "require_once('thefile.php');", the code no longer works properly. How is that possible? FYI, this snippet is in the middle of a for loop on the regular page. Maybe you can't use includes when in a loop? I don't know. Makes no sense that it works when on the page, but not when included using require once. Any thoughts how this could be possible? I imagine there is some rule with include files that I'm missing??? This is the code and I don't think it matters exactly what its doing so I won't bother you with that. This is how it looks on the page itself... Code: [Select] if ($type=="one") { $_SESSION['cluenum']=1; //so clue #1 begins as the selected clue echo "<script type='text/javascript'>document.getElementById('clue1').style.border = '1px solid red';</script>"; //sets the styling on clue #1 $allcode = "onclick='setnumber($i);'"; } else { // type must be equal to all, so don't do anything special $allcode=""; } This is how it looks in the include file... Code: [Select] <?php if ($type=="one") { $_SESSION['cluenum']=1; //so clue #1 begins as the selected clue echo "<script type='text/javascript'>document.getElementById('clue1').style.border = '1px solid red';</script>"; //sets the styling on clue #1 $allcode = "onclick='setnumber($i);'"; } else { // type must be equal to all, so don't do anything special $allcode=""; } ?> Hello All,
I have been going crazy trying to figure this out, I hope someone can help me out
I have header and footer.php files that on all my pages I get them to load with include,
but for some strange reason, this certain page it will not load I did some research and apparently theres problems with div and php, does anyone know how to make this work?
Thank you in advance,
Elaine
Attached Files
test.txt 4.81KB
7 downloads I have a bunch of pdf's and I want to extract text from the last page of every pdf. I have a function to count the number of pages in each pdf. Does anyone know of a way that I could extract file from a specified file and page number. example: getData('example.pdf', 54); Hi all I need some help, i have a list of orders on the left column and want to click on each order and display related db information in the right column in a div or other method for each record click. screenshot attached.
G'day all, i've got this script that I found on the net some time back but not entirely sure where, however it works well except I want to add a feature so it shows the image details from a txt file. Here is the gallery script: <?php function getDirectory( $path = '.', $level = 0 ){ $ignore = array( 'cgi-bin', '.', '..' ); $dh = @opendir( $path ); while( false !== ( $file = readdir( $dh ) ) ){ if( !in_array( $file, $ignore ) ){ if( is_dir( "$path/$file" ) ){ $dir = $path . $file; echo "<h2>$file</h2><p>"; $dh1 = @opendir( $dir ); while( false !== ( $image = readdir( $dh1 ) ) ){ if( !in_array( $image, $ignore ) ){ if( !is_dir( "$dir/$image" ) ){ if (preg_match("/.jpg/", $image)) { echo "<a href=\"$dir/$image\" rel=\"lightbox\"><img src=\"gallery-thumbnail.php?file=$file/$image\" border=2 style='border-color: #981C1E'></a>\n"; } } } } echo "</p>"; $level++; } } } closedir( $dh ); } getDirectory('gallery/'); ?> Now, what i'm wanting is to read a txt file either in the root or 'gallery' directory, where it has the file name, title, description, photographer. (something like filename.jpg|title of image|description about image|J King). so when the image is displayed, a script reads the text file and will show the image info beside it. Now i've got this bit of snippet from an old script I used once, but can't seem to get it to work anywhere, so any help is greatly appreciated. $text = "gallery.txt"; $fh=fopen($text, "r"); while(!feof($fh)) { $temp = explode("|", $line); $title[$temp[0]] = $temp[1]; $description[$temp[0]] = $temp[2]; $photographer[$temp[0]] = $temp[3]; $line=fgets($fh); unset($temp); } I'm experiencing a very strange issue, and I'm not 100% sure it's PHP-related, but I'd like to at least rule it out if it's not. I've setup a test page he http://www.linkboard.org/test/ Included on that page are two bookmarks files exported from a browser: one contains data-URI encoded favicons, and the other does not. Uploading both files via the above URL should work just fine in any browser (an array dump of characters should be the result). However, if you change the above URL to include the 'index.php', uploading the file with favicons in it no longer works - it results in a browser time out. If i change the name of the test page to something else, i.e. 'test.php', it will never work since I would always have to specify the page filename in the URL. So, anybody have any ideas? Could this be a server config issue? It doesn't appear to be a browser problem because I experience the exact same issue in Chrome, Firefox, and IE. Edit: Here's the code I'm using on the page: Code: [Select] <?php if (isset($_POST['submit'])) { if (is_uploaded_file($_FILES['bookmarks_file']['tmp_name'])) { $file = fopen($_FILES['bookmarks_file']['tmp_name'], "r"); if ($file != false && $_FILES['bookmarks_file']['type'] == 'text/html') { $charArray = array(); while (!feof($file)) { $charArray[] = fgetc($file); } fclose($file); var_dump($charArray); } } } ?> <h2>Test Import</h2> <p><a href="bookmarks_4_24_12-favicon.html">Bookmarks file <strong>with</strong> Favicons</a><br /> <a href="bookmarks_4_24_12.html">Bookmarks file <strong>without</strong> Favicons</a></p> <p>Upload one of the above files with this form. If successful, the program will print out file contents.</p> <form enctype="multipart/form-data" action="<?php echo $PHP_SELF; ?>" method="POST"> <input type="file" name="bookmarks_file" /><br /><br /> <button type="submit" name="submit">Submit</button> </form> hi , i have an error in my php . It will display successful only if all file being upload , if there have one file not upload . it go to blankpage not tell any error or success.I have file that being upload to different path folder
$fileName14 = basename($_FILES["penaja"]["name"]); $targetFilePath14=$targetDir14. $fileName14; $fileType14 = pathinfo($targetFilePath14,PATHINFO_EXTENSION); $allowTypes14= array('pdf','PDF','docx','DOCX'); //kesihatan $targetDir15 ="folder/pda-semakan/kesihatan/"; $fileName15 = basename($_FILES["umpapkp"]["name"]); $targetFilePath15=$targetDir15. $fileName15; $fileType15 = pathinfo($targetFilePath15,PATHINFO_EXTENSION); $allowTypes15= array('pdf','PDF','docx','DOCX'); //jhepa $targetDir16 ="folder/pda-semakan/jhepa/"; $fileName16 = basename($_FILES["umpajhepa"]["name"]); $targetFilePath16=$targetDir16. $fileName16; $fileType16 = pathinfo($targetFilePath16,PATHINFO_EXTENSION); $allowTypes16= array('pdf','PDF','docx','DOCX'); if(in_array($fileTypeg, $allowTypesg)){ if(in_array($fileType, $allowTypes)){ if(in_array($fileType1, $allowTypes1)){ if(in_array($fileType2, $allowTypes2)){ if(in_array($fileType3, $allowTypes3)){ if(in_array($fileType4, $allowTypes4)){ if(in_array($fileType5, $allowTypes5)){ if(in_array($fileType6, $allowTypes6)){ if(in_array($fileType7, $allowTypes7)){ // Upload file to server if(move_uploaded_file($_FILES["gambar"]["tmp_name"], $targetFilePathg)){ if(move_uploaded_file($_FILES["surat"]["tmp_name"], $targetFilePath)){ if(move_uploaded_file($_FILES["ic"]["tmp_name"], $targetFilePath1)){ if(move_uploaded_file($_FILES["sijilkelahiran"]["tmp_name"], $targetFilePath2)){ if(move_uploaded_file($_FILES["sijilspm"]["tmp_name"], $targetFilePath3)){ if(move_uploaded_file($_FILES["sijilberhenti"]["tmp_name"], $targetFilePath4)){ if(move_uploaded_file($_FILES["sijilmatrik"]["tmp_name"], $targetFilePath5)){ if(move_uploaded_file($_FILES["sejulai"]["tmp_name"], $targetFilePath6)){ if(move_uploaded_file($_FILES["bmjulai"]["tmp_name"], $targetFilePath7)){
|