Jump to content

Chrisj

Members
  • Content count

    325
  • Joined

  • Last visited

  • Days Won

    1

Chrisj last won the day on October 19 2014

Chrisj had the most liked content!

Community Reputation

1 Neutral

About Chrisj

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  1. I've installed a pre-written cms type PHP web script and am interested in modifying it. I've only worked with earlier versions of PHP, but I'm going thru a learning curve with this one. I'm simply trying to modify some text (on the scripts' log in page, for example, to begin with). The text, as an example, on the displayed log-in page shows: "You have not signed up for your free account. The registration process is quick and easy....." and that log-in.php file's code led me to my db and the table named 'pages', where in the 'content' column the text that I want to modify appears there "You have not signed up.... In the table's column named 'url' it shows (in the row of the text in question) /pages/login.html. I've looked around the main script folder for a 'pages' folder without success. Are later versions of php structured to only change text in a related db table? That would be new to me. If so, what is an easy way to modify text there? Or, if there is a 'pages' folder somewhere in the main script folder, is there an easy way to search that main folder for /pages/.. ? Thanks for any help/enlightenment.
  2. I am looking getting a PHP script who's requirements list is: php GD module; php EXIF module; php CURL module; FFMPEG must be installed with libx264 codec. The php function exec() must be enabled on the server PHP7 but I am told that maybe ffmpeg and php7 aren't compatible. Is that true? If so, what's with this companies' requirements list? Any ideas?
  3. Thanks for your message. Here is the uploadDrop.php code: <?php $ds = DIRECTORY_SEPARATOR; $storeFolder = 'uploadDrop'; if (!empty($_FILES)) { $tempFile = $_FILES['file']['tmp_name']; $targetPath = dirname( __FILE__ ) . $ds. $storeFolder . $ds; $targetFile = $targetPath. $_FILES['file']['name']; move_uploaded_file($tempFile,$targetFile); } ?> Any additional help will be appreciated.
  4. I'm using dropzone js successfully to upload files from a web page. However, if a file gets uploaded that has the same name as a file already in the destination folder, it will overwrite the existing folder file. I tried to remedy this by adding the js script function as shown below, but it didn't work: <div id="dropzone"> <form action="/uploadDrop.php" class="dropzone"></form> </div> <script type="text/javascript"> Dropzone.autoDiscover = false; $(document).ready(function () { $(".dropzone").dropzone({ renameFilename: function (filename) { return new Date().getTime() + '_' + filename; } }); }); </script> Any help with this will be appreciated.
  5. JavaScript 22h If you're familiar with dropzonejs maybe you can help me. The dropzone upload script I've installed uploads files successfully. I just want to change the max file size of the upload. It's default appears to be 256. I changed maxFilesize: from 256 to 20, in /dist/dropzone.js and then proceeded to test by uploading a 25MB file, which uploaded successfully, so, it appears that the maxFilesize still isn't limiting the upload file size to 20MB ? Any suggestions will be welcomed.
  6. The web cam recorder script that I'm working with has the "navigator', etc. code and the end of the script as shown below. I tried to add this code, so people trying to use the webcam recorder in IE will see an alert dialog box(without success): if (!navigator || !navigator.getUserMedia || !navigator.mediaDevices.getUserMedia) { if (window.confirm('Your browser does not support WebVideo, try Google/Chrome')) { window.location.href='https://../index.php'; } else { show(); } } Maybe I've got something wrong. The window.confirm message still doesn't display in IE. Here's the script without the 'alert' code: <script> const video = document.querySelector('video') const startvideo = document.querySelector('.start') const stopvideo = document.querySelector('.stop') const upload = document.querySelector('.upload') const initRecorder = stream => { const recorder = new MediaRecorder(stream) let blob video.srcObject = stream startvideo.removeAttribute('disabled') video.addEventListener('loadedmetadata', () => { video.play() }) recorder.addEventListener('dataavailable', ({ data }) => { video.srcObject = null video.src = URL.createObjectURL(data) // Create a blob from the data for upload blob = new Blob([data], { type: 'video/webm' }) }) startvideo.addEventListener('click', () => { stopvideo.removeAttribute('disabled') show() reset() start() recorder.start() etc., etc, ............................ navigator .mediaDevices .getUserMedia({ video: true }) .then(initRecorder) .catch(console.error) </script> Any suggestions/enlightenment to get the 'alert'/confirm code to work with this script, will be appreciated.
  7. Thanks for your reply. This web cam recorder script that I'm working with now performs uploads successfully, however, it is the same file name every time it uploads. I've added in some 'generate random file name' code (with ////// surrounding it below), but it doesn't tie in with the working code. Any help/guidance/remedy will be welcomed. const video = document.querySelector('video') const start = document.querySelector('.start') const stop = document.querySelector('.stop') const upload = document.querySelector('.upload') const initRecorder = stream => { const recorder = new MediaRecorder(stream) let blob video.srcObject = stream start.removeAttribute('disabled') video.addEventListener('loadedmetadata', () => { video.play() }) recorder.addEventListener('dataavailable', ({ data }) => { video.srcObject = null video.src = URL.createObjectURL(data) // Create a blob from the data for upload blob = new Blob([data], { type: 'video/webm' }) }) start.addEventListener('click', () => { stop.removeAttribute('disabled') recorder.start() }) stop.addEventListener('click', () => { upload.removeAttribute('disabled') recorder.stop() }) // Upload the video blob as form data upload.addEventListener('click', () => { uploadBlob(blob) }) } ///////////////////////////////////////////////////////////////////////////////////// // this function is used to generate random file name function getFileName(fileExtension) { var d = new Date(); var year = d.getUTCFullYear(); var month = d.getUTCMonth(); var date = d.getUTCDate(); return 'RecordRTC-' + year + month + date + '-' + getRandomString() + '.' + fileExtension; } function getRandomString() { if (window.crypto && window.crypto.getRandomValues && navigator.userAgent.indexOf('Safari') === -1) { var a = window.crypto.getRandomValues(new Uint32Array(3)), token = ''; for (var i = 0, l = a.length; i < l; i++) { token += a[i].toString(36); } return token; } else { return (Math.random() * new Date().getTime()).toString(36).replace(/\./g, ''); } } ////////////////////////////////////////////////////////////////////////////////////// function uploadBlob(blob) { var formData = new FormData(); formData.append('video-blob', blob); formData.append('video-filename', 'myvideo.webm'); $.ajax({ url: "upload.php", type: "POST", data: formData, processData: false, contentType: false, success: function(response) { alert('Successfully uploaded.'); }, error: function(jqXHR, textStatus, errorMessage) { alert('Error:' + JSON.stringify(errorMessage)); } }); } navigator .mediaDevices .getUserMedia({ video: true }) .then(initRecorder) .catch(console.error)
  8. I have a webcam script that works successfully on the web page. It starts, records, stops, and plays back successfully, But my Upload portion of the code needs help. Can you help me with uploading any recorded file to a (php) folder? Here's the javascript code: <script> const video = document.querySelector('video') const start = document.querySelector('.start') const stop = document.querySelector('.stop') const upload = document.querySelector('.upload') const initRecorder = stream => { const recorder = new MediaRecorder(stream) let blob video.srcObject = stream start.removeAttribute('disabled') video.addEventListener('loadedmetadata', () => { video.play() }) recorder.addEventListener('dataavailable', ({ data }) => { video.srcObject = null video.src = URL.createObjectURL(data) // Create a blob from the data for upload blob = new Blob([data], { type: 'video/webm' }) }) start.addEventListener('click', () => { stop.removeAttribute('disabled') recorder.start() }) stop.addEventListener('click', () => { upload.removeAttribute('disabled') recorder.stop() }) // Upload the video blob as form data upload.addEventListener('click', () => { const body = new FormData() body.append('myvideo', blob) fetch('upload.php', { method: 'POST', body }) .then(() => console.log('Success!')) .catch(console.error) }) $myVideo = $_FILES['myvideo']; move_uploaded_file( $myVideo['tmp_name'], '../uploads/' . basename($myVideo['name']) ); } navigator .mediaDevices .getUserMedia({ video: true }) .then(initRecorder) .catch(console.error) </script> Any help will be welcomed
  9. The WebRTC/RecordRTC script that I'm using (here's where I got the script: https://www.webrtc-experiment.com/RecordRTC/) is functioning successfully(start record, stop record, upload). But, I'm trying to have the script first show the webcam-view upon page load. Currently it shows: image1 (attached). The webcam-view currently only appears upon selecting 'Start Recording' button. So, I'd like the webcam-view to appear first upon page load (example - image2) Any help will be appreciated. Here's my current code: <!DOCTYPE html> <html> <head> <title>Video Recording | RecordRTC</title> <script src="https://cdn.webrtc-experiment.com/RecordRTC.js"></script> <script src="https://webrtc.github.io/adapter/adapter-latest.js"></script> </head> <body> <style> html, body { margin: 0!important; padding: 0!important; overflow: hidden!important; width: 100%; } </style> <style> video { max-width: 100%; border: 5px solid yellow; border-radius: 9px; width: 680px; height: 420px; } body { background: ffffff; } h1 { color: #800000; } </style> <header id="header"></header> <h1>Webcam Record</h1> <br> <button id="btn-start-recording">Start Recording</button> <button id="btn-stop-recording" disabled>Stop Recording</button> <button id="upload-video" onclick="InitUploading()" disabled="">Upload Now</button> <br> <video id="" controls="" autoplay=""></video> <script type="text/javascript"> var video = document.querySelector('video'); function captureCamera(callback) { navigator.mediaDevices.getUserMedia({ audio: true, video: true }).then(function (camera) { callback(camera); }).catch(function (error) { alert('Unable to capture your camera. Please check console logs.'); console.error(error); }); } function stopRecordingCallback() { video.src = video.srcObject = null; video.src = URL.createObjectURL(recorder.getBlob()); PrepareBlob(); document.getElementById("upload-video").disabled = false; // release camera recorder.camera.getTracks().forEach(function (track) { track.stop(); }); recorder.camera.stop(); recorder.destroy(); recorder = null; } var recorder; // globally accessible document.getElementById('btn-start-recording').onclick = function () { this.disabled = true; document.getElementById("upload-video").disabled = true; captureCamera(function (camera) { setSrcObject(camera, video); video.play(); recorder = RecordRTC(camera, { type: 'video' }); recorder.startRecording(); // release camera on stopRecording recorder.camera = camera; document.getElementById('btn-stop-recording').disabled = false; }); }; document.getElementById('btn-stop-recording').onclick = function () { this.disabled = true; document.getElementById('btn-start-recording').disabled = false; recorder.stopRecording(stopRecordingCallback); }; var blob, fileName, fileObject; function PrepareBlob() { // get recorded blob blob = recorder.getBlob(); // generating a random file name fileName = getFileName('webm'); // we need to upload "File" --- not "Blob" fileObject = new File([blob], fileName, { type: 'video/webm' }); } function InitUploading() { uploadToPHPServer(fileObject, function (response, fileDownloadURL) { if (response !== 'ended') { document.getElementById('header').innerHTML = response; // upload progress return; } document.getElementById('header').innerHTML = '<a href="' + fileDownloadURL + '" target="_blank">' + fileDownloadURL + '</a>'; alert('Successfully uploaded recorded blob.'); alert('Successfully uploaded recorded blob.'); // preview uploaded file video.src = fileDownloadURL; // open uploaded file in a new tab window.open(fileDownloadURL); }); } function uploadToPHPServer(blob, callback) { // create FormData var formData = new FormData(); formData.append('video-filename', blob.name); formData.append('video-blob', blob); callback('Uploading recorded-file to server.'); makeXMLHttpRequest('save.php', formData, function (progress) { if (progress !== 'upload-ended') { callback(progress); return; } var initialURL = 'uploads/' + blob.name; callback('ended', initialURL); }); } function makeXMLHttpRequest(url, data, callback) { var request = new XMLHttpRequest(); request.onreadystatechange = function () { if (request.readyState == 4 && request.status == 200) { if (request.responseText === 'success') { callback('Upload Complete'); return; } // alert(request.responseText); window.location.href = '/index.com/'; return; } }; request.upload.onloadstart = function () { callback('Upload started...'); }; request.upload.onprogress = function (event) { callback('Upload Progress ' + Math.round(event.loaded / event.total * 100) + "%"); }; request.upload.onload = function () { callback('Progress Ending'); }; request.upload.onload = function () { callback('Upload Complete'); }; request.upload.onerror = function (error) { callback('Upload failed.'); }; request.upload.onabort = function (error) { callback('Upload aborted.'); }; request.open('POST', url); request.send(data); } // this function is used to generate random file name function getFileName(fileExtension) { var d = new Date(); var year = d.getUTCFullYear(); var month = d.getUTCMonth(); var date = d.getUTCDate(); return 'RecordRTC-' + year + month + date + '-' + getRandomString() + '.' + fileExtension; } function getRandomString() { if (window.crypto && window.crypto.getRandomValues && navigator.userAgent.indexOf('Safari') === -1) { var a = window.crypto.getRandomValues(new Uint32Array(3)), token = ''; for (var i = 0, l = a.length; i < l; i++) { token += a[i].toString(36); } return token; } else { return (Math.random() * new Date().getTime()).toString(36).replace(/\./g, ''); } } </script> </body> </html>
  10. Thanks for your reply. Regarding your reply a) can you gove me an example of what you're refering to? I'm note clear on that. I have now replaced this: // Allow certain file formats if($imageFileType != "MP4" && $imageFileType != "MPEG4" && $imageFileType != "MOV" && $imageFileType != "OGG" && $imageFileType != "MKV") { echo "Sorry, only MPEG4, MP4 and MOV files are allowed."; $uploadOk = 0; } with this: $extensions= array("mov","mp4"); if(in_array($file_ext,$extensions)=== false){ $errors[]="File type not allowed, only MP4 or MOV files."; } And that seems to work successfully. If that's not what you mean regarding b) and c) I look forward to any additional guidance. Much thanks again
  11. I'm trying to upload a video from an android device, but I see this error: "Sorry, only MPEG4, MP4 and MOV files are allowed" Here's the code below (it works successfully via IOS). Any help/guidance suggestion will be appreciated. <html> <head><title>Upload</title></head> <body> <form action="upload1.php method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload" accept="video/*" capture> <input type="submit" value="Upload Image" name="submit"> </form> </body> </html> <?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if file already exists if (file_exists($target_file)) { echo "Sorry, file already exists."; $uploadOk = 0; } // Check file size if ($_FILES["fileToUpload"]["size"] > 50000000) { echo "Sorry, your file is too large."; $uploadOk = 0; } // Allow certain file formats if($imageFileType != "MP4" && $imageFileType != "MPEG4" && $imageFileType != "MOV" && $imageFileType != "OGG" && $imageFileType != "MKV") { echo "Sorry, only MPEG4, MP4 and MOV files are allowed."; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { header ("location: ThankYou.html"); return; // echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; } } ?>
  12. After running this, trying to upload a video from a mobile phone, I apparently don't have the php set for video? Because I am unsuccessful in uploading and the message I see after attempting (from mobile phone) is: "File is not a video Sorry, your file was not uploaded." Any help/guidance suggestion will be appreciated. Here's the code: <html> <head><title>Upload</title></head> <body> <form action="upload1.php method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload" accept="video/*" capture> <input type="submit" value="Upload Image" name="submit"> </form> </body> </html> And here is upload1.php code: <?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if image file is a actual image or fake image if(isset($_POST["submit"])) { $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if($check !== false) { echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { echo "File is not a video"; $uploadOk = 0; } } // Check if file already exists if (file_exists($target_file)) { echo "Sorry, file already exists."; $uploadOk = 0; } // Check file size if ($_FILES["fileToUpload"]["size"] > 50000000) { echo "Sorry, your file is too large."; $uploadOk = 0; } // Allow certain file formats if($imageFileType != "MP4" && $imageFileType != "MPEG4" && $imageFileType != "MOV" && $imageFileType != "OGG" ) { echo "Sorry, only MPEG4 & MP4 files are allowed."; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; } } ?>
  13. I have this Upload Form that uploads a file successfully, and sends the info from the Name-form-field and the Email-form-field successfully. But nothing arrives from the Message-form-field. Here's the code: <?php session_start(); require_once 'phps3integration_lib.php'; $message = ""; $message1= ""; if (@$_POST['submit'] != "") { $allowed_ext = array("gif", "jpeg", "jpg", "png", "pdf", "doc", "docs", "zip", "mov", "MOV", "flv", "mp4", "3gp", "3GP"); $extension = end(explode(".", $_FILES["file"]["name"])); if (($_FILES["file"]["size"] < 104857600) && in_array($extension, $allowed_ext)) { if ($_FILES["file"]["error"] > 0) { //$message.="There is some error in upload, see: " . $_FILES["file"]["error"] . "<br>";//Enable this to see actual error $message.="There is some error in upload. Please try after some time."; } else { $uploaddir = '../Upload/'; $uploadfile = $uploaddir . basename($_FILES['file']['name']); $uploaded_file = false; if(move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) { $uploaded_file = $_FILES['file']['name']; } if ($uploaded_file != FALSE) { $user_name = @$_POST['user_name'] != "" ? @$_POST['user_name'] : "Anonymous"; $form_data = array( 'file' => $uploaded_file, 'user_name' => $user_name, 'type' => 'file' ); if(empty($_POST['agree']) || $_POST['agree'] != 'agree') { $message1.= "Please read and agree to the Terms and Conditions To Proceed With Upload"; }; mysql_query("INSERT INTO `phps3files` (`id`, `file`, `user_name`, `type`) VALUES (NULL, '" . $uploaded_file . "', '" . $user_name . "', 'file')") or die(mysql_error()); $message.= "File Successfully Uploaded"; } else { $message.="There is some error in upload. Please try after some time."; } } } else { $message.= "Invalid file, Please upload a gif/jpeg/jpg/png/pdf/doc/docs/zip/mov/flv/mp4/3gp file of maximum size 25 MB."; } } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $email_to = "someone@somewhere.com"; $email_subject = "From FORM"; $message = $_POST['message']; $name = $_POST['name']; $email = $_POST['email']; $headers = "From: $email \r\n"; $sent = mail($email_to,$email_subject,$message,$headers); } ?> <?php require_once 'header.php'; ?> <head> <script> var ids = ['input', 'message', 'button']; var obj = {}; ids.forEach(function (v) { obj[v] = document.getElementById(v); }); obj.input.style.display = 'none'; obj.button.style.display = 'block'; obj.input.addEventListener('change', function () { obj.message.innerText = this.value; obj.message.style.display = 'block'; }); obj.button.addEventListener('click', function (e) { e.preventDefault(); obj.input.click(); }); </script> </head> <html> <div id="genericUp"> <br /><br /><br /><br /> <font size="6" color="#84786e"><b>Upload</b></font><br /><br /> <fieldset> <form action="" method="post" enctype="multipart/form-data" onsubmit="if(document.getElementById('agree').checked) { return true; } else { alert('Please indicate that you have read and agree to the Terms by selecting the checkbox'); return false; }"> <div class="control-group"> <label for="file" class="control-label"><font size="6" color="#454545"><b>Choose a file to upload:</b></font></label><br /><br /> <!--<div class='controls'>--> <input id="input" name="file" type="file" /></input> <button id="button"><font size="3" color="#454545">Click To<br /> Select File</font></button> <div id="message"><font size="3" color="#454545">No File Chosen</font></div> </div> <div> <br /> <input class="form-control" type="text" name="name" maxlength="50" style="width:250px; height:20px; background-color:transparent; float:left; padding:0px 0px 0px 10px; margin:0px 0px 5px 0px; font-family: helvetica; font-size: 12px; color:#cccccc; border:1px solid #cccccc"; placeholder="Name"> <br /><br /> </div> <div> <input class="form-control" type="text" name="email" maxlength="50" style="width:250px; height:20px; background-color:transparent; float:left; padding:0px 0px 0px 10px; margin:0px 0px 5px 0px; font-family: helvetica; font-size: 12px; color:#cccccc; border:1px solid #cccccc"; placeholder="Email"> <br /><br /> </div> <textarea id="message4" name="message" maxlength="70" cols="25" rows="6"></textarea> <br /><br /> </div> <div> <input type="checkbox" name="checkbox" value="check" id="agree" vertical-align:top;/> By uploading a file you agree to these <a href="../Terms.php" target="_blank"><font size="2" color="#000000" face="Arial"><u>Upload Terms/Agreement</u></a></font></label> </div> <br /> <div class="control-group"> <div class='controls'> <label class="myLabel1"> <input type="submit" name="submit" value="Submit" class="btn" style="opacity: 0"><br /><br /> </label><br /><br /> </div> </form> </fieldset> <script> var ids = ['input', 'message', 'button']; var obj = {}; ids.forEach(function (v) { obj[v] = document.getElementById(v); }); obj.input.style.display = 'none'; obj.button.style.display = 'inline-block'; obj.input.addEventListener('change', function () { var filename = this.value.replace(/^.*[\\\/]/, ''); obj.message.innerHTML = filename; obj.message.style.display = 'inline-block'; }); obj.button.addEventListener('click', function (e) { e.preventDefault(); obj.input.click(); }); </script> <?php if ($message != "" || @$_SESSION['message'] != "") { ?> <div class="alert alert-success"> <?php echo $message; ?> <?php echo @$_SESSION['message']; @$_SESSION['message'] = ''; ?> </div> <?php } ?> <div> </div> </div> Any help with getting what is entered into the Message field to be sent/delivered will be appreciated.
  14. I'm using an upload script (I did not write it) that works successfully. I'm trying to add the function where you 'must check box to agree to terms' prior to uploading a file. I've added lines 67 thru 75, and lines 88 thru 92, but it is missing something, because, whether the box is checked or not, a file can still be uploaded. Any guidance will be appreciated. <?php session_start(); require_once 'phps3integration_lib.php'; $message = ""; if (@$_POST['submit'] != "") { $allowed_ext = array("gif", "jpeg", "jpg", "png", "pdf", "doc", "docs", "zip", "mov", "MOV", "flv", "mp4", "3gp", "3GP"); $extension = end(explode(".", $_FILES["file"]["name"])); if (($_FILES["file"]["size"] < 10485760000) && in_array($extension, $allowed_ext)) { if ($_FILES["file"]["error"] > 0) { //$message.="There is some error in upload, see: " . $_FILES["file"]["error"] . "<br>";//Enable this to see actual error $message.="There is some error in upload. Please try after some time."; } else { $uploaddir = '../Upload/'; $uploadfile = $uploaddir . basename($_FILES['file']['name']); $uploaded_file = false; if(move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) { $uploaded_file = $_FILES['file']['name']; } if ($uploaded_file != FALSE) { $user_name = @$_POST['user_name'] != "" ? @$_POST['user_name'] : "Anonymous"; $form_data = array( 'file' => $uploaded_file, 'user_name' => $user_name, 'type' => 'file' ); mysql_query("INSERT INTO `phps3files` (`id`, `file`, `user_name`, `type`) VALUES (NULL, '" . $uploaded_file . "', '" . $user_name . "', 'file')") or die(mysql_error()); $message.= "File Successfully Uploaded"; } else { $message.="There is some error in upload. Please try after some time."; } } } else { $message.= "Invalid file, Please upload a gif/jpeg/jpg/png/pdf/doc/docs/zip/mov/flv/mp4/3gp file of maximum size 25 MB."; } } ?> <?php require_once 'header.php'; ?> <head> <script> var ids = ['input', 'message', 'button']; var obj = {}; ids.forEach(function (v) { obj[v] = document.getElementById(v); }); obj.input.style.display = 'none'; obj.button.style.display = 'block'; obj.input.addEventListener('change', function () { obj.message.innerText = this.value; obj.message.style.display = 'block'; }); obj.button.addEventListener('click', function (e) { e.preventDefault(); obj.input.click(); }); </script> <script type="text/javascript"> function validate() { if(false == document.getElementById("agree").checked) { alert("If you agree with the terms, check the Agree check box"); } } </script> </head> <html> <fieldset> <form action="" method="post" enctype="multipart/form-data"> <div class="control-group"> <label for="file" class="control-label"><font size="6" color="#454545"><b>Choose a file to upload:</b></font></label><br /><br /> <input id="input" name="file" type="file" /></input> <button id="button"><font size="3" color="#454545">Click To<br /> Select File</font></button> <div id="message"><font size="3" color="#454545">No File Chosen</font></div> </div> <div> <input type="checkbox" name="agree" id="agree" value="agree" /> <label for='agree'> <a href="../Terms1.php" target="_blank"><span style="color: #454545; font-size: 10px">By uploading a file here, you agree to these <u>Upload Terms/Agreement</u></a></span> </label> </div> <div class="control-group"> <div class='controls'> <label class="myLabel1"> <input type="submit" name="submit" value="Submit" class="btn" style="opacity: 0"> </label>< </div> </form> </fieldset> <script> var ids = ['input', 'message', 'button']; var obj = {}; ids.forEach(function (v) { obj[v] = document.getElementById(v); }); obj.input.style.display = 'none'; obj.button.style.display = 'inline-block'; obj.input.addEventListener('change', function () { var filename = this.value.replace(/^.*[\\\/]/, ''); obj.message.innerHTML = filename; obj.message.style.display = 'inline-block'; }); obj.button.addEventListener('click', function (e) { e.preventDefault(); obj.input.click(); }); </script> <?php if ($message != "" || @$_SESSION['message'] != "") { ?> <div class="alert alert-success"> <?php echo $message; ?> <?php echo @$_SESSION['message']; @$_SESSION['message'] = ''; ?> </div> <?php } ?> <div> </div> <?php require_once 'footer.php'; ?>
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.