Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Bug when attaching files

Hi there!

I have a small problem with my php-fusion site. Every time a user uploads more than one file as attachment, it will duplicate or multiply that forum post as many times as the number of files attached. Exp, if a member post a forum message with three (3) files attached, in that thread it will appear 3 posts exactly the same. Everything works except of this bug. I don't remember to modify files.

Can you help me?
Can someone help me with this?
You have sub-forums and the forum and site seems highly modified overall -- so I don't think anyone will be able to help you unless spending some time looking in your source files...
It's not that hardcoded. Just three mods applied with a maximum of 10 lines added.
The strange fact is that it worked in past, and never tried to change things on that area of viewthread.php . That's why I wanted to show this here.

Thanks for your answer.

Quote

it will duplicate or multiply that forum post as many times as the number of files attached


The uploading is looping using a loop (while,foreach,for) - which you need to check. On the loop, make sure it does not encompass a $result= INSERT INTO(DB_FORM); run.

Here is a code to give you a food for thought. Verify your brackets ending bracket " } " is NOT on the wrong end.

The following code is the most possible action which triple post on triple attachment.

Quote



if (isset($_POST['save'])) {

foreach($attachment as $arr) {
$attachment = $_POST['attachment']; //... and other code runs
$result = INSERT_INTO(DB_FORUM...

} <---- this is the bracket misplaced.
// when it was suppose to be here instead..
$result = INSERT_INTO(DB_FORUM...
}


I did not see your website, or evaluate your souce code because they were not given. I only make a rough estimate guess. If it doesn't relate, hope to treat it just as a 2 cents opinion.

Thank you.
I didn't find that lines, but I can show you the source of my viewthread.php file(is the only one I modified).
I won't just copy-paste it here because is to large, but you can view it on www.gpszone.ro/viewthread.rar.

Thanks a lot for your help!
Thread Information
Author
Replies
6 posts
Views
4286 times
Last Post
Last updated on 6 years ago
Related Threads
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Chan, foc_in_gaura, JoiNNN