Moral: I'm using AJAX to upload a profile picture on the registration page.
Issue: When I upload an image it auto updates the database without the need of a page request so it needs a _iD ( user id/uid ) to upload to the database. As there isn't an available _iD because the visitor isn't registered it cannot update the database.
Looking for solutions: *How would I accomplish to uploading the picture and preview it without the need to UPDATE my database before pressing submit button, as the AJAX needs to AUTO UPDATE my database to uploda the file with the _iD ( user id ). Do I need to set a temporary _iD which will be used to created the account once the submit form is requested?*
-->register.php
-----> http://pastebin.com/kZE4B105
-->*register_image_upload.php*
-----> http://pastebin.com/15n4pgPJ
-->Database table
-----> users
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| _iD | _iPassword | _iUsername | _iEmail | _iProfilePicture |
| 40 | bcrypt | _iUser | blah@gmail.com | $PATH |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
EDIT: Current error on form when image uploaded.
Warning: move_uploaded_file(profile_pic/_iThumbnail/1369388350.jpg): failed to open stream: No such file or directory in C:\EasyPHP-12.1\www\public_html\register_image_upload.php on line 18
Warning: move_uploaded_file(): Unable to move 'C:\EasyPHP-12.1\tmp\php7EFB.tmp' to 'profile_pic/_iThumbnail/1369388350.jpg' in C:\EasyPHP-12.1\www\public_html\register_image_upload.php on line 18
failed