Apr
26
comment How to loop through all values in the array
I have update both php script and javascript function code above in the question
Apr
26
revised How to loop through all values in the array
added 344 characters in body
Apr
26
comment How to loop through all values in the array
I have tested this but it appends '0' AND '1' for a file name after I uploaded a file, why is this happening?
Apr
26
comment How to loop through all values in the array
Can you show an example of this please as an answer?
Apr
26
comment How to loop through all values in the array
In my javascript code, it is suppose to output the name of uploaded files using the append method to append the $_SESSION variable in the 'imagename' variable.. But lets say I upload files 'dog.png', cat.png' and 'pig.png', it only appends the file name 'dog.png' for all the files on screen and not 'dog.png', cat.png' and 'pig.png'.
Apr
25
asked How to loop through all values in the array
Apr
25
asked How to write or place session variable below correctly
Apr
25
comment Browser goes blank when using this session variable
This helps as browser does not go blank. Problem though is that if I try to retrieve multiple file names, then it only displays 1 file name. E.g. If I upload 2 files, ('tulips.png' and bat.png'), then on screen it displays ('tulips.png and tulips.png) for both file names on screen.
Apr
25
asked Browser goes blank when using this session variable
Apr
24
comment it is only displaying one file name
@Baba continue from last comment ... I only had 27 views over 10 hours last time, meaning there is very little chance I get an answer at a reasonable time.
Apr
24
comment it is only displaying one file name
@Baba, 1. I updated answer last time and comment to you the problem. I waited for over 9 hours and I had no comment or reply from you. 2. I don't have to use your answer but it will be nice that before you post your answer, that you make sure your answer is correct. If it is not correct then look at my comments when I said it is not correct. 3. Other users have seen your answer posted and because of this they don't answer the question because they think an answer is already there for the question or that I am discussing an answer with you. 4. More views means more chance of correct answer.
Apr
24
comment it is only displaying one file name
@Baba The reason I deleted this question was because your answer in previous question did not solve anything (as people saw me and you working on an answer in previous question, I believe they did not try to add their own answer) and it still doesn't solve it. If I change the $_SESSION variable to what you have stated, it doesn't work as it keeps displaying 'null' when appending the $_SESSION. I have deleted previous question because I only got 27 views in 10 hours, on this question I got 23 views in 11 mins. That is why I deleted the previous questions and add this question
Apr
24
asked it is only displaying one file name
Apr
23
awarded Commentator
Apr
23
comment where to display $_SESSION variable below
No, $_SESSION ['fileImage'] is just displaying 1 file name. E.g. If I upload files tulips.png, tomcat.png and angel.png, it should append (look at javascript code to see how append code) tulips.png, tomcat.png and angel.png, but instead it is only appending this: tulips.png, tulips.png, tulips.png. Now when I refresh page and upload files keyboard.png and bottle.png, it should append keyboard.png and bottle.png but instead it appends this: angel.png, angel.png. This is because after I refresh page, the last file uploaded to the server was angel so it is only appending that name for any files.
Apr
23
revised where to display $_SESSION variable below
deleted 4 characters in body
Apr
23
comment where to display $_SESSION variable below
Yes I know, this is what I changed it to, that is why I said 'when I change var imagename to what you have told me in previous comment'. I was referring to when you told me to change it to var imagename = <?php echo json_encode(isset($_SESSION ['fileImage']) ? $_SESSION ['fileImage'] : null); ?>;. I update code above to show you current code.
Apr
23
comment where to display $_SESSION variable below
when I change var imagename to what you have told me to change it in previous comment, now I am back to the start of the problem where it just appends the name of one file and only one file. If you read question again where I mention how it is displaying file names then you can see what I mean.
Apr
23
comment where to display $_SESSION variable below
The error I am getting when adding = array(); in json code is: unexpected '=', expecting ',' or ')'
Apr
23
comment where to display $_SESSION variable below
The json.encode code before your change was var imagename = <?php echo json_encode(isset($_SESSION ['fileImage']['name']) ? $_SESSION ['fileImage']['name'] : null); ?>; and the $_SESSION code in php script was $_SESSION ['fileImage']['name'] = $_FILES ['fileImage']['name'];
1 2