dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: How to do this with php and js

  1. #1
    Join Date
    Mar 2012
    Posts
    11

    How to do this with php and js

    Friends
    i want to make some modifications to my web site which i developed using PHP as the following
    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
    i can store images into a folder and retrieve them from using thier names which stored into the database
    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

    to see an example for what i mean check this link
    http://www.booking.com/hotel/eg/canc...out=2014-07-19


    it is for an hotel in booking.com and when checking another hottel pics in the slide show changes to display pics of the newly checked hotel (similar idea )

  2. #2
    Join Date
    Feb 2014
    Location
    Canada
    Posts
    155
    Quote Originally Posted by mostafa581 View Post
    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).

    Quote Originally Posted by mostafa581 View Post
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles