Log in

View Full Version : Show one story at a time according to the id



naiani
08-29-2007, 04:31 PM
Hi everyone.

I'm trying to make some kind of Updates section for my website (http://www.cglg-canada.com/testnew/index_imp.html) using a script I found on DD.
As you can see, when you click the 'More >>' link, it opens a small window that shows the complete story (I used the same news for both items when I was developing the code for testing purposes). Now I need it to show the news referring to the link the user clicked, e.g. when the user clicks on the 'More >>' of the first item, the small window shows the complete news for that first item.
If you see the code, you'll notice that the link points to # and has an onclick attribute that manipulates the div #subcontent, and that #subcontent shows an external file.

The problem I have consists of 3 subproblems:
1. I don't know how to make the selected story's id persistent after the PHP code ends...
2. ...so I can pass it to the external file through the JavaScript in the #subcontent...
3. ...and generate the external .php using this id to select the story from the database and show it.

I suspect there might be a way to eliminate steps 2 and 3 by putting the code that would be for the external page into the #subcontent itself instead of using JS and loading an external file, and that it's probably much of a better solution. In this case, the problem is just how to make the id persistent.

Can anyone help me with this?
I appreciate all your comments/suggestions.