Jump to content

Mudsaf

Members
  • Content Count

    428
  • Joined

  • Last visited

Community Reputation

16 Good

About Mudsaf

  • Rank
    Member
  • Birthday 08/29/1994

Previous Fields

  • Languages
    PHP (Main), CSS, HTML, JavaScript, jQuery, MySQL (Basics)

Contact Methods

  • MSN
    Mursa@hotmail.fi
  • Website URL
    http://www.mudsaf.info/
  • Skype
    Mudsaf

Profile Information

  • Location
    Finland
  • Interests
    Challenging coding, gaming and other projects.
  1. Yea, just like that & when they have selected the files, automatically upload.
  2. Hello, i'm trying to create file upload box which is activated by both, file drag & drop and onclick. Currently drag & drop works fine for me, but i have no idea how to implement the feature for the click with automatically uploading the image when file area is changed. Heres my code so far <script> $(function() { var dropzone = document.getElementById('upload_area'); var upload = function(files) { var formData = new FormData(), xhr = new XMLHttpRequest(), x; for (x = 0; x < files.length; x++) { formData.append('file[]', files[x]); } xhr.onload = function() { var data = this.responseText; console.log(data); } xhr.open('post','script/php/iupload.php?fid=gallery'); xhr.send(formData); } dropzone.ondrop = function(e) { e.preventDefault(); this.className = 'dropzone'; upload(e.dataTransfer.files); } dropzone.ondragover = function() { this.className = 'dropzone dragover'; return false; } dropzone.ondragleave = function() { this.className = 'dropzone'; return false; } }); </script> <div id='upload_area' class='dropzone'>Drag & Drop or click to upload files</div> I was able to try dropzone.onclick event, but didn't get anything to work without $("#upload_area").submit(); function. Any tips guides / tutorial videos are welcome, since im trying to improve as developer.
  3. Mudsaf

    Some sort of SQL JOIN

    Hello, i'm currently facing problem where i have 2 tables like this. I have no clue how to make this happen, would appreciate any help example links for guide or solutions. //First ------- id | name | stuff 1 - Test - bla //Example values 2 - Test2 - Bla2 ------- //Second ------- id | related | rating 1 - 2 - 5 //Example values 2 - 2 - 1 3 - 2 - 2 So i'm trying to do SQL query where i can select * data from first table, and join on second table with AVG(rating) where related (second table) = id(first table).
  4. Hello, i'm wondering why my JavaScript / jQuery code doesn't work. $(function() {var i=0;$("#preimgarea").prepend("<center>");bg_imglist.forEach(function(entry) {$("#preimgarea").append("<img style='someCSS' class='setBG' id='" + i + "' src='" + entry[0] + "'>");i++;if (i == bg_imglist.length) {$("#preimgarea").append("</center>");}}); }); Basically the code pastes <center></center> then the forEach data.
  5. if (!file_exists("img/" . $_GET['remove'])) {echo "<script>console.log('Prelog');$(function() { $('#message_area').html('The file you try to remove does not exist.').fadeIn(500, function() { setTimeout(function () { console.log('Log works'); window.open('?manage=true', '_self'); }, 2000); });});</script>";} Fixed, forgot there is small script on footer.php that messed up my code. Feel like idiot now T_T
  6. No errors or notifications, added console.log("3"); before $(function() { }); and it displays.
  7. Hello, i'm wondering what could be the reason that my jQuery wont execute while echoing, but manual execution on browser console works. Code in PHP (This code will still open the window on manage=true, no errors on console) echo "<script>$(function() { $('#message_area').html('The file you try to remove does not exist.').fadeIn(500, function() { setTimeout(function () { window.open('?manage=true', '_self'); <!-- This executes, this comment is not on the code --> }, 2000); });});</script>"; Message area html below. <div id="message_area"><strong>Note</strong>:Enable JavaScript for more advanced website surfing.</div>
  8. Thanks alot, its working now (on local server).
  9. Hello, i'm wondering how my contact form requires 2 form submits until it actually submits the data. (Fill it with fake data example blaablaa@bla.com & such on to see) Preview: http://mudsaf.info/contact.php
  10. 403 forbidden should be fixed now. <a data-lightbox="d3-progress" href="http://mudsaf.info/admin/files/public/20140902_203326-4b0250793549726d5c1ea3906726ebfe-bounty_chest.jpg">Diablo 3 Progress #1</a> http://lokeshdhakar.com/projects/lightbox2/ <-- I'm using this.
  11. Do you have any idea how to fix the lightbox. It just expands the page at bottom without displaying the picture. http://mudsaf.info/ (2nd latest topic)
  12. Wondering if the problem can be that i use jQuery 2.x.x and lightbox uses 1.11.0
×
×
  • Create New...