I need some help with php pages.

Discussion in 'PHP' started by searchfordeal, Aug 24, 2006.

  1. #1
    I have front page using templates.
    and menu has like this links

    index.php?pid=games
    ndex.php?pid=encyclopedia

    etc, but link just refresh index.php and I looked at error log, there is no error log.

    I will pay.
     
    searchfordeal, Aug 24, 2006 IP
  2. BRUm

    BRUm Well-Known Member

    Messages:
    3,086
    Likes Received:
    61
    Best Answers:
    1
    Trophy Points:
    100
    #2
    Hi,

    What's your PHP experience? Could you explain exactly what you want each link to do? Because as far as you're saying, it's doing what it should. Just taking you to the index page with one request, until you use PHP to $_get['x']; or $_request['x']; or $_post['x']; etc.. it won't do anything productive; hence the absence of an error log.

    Thanks,

    Lee.
     
    BRUm, Aug 24, 2006 IP
  3. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    "?pid=games" is called a query string (a GET string in this case). "pid" is a variable that is set to "games." The browser would still load your index.php file, but when the server processes the PHP, it can make use of the query string. I'm guessing your index page should be using $_GET['pid'] to make some change to the content.
     
    Gordaen, Aug 24, 2006 IP
  4. searchfordeal

    searchfordeal Well-Known Member

    Messages:
    1,579
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    138
    #4
    ob_start();

    include("pages/".$pid.'.php');

    $ret = ob_get_contents();

    ob_end_clean();



    $temp = explode("</title>",$ret);

    $temp = strstr($temp[0],"<title>");

    $title = substr($temp,7);

    is this help..pid should call pages/games.php ..just each links display in middle section using one template file.
     
    searchfordeal, Aug 24, 2006 IP