i want the user to post topics included pics and when a specific topic is shown on the showing topic page also these pics ( which belong to this topic ) are shown too in a slide show
A couple ways to do this but the simplest would be through using a database. You can have 1 table for each thread that is created but this will NOT contain any posts! Next, you'll have a table only for posts, which you can link through primary and foreign keys to the thread table. From here, you have 2 options. First, any additional posts will go into the table for posts. Second, you can create another table for any replies. This will depend exactly on what you want the site to do and whether you expect to have a lot of users posting.
Before all of this can happen, people should be registered, so you'll need another table for log-in information.
Most databases support Views, so you can use them for retrieving from the tables and inserting information (you don't really need this but it can be helpful if other people will be helping you create this website, among other uses).
i can also make a slide show using js but for pics are stored on the same folder with the page which will display this slide show
my problem is how to do it using js for a specific pics stored into a specific folder and then when another topic is requested it displays pics which belong to the other topic in a slide show
If there are time constraints, you can download a jQuery app that will produce the slideshow for you. There are tons out there, just find the one you like.
One of the ways you can do this is to pass a $_SESSION array across each page, which will contain a reference for the images. This reference could be their name, ID, or however you're uniquely identifying them in your database. Once they're all loaded, you can dump them into your slideshow.
This can be a little bit tricky, especially if the images to be shown will depend on what the user is viewing, as you'll have to somehow track it and retrieve appropriate images.