3 Replies Latest reply on Dec 29, 2008 3:50 AM by Günter Schenk

    How to get .php?page_1 and .php?page_2 etc...

    DwFAQ Level 4
      Heya,

      I am using Dreamweaver CS3 and ADDT and have my content stored in a database.
      The fields in the database table are title, ID, content

      For now I am using spry/ajax to display the content on the page as a detail region when you click on the title but I want to also have an alternate setup so that the titles are displayed and the content is shown using php so that users can bookmark certain pages as
      www.website.com/index.php?title_1
      www.website.com/index.php?title_2
      www.website.com/index.php?title_3
      etc.

      How would I go about doing this?
      I have basic php understanding but a detailed explanation would be appreciated.

      Thanks in advance.
        • 1. Re: How to get .php?page_1 and .php?page_2 etc...
          Günter Schenk Level 4
          Hi,

          I assume your database table´s Primary Key is "ID", correct ? If so, you´d better create a recordset on "index.php" which filters the table like this:

          "SELECT title, content FROM tablename WHERE ID" equals the URL parameter ID

          Your URL parameter would then have to pass the ID values like this:

          www.website.com/index.php?ID=1
          www.website.com/index.php?ID=2
          www.website.com/index.php?ID=3

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: How to get .php?page_1 and .php?page_2 etc...
            DwFAQ Level 4
            Heya Günter,

            Thanks for the info I almost had it figured out myself but just needed a little insight to get on the right track.

            Turns out I didn't really need ADDT in this case which I already figured anyway but I knew users in this forum, including yourself, had knowledge of the task I was attempting to accomplish and would be more than happy to assist.

            What I did was create a recordset in DW server behavior for my database table then in the content div for the page I inserted a php echo for the content. Worked like a charm!

            Now I'm wondering if there is a way for the page to have some info displayed if there isn't a URL parameter passed. So if someone visits www.website.com/index.php it'll show some default text until a URL parameter is passed then the text will echo the content from the database in place of the default text. I imagine this can be done with a conditional region which is what I'll try...

            Thanks again for the info I really appreciate it.
            • 3. Re: How to get .php?page_1 and .php?page_2 etc...
              Günter Schenk Level 4
              Hi,

              -------
              Now I'm wondering if there is a way for the page to have some info displayed if there isn't a URL parameter passed. So if someone visits www.website.com/index.php it'll show some default text until a URL parameter is passed then the text will echo the content from the database in place of the default text. I imagine this can be done with a conditional region which is what I'll try
              -------

              please have a look at the solution posted in the thread "Content Management Tutorial Question": http://www.adobeforums.com/webx/.59b7491d/1

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver