You don’t check for the button, you check if it was submitted.
if($_SERVER[‘REQUEST_METHOD’] == ‘POST’)
{
// process request
} else {
// serve the form
}
And you want to do that at the top of the page.
You don’t check for the button, you check if it was submitted.
if($_SERVER[‘REQUEST_METHOD’] == ‘POST’)
{
// process request
} else {
// serve the form
}
And you want to do that at the top of the page.
it still doesnt work
this is at top of the page
if (isset($_POST[‘upload’]))
{
$UploadName = $_FILES[‘file’][‘name’];
echo “$UploadName”;
}
?>
Upload
but i haven’t added that https://github.com/enyo/dropzone/wiki/Upload-all-files-with-a-button code cuz no idea where should i do that
You link the js file to the file that the upload form is on.
i just have to link it and i dont need change anything in that file to it work?
copy the example html
maybe i can add you somewhere and we chat live? i can pay you…
At work, cannot chat live.
Add the html form code to your php file, replacing your current form. Add the javascript link to the html. The reason is, your form does not have the ID that the JS file is looking for, so nothing will be trigger it to run.
Your form is in the upload.php file, correct?
well it kinda works now when i press button it shows upload but where the files go? where i need to writte code for that?
https://www.w3schools.com/php/php_file_upload.asp
Where you are checking if the form was submitted. The above has the base that I use to process file uploads. You will likely need to modify it to suit your needs.
can i do submit from other form like
Drag drop upload hereso this is my code now
Submit all files
it all works when i press button it shows uploading etc… but nothing is happening
php at top of the page
if (isset($_POST[‘upload’]))
{
$UploadName = $_FILES[‘file’][‘name’];
echo “$UploadName”;
}
it shows nothing
If it has the id that the JavaScript is listening for.
yea i got that but it doesnt trigger that php post thing when i press button
only thing left is how to make it go to my php code after i press that button and php reads files from that dropzone
well this is my final code
//PHP
<?php include("includes/connect.php"); if(isset($_POST["upload"])) { $UploadName = $_FILES['my-dropzone']['name']; echo "$UploadName"; } ?>// Upload
//POST
and it shows this error Notice: Undefined index: my-dropzone in C:\xampp\htdocs\upload.php on line 4line 4:
$UploadName = $_FILES[‘my-dropzone’][‘name’];
You need to chexk what tje processing code is receiving.
[php]print_r($_FILES)[/php]
still haven’t fixed this problem
i have made that when u select or drag and drop files they show in upload box and after you press button submit they uploads
but i have no idea where they go, where should i write php part for upload?
code:
Upload:
Button click after click files uploads:
where can i write code for this upload i really have no idea how you connect php and javascript
This is how i used to work with submits
<?php if (isset($_POST['register'])) { then i get values like this $username = $_POST['username']; $email = $_POST['email']; } ?> if anyone could tell me how i can get values like this from my upload box i would appreciate thatThe complete PHP tutorial in the dropzone js docs should get you going
http://www.dropzonejs.com/#server-side-implementation
no i know how to do upload, it working great, i just don’t know how to make upload on button press
i press button and then it uploads
i added code to my file so it doesn’t upload automatic but after i press button, but it doesn’t really upload because haven’t wrote code for that and my question is WHERE SHOULD I WRITE THAT CODE