Keeping the correctly filled in data when validating an html form with php

Discussion in 'PHP' started by mawooshen, Oct 11, 2006.

  1. #1
    Hi, I don't know if this is an html or php issue but here goes:

    I'm making a php/html form in which users can upload small files.

    When validating the form if the users hasn't correctly filled in part of the form, the php returns them to the form with the incorrect areas highlighted while keeping the correct content.
    Standard stuff, but my problem is that when this happens the file upload box (input type=file) always loses its content so that the user has to browse for the file again.

    Does anyone know if there is a way to keep the file address like you can do with every other input type (by using value etc)?

    Thanks in advance.
     
    mawooshen, Oct 11, 2006 IP
  2. intoex

    intoex Peon

    Messages:
    414
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use HTMLForms from PEAR - they have possibilities to do it
    About your file - you want visitor always upload file? Make jsut a temporary storadge and on validation error if file was uploaded, make it like simple text with words (uploaded)
    Use sessions to handle this feature
     
    intoex, Oct 12, 2006 IP