sending a variable when clicking a link
Posted: Tue Dec 02, 2003 10:47 pm
Hello everyone, this is my first post here. I'm new to PHP, and so far I'm loving what I have learned.
Here's my current problem-
I am attempting to have a dynamic section of my website that includes very short stories that I plan to store in a MySQL database. I have set up a password protected control panel with a form for me to type the stories into, and another field that contains a very short name for the story.
The database then creates a row containing 4 columns - a unique ID number, the story name, the content, and the date the story was added.
Everything works fine, but now I'm trying to set up a navigation bar that will look into the database, and for each record that is there, create a link to a template page that contains formatting for the story. This way I don't have to manually add a link in the database everytime a story is added.
What I envision is the id number from the database will be used in the navigation bar to set a variable. When that link is clicked, that variable carries over into the template page that loads, pulling the records out of the row corresponding to the variable.
This way I only need 1 template page that will format every story that I add.
The only way I know how to carry over variable is with form buttons, but I don't want a form button to accompany each story on the nav bar.
Any ideas?
Thank you very much-
Dave Heinzel
Here's my current problem-
I am attempting to have a dynamic section of my website that includes very short stories that I plan to store in a MySQL database. I have set up a password protected control panel with a form for me to type the stories into, and another field that contains a very short name for the story.
The database then creates a row containing 4 columns - a unique ID number, the story name, the content, and the date the story was added.
Everything works fine, but now I'm trying to set up a navigation bar that will look into the database, and for each record that is there, create a link to a template page that contains formatting for the story. This way I don't have to manually add a link in the database everytime a story is added.
What I envision is the id number from the database will be used in the navigation bar to set a variable. When that link is clicked, that variable carries over into the template page that loads, pulling the records out of the row corresponding to the variable.
This way I only need 1 template page that will format every story that I add.
The only way I know how to carry over variable is with form buttons, but I don't want a form button to accompany each story on the nav bar.
Any ideas?
Thank you very much-
Dave Heinzel