I have it working now. The file path was wrong no the code for the form is in upload.php and the upload is in upload_pdf2.php
I have the uploader working however I want to print the file name and path on the page. Is there a way of doing this using PHP?
Yes of course. When you do the upload routine it depends what happens thereafter.
If the upload routine redirects to a new page after successful upload, the easiest way would be to store the filename in a session variable.
Yes the upload form is in upload.php when they click the upload button the upload_pdf2.php is loaded up. So should I put the first section with my form in upload.php then the second section in upload_pdf2.php? I understand how it works, however calling that header breaks my header Ive already called. What do you think would be the solution to this. Thankyou for your help by the way!
however calling that header breaks my header Ive already called
You didn't show that in your code. So I was unaware of it.
My approach would be (my naming):
contains the form with action pointing to formhandler.php and the session variable stuff (setting and displaying $uploadtext) noted in the second snippet of my previous post.
moves uploaded file to location and writes the path/file to DB and to session variable (or the error msgs). Redirect back to form.php
That's pretty much it. Let formhandler.php do all the heavy lifting with regard to files and DBs (like a "controller/model"). form.php can be thought of just presentation or a "view".