Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7835137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:30:05+00:00 2026-06-02T13:30:05+00:00

I’ve built this webform wizard, consisting of several PHP pages. In this several pages

  • 0

I’ve built this webform wizard, consisting of several PHP pages. In this several pages users can fill in the form and the data gets temporarily stored in a session and at the last page the sessions are used to store all the data in the MYSQL database. Everything works fine with the exception of the uploaded file. Here is my code:

HTML: wizard_page2

<form name="registratieformulier" method="post" enctype="multipart/form-data" action="sw3.php">

    <tr><td>Foto winkel uploaden: </td><td><input type="file" name="uploadfoto"/></td></tr><br /><br />

      <tr><td><strong>Omschrijving van winkel:</strong></td>                    </tr><br />

       <tr><textarea cols="50" rows="7" name="omschrijvingwinkel"></textarea></tr>
       <input name="pkbedrijven" value="<?php echo($pkbedrijven); ?>" type="hidden" />
    <input type="submit" name="stuurfoto" value="Verzenden" />

</form>

PHP: wizard_last_page

    $_FILES['uploadfoto']['name']       = $_SESSION["naamfoto"];
    $_FILES['uploadfoto']['tmp_name']   = $_SESSION["tijdelijk"];

    $bn =   $_SESSION["wn"];

     $target_path = "../../winkels/$bn/";

      $target_path = $target_path . basename( $_FILES['uploadfoto']['name']);


    move_uploaded_file($_FILES['uploadfoto']['tmp_name'], $target_path)or die("There was an error uploading the file, please try again!");
     $foto_path  = "http://mywebsite.nl/winkels/$bn/".basename($_FILES['uploadfoto']['name']);


   $omschrijving   = $_SESSION["omschrijving"];

   $add = "UPDATE winkelprofiel SET winkelomschrijving='$omschrijving', winkelfoto='$foto_path' WHERE fkBedrijvenID=$pkbedrijven ";
   $query_upload = mysql_query($add) or die("De winkelfoto en omschrijving konden niet worden opgeslagen");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:30:07+00:00Added an answer on June 2, 2026 at 1:30 pm

    The $_FILES array only holds information about the file that has been uploaded in this request. If you do not save that file elsewhere within the same request, it will be removed by PHP at the end of the request. You cannot simply save $_FILES['uploadfoto']['tmp_name'] into the session and expect the file to still be there later, because it won’t be. There’s also no point in assigning the values in $_SESSION back into $_FILES, it won’t bring the file back.

    What you need to do:

    1. if the upload was successful, move $_FILES['uploadfoto']['tmp_name'] somewhere else immediately
    2. save the location you have moved it to into $_SESSION
    3. do something with that file in $_SESSION at the end of your multi-page process (no need for $_FILES anymore at all)
    4. have some mechanism in place to remove old uploaded files, in case the user abandons the session and the file never gets used
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.