hello everyone,
i am working on a small project for which i am require a code by which i can upload a file from my harddrive to remoteserver and along with this i also want to make the entry of that into MySQL table, i use 2 tables one for all the details (detail) other for images (image). table detail have fields id, name, phone and table image have fields id, imgname. for executing the complete process i have 3 files :
newrec.php3
added.php3
upload.php3
when i completes all the fields in newrec.php3 and submits it, it calls added.php3 which adds the records to detail table from where i proceed to next file ie upload.php3 with id in my url ie. http://localhost/upload.php3?id=1. now i have my upload image file page which calls itself but the problem is when it calls itself value for id is lost thus no record is added to the image table. so how can i get the value of id when the files calls itself, i also wants to know how to get just the name of image file ie just imagename.ext from complete path ie c:\new\imagename.ext
plz if any one can help me. if any one want i can sent the code which i have written. this is real urgent.
regards mystic
To pass your id number back to t upload.php3 simply add a hidden field to the upload form that holds the id.
<input type="hidden" name="id" value="$id">
To get the name of the file use the function basename().