向用户询问PHP文件夹路径

Since the name of the folder for diferent register of my database are totally unexpected, I need to ask for every folder path and store it in the database.

Can anyone help me how to do this in PHP?

I have a form where the register id will be linked to the folder path the user will indicate by browsing the correct folder (which I do not know how to do).

I get the name from the url and I have to store the folder corresponding path to the database.

// check if the 'id' variable is set in URL, and check that it is valid
 if (isset($_GET['name'])) {
    // Get name value
    $name = $_GET['name'];
    // Assign the name to the folder name path
    session_start();          // Starting Session
    $_SESSION['name_for_path'] = $name;
    header("Location: index_showpic.php?");}

    //Here!!!!????

    else
    // if id isn't set, or isn't valid, redirect back to view page
    {header("Location: _Table.php?sort=id");}
?>

I also need to show Tiff pictures from this folder. Does anyone know how to convert them automatically into Jpeg since PHP does not support Tiff images?

Thanks!