In my site to display photos of churches in my part of France, I have a Search page to help locate churches with particular characteristics (age, architectural style, etc.). When the user clicks on the submit button, the site passes to a Results page that gathers the search criteria, then looks up and displays churches that satisfy the search criteria. The user can then select a church and the site passes to a Display page that shows what information and photos I have for the church.

On the Results page, the search criteria may return 0, 1, or more churches. If 1, I'd like to jump directly from the Results page to the Display page without displaying anything or requiring the user to click on the one church selected. How does one do that?

Harvey

    Use php's header function like this.

    header("Location: pageToGoTo.php?id=1");

    Greets

      Got it. Thanks. (Can't say that Header is an obvious name for this functionality!)

      Harvey

        That's because header() just sends http headers to the browser. The browser reads this, and sees the "Location:" part, which means to the browser "go here!".

        Hope that helps you understand it a bit more 😉

        Whoo!!! Total Posts: 455 (1.00 posts per day)

          It does help a bit.

          However for someone from a traditional programming background, where words like RUN and EXECUTE are more common, it wasn't an obvious choice.

          In any case, thanks for the explanation.

          Harvey

            Write a Reply...