The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

This is the loop printing all the message working perfectly but now it keep repeating the same message everytime the page is refreshed in firefox is there a way to avoid that? by redirecting the page to avoid repetition?

The following message appears when I refresh the browser:

To display this page, Firefox must send information that will repeat any action (such as search or order confirmation) that was performed earlier.

How can it be avoided so it just save the data and then continue without repeating the previous message over?

this is the while loop and the mysql query statement to call the comments from the database

sprintf and printf return and echo (respectively) a formatted string.
The &#37;s and %d are like placeholders. They get replaced with the other arguments in the function call. %s gets formatted as string, %d gets formatted as a number. It's a way of inserting variables into a string.
Read the manual here:sprintfprintf

To avoid double posting you should redirect the browser after inserting the comment.

No, the code you have to add a new comment into the database.
The Firefox warning about resending data relates to when a form is posted (sending data to the script). When you refresh after submitting a form you are basically submitting the form again.
So modify your code so that instead of echoing Thanks for your comment you redirect back to that script.

?>// Rest of the code but it doesn't appear this time after the submission of the comment. I know it is exiting and not letting the rest of the comment to display in the screen how can it be possible to print the rest of the code and still exit to avoid to resend it again

Now just the header appears it doesn't resend the data in the database but instead of the whole script appearing it just the header on top but the rest of the script don't execute

I feel like I'm saying a lot of things twice.
You should use the full absolute URL, starting with http
Is the redirection working?

If you put the form insertion code before you start the markup (before the doctype) then the user won't double download the page. The comment will insert and they'll be redirected before the browser downloads any content.

Surely the location you are redirecting to should use $id or $id2 to redirect to the correct product page? If you hard code 1 into the URL users will end up there regardless of which product they commented on.

You should also read over your code. You have $id and $id2 which are the same. You have $appetizers_id which is not used at all, and you are trying to use $shoename_id in the query, which has not been created.

The Firefox warning about resending data relates to when a form is posted (sending data to the script). When you refresh after submitting a form you are basically submitting the form again.

Also, we're lucky that FF bothers to give us that warning. Guess what IE does? "Page expired". Nothing else, just a warning, no page. Without a redirect after post, the user can't use the back button. And that's a Bad Thing.

I have done the last fixes you guys told me. I have erease the $id2 and its values which was repeating I have fixed the type with shoename_id, and I have a try to understand a couple of term even google them but still don't get it.

Here are some questions

Where you talk about form insertion you mean when php read the form field or the form field hard code? what form insertion is?
you also said if I put the the form insertion before the markup or doctype then the user won't double download the form. in other words in won't re-read the form input again. Where is the markup and doctype?

THe whole code is below the redirection still is not working. Please take a look in the action in the form field at the bottom of the script, I have put

PHP Code:

action="itemdetails.php?id=<?php echo $id ?>"

and I don't know if somehow might be comflicting in the redirection.

Thank you guys
I hope i don't have any more mistakes that you have previous told me in the code I think i have proof read the code enough if there is still a mistake excuse me.

is not displaying, you have explain me about the form insertion being before the markup, that way the user won't have to insert the comment again. but I don't undertand that part that's why I have formulate the question above.