Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
Why there's no value in a file?

//html

 <form name="useraddcooperativestructureform" class="useraddcooperativestructureclass" id="useraddcooperativestructureformid">
        <input type="file" class="cooperativestructureclass" name="cooperativestructurename" id="imagenameid" placeholder="Cooperative Structure"><br>
          <button type="button" class="btn btn-primary" id="coopuploadbtnid">Upload</button>
      </form>

//php

<?php
require('../database/connection.php');

$pimage = $_FILES['cooperativestructurename']['name'];
$pimagetmp =  $_FILES['cooperativestructurename']['tmp_name'];
$folder = "css/";
    move_uploaded_file($pimagetmp, $folder.$pimage);
    $query = "INSERT INTO tbl_coopstructure VALUES(null, '$pimage')";
    $sqlquery = mysqli_query($connection,$query);   
?>

//javascript

var coopbtn = document.getElementById('coopuploadbtnid');
if(coopbtn){
    coopbtn.addEventListener('click',function(){

      var filename = document.forms['useraddcooperativestructureform']['cooperativestructurename'].value;
    
            $.post("../controller/admincoopstructureinsert.php",{"name":filename},function(){
                setTimeout(function(){
                    $('.message-validation-upload-structure').css('display','flex');
                    $('.message-validation-upload-structure').css('background-color','#02ff2a');
                    $('.insertclass').html("User successfully uploaded image");
                },1)
                setTimeout(function(){
                    $('.message-validation-upload-structure').css('display','none');
                },3000)
            })
        

    })
}

When i inserted a file it successful but there is no value in database only unique id has value that is inserted. can someone tell me what is the solution? #beginner

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!