0

I'm trying to create a photo upload system following Adam Khourys online tutorials.

http://www.developphp.com/view.php?tid=1395 - Upload multiple files video http://www.developphp.com/view.php?tid=1304 - User profile upload

Most of the code is like for like, but with my own variable names used instead. One major difference is instead of creating 3 different file upload fields as in the multiple upload video I created my form to allow multiple selections from just one upload field.

Below is a brief overview of the files, their location and what the page does.

create_post.php located in root directory - the page that allows for image upload

image_uploader.php located in root > includes directory - the page that contains the upload form, made as a seperate file to be included into any page that may require photo uploads.

photo_system.php located in root > parsers directory - the page that handles image upload.

When I go to the create a post page, click the link to upload image(s) all works well, I can see the form, I can even select the files I would like to try and upload but when I click the upload button nothing seems to happen, when photo_system.php should load.

I've added a line of code to photo_system.php right at the top that should bring up an alert box once the page has loaded, in an attempt to debug my issues, but I never see this unless I go directly to image_uploader.php

This has lead me to believe that maybe my relative links to files were the issue so I've tried appending $_SERVER['DOCUMENT_ROOT'] to the start of the links to ensure it can alway locate them from the root directory, currently I have it set up with a hard coded $root variable and still I can't seem to get the system to work.

Is it likey that the file structure and the way the pages interact with each other is my problem? Could anyone take a look at my code for these three files and see if they can spot anything? I've been stumped by this for a week or so now so I think its time to ask for some outside help.

I have my 3 files saved in a txt format so the code can be viewed

http://www.vwrx-project.co.uk/temp_source_code/create_post.txt

http://www.vwrx-project.co.uk/temp_source_code/image_uploader.txt

http://www.vwrx-project.co.uk/temp_source_code/photo_system.txt

lil_bugga
  • 81
  • 2
  • 14

1 Answers1

0

It turns out that in the end I was trying to nest two tables one inside the other so this was part of my issue.

The way that I had it set up I was including the photo upload system, image_uploader.php, as a table with an action requesting the photo_system.php file which worked when I went to the image_uploader.php page directly.

I also had in my main page where the images were being uploaded a form that had been set to onsubmit = false and this was canceling out the form action of the included file.

I only found this out when I decided to try and code it straight into one file else I'd still be stuck now.

lil_bugga
  • 81
  • 2
  • 14