If result page name=?result and show result

Discussion in 'PHP' started by onlyican.com, Jan 2, 2006.

  1. #1
    Confused yet, ok

    I am building a page and I want to make it so if the user is registered and logged in, when they go to a page, the page shows results to them.

    More detailed, ok.

    For example, if, when they registered, there location is Spain,
    When they view page, Health, the page will be health=?Spain and show details about Spain.

    I got the script to find the location, easy stuff, small MySQL Query.

    At the moment I have echoed to the browser $location, which, in this users case is Spain.

    Now I don't want to show "Spain", i want to go to page http://www.mysite.com/health=?spain.

    Doing this will pull the text from the db for Spain.

    If (you understand me and can help,){
    echo "the answer";

    }else{

    If (you don't understand) {
    echo "WFT you on about";
    }
    lol
     
    onlyican.com, Jan 2, 2006 IP
  2. n0other

    n0other Peon

    Messages:
    146
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you use query string to determine what data you will show to the user - you are implementing a front controller. You have all the data about the user you need to know for showing the page, I'd say you should just make the selection internaly (in health object), and show the appropriate page. Other way, you could redirect him (header('Location: ..)) to the health=Spain once you determined his location. But there's no need. If the health value is not set - show the default information (based up on location), otherwise show the requested info.
     
    n0other, Jan 2, 2006 IP