Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo '<form name="submitExemption" enctype="multipart/form-data" method="POST" action="submitRequest.php">';
- echo '<fieldset>';
- echo '<font class="label">Name: </font>'.$_SESSION["first"].' '.$_SESSION["last"].'<br><br>';
- ?>
- Choose a file to upload: <input type="file" name="f1"><br>
- Choose a file to upload: <input type="file" name="f2"><br>
- Choose a file to upload: <input type="file" name="f3"><br><br>
- <?php
- echo '<input type="button" value="Submit Request" onclick="checkFields()">';
- echo '</fieldset>';
- echo '</form>';
- ?>
- // submitRequest.php is below
- foreach($_FILES as $key => $value) {
- if($_FILES[$key]['name'] != "") {
- if($_FILES[$key]['error'] == 0) {
- ${"name".$key} = mysql_real_escape_string($_FILES[$key]['name']);
- ${"mime".$key} = mysql_real_escape_string($_FILES[$key]['type']);
- ${"size".$key} = intval($_FILES[$key]['size']);
- ${"data".$key} = mysql_real_escape_string(file_get_contents($_FILES[$key]['tmp_name']));
- }else {
- die('An error accured while the file was being uploaded.');
- }
- }
- }
Add Comment
Please, Sign In to add comment