title: Cannot pass parameter. Add Image root name $_Files to insert to db
body: <p>Im having trouble adding the file root of the uploaded file to my DB. I have been told to try the following below but im getting the error and no longer getting a reply :Cannot pass parameter 8 by reference in send_config.php
  on line 47 is the following line. '".$target_file."');</p>
  
  <hr>
  
  <p>send_config.php</p>
  
  <hr>
  
  <pre><code>$stmt = $conn-&gt;prepare("INSERT INTO detail (company_name,ref,website,email,tel,message,location) VALUES (?, ?, ?, ?, ?, ?, ?)");
                              $stmt-&gt;bind_param('sssssss', 
                                  $_REQUEST['company_name'],
                                  $_REQUEST['ref'],
                                  $_REQUEST['website'],
                                  $_REQUEST['email'],
                                  $_REQUEST['tel'],
                                  $_REQUEST['message'],
                                  '".$target_file."');
  
                              include 'mail2.php';                       
  
                              if($stmt-&gt;execute()) {
                                  echo "Database Successfully Updated.";
                              } else {
                                  echo "Error To Update Database: " . $stmt-&gt;error;
                              };
  </code></pre>
  
  <hr>
  
  <p>email.php</p>
  
  <hr>
  
  <pre><code>$to = 'test@gmail.com';
      $subject = 'Website Submission';
      $company_name = $_POST['company_name'];
      $ref = $_POST['ref'];
      $website = $_POST['website'];
      $email = $_POST['email'];
      $tel = $_POST['tel'];
      $message = $_POST['message'];
  
      $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 "&lt;p&gt;File is an image - " . $check["mime"] . ".&lt;/p&gt;";
              $uploadOk = 1;
          } else {
              echo '&lt;p style="color:red;"&gt;File is not an image.&lt;/p&gt;';
              $uploadOk = 0;
  
          }
      }
      // Check if file already exists
      if (file_exists($target_file)) {
          echo '&lt;p style="color:red;"&gt;Sorry, file already exists.&lt;/p&gt;';
          $uploadOk = 0;
      }
      // Check file size
      if ($_FILES["fileToUpload"]["size"] &gt; 500000) {
          echo '&lt;p style="color:red;"&gt;Sorry, your file is too large.&lt;/p&gt;';
          $uploadOk = 0;
      }
      // Allow certain file formats
      if($imageFileType != "jpg" &amp;&amp; $imageFileType != "png" &amp;&amp; $imageFileType != "jpeg"
      &amp;&amp; $imageFileType != "gif" ) {
          echo '&lt;p style="color:red;"&gt;Sorry, only JPG, JPEG, PNG &amp; GIF files are allowed.&lt;/p&gt;';
          $uploadOk = 0;
  
      }
      // Check if $uploadOk is set to 0 by an error
      if ($uploadOk == 0) {
          echo '&lt;p style="color:red;"&gt;Sorry, your file was not uploaded.&lt;/p&gt;';
      // 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 '&lt;p style="color:red;"&gt;Sorry, there was an error uploading your file.&lt;/p&gt;';
          }
      }
  </code></pre>