PHP linking, please help

Discussion in 'PHP' started by hw26, Nov 4, 2009.

  1. #1
    Hello,

    I'm looking for the ability to link to a new page without actually creating the file for it. In the toolbar it just shows something like this:

    page.php?page=1

    I need it because i'm setting up a free website so users can download icons, so instead of me creating a new page for every single icon download displaying its information i can just add a new link if you understand what i require.

    Any help appreciated.

    Thank you
     
    hw26, Nov 4, 2009 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    U Need to use get and maybe mysql to do this ..
     
    Bohra, Nov 4, 2009 IP
  3. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #3
    Why would you need MySQL? Just do:

    Code:
    
    <!-- Before Content HTML Here -->
    <?php
    
    if($_GET['page'] == 'something')
    {
    include_once('something.php');
    }
    elseif($_GET['page]' == 'somethingelse')
    {
    include_once('somethingelse.php');
    }
    else
    {
    include_once('default.php');
    }
    ?>
    <!-- HTML After Content Here -->
    
    Code (markup):
    Just add more ifelse statements as needed. You'll still need to create a new file but you won't have to include anything but the content that is going to show up.
     
    Pudge1, Nov 4, 2009 IP
  4. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #4
    Since he doesnt want diffrent pages its better to use mysql..whats the point of making individual files and then using this format.. ?? its bad for seo and at the end u are having the same amount of files
     
    Bohra, Nov 4, 2009 IP
  5. hw26

    hw26 Peon

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Unfortunatly making a new file for every icon pack i add wouldn't be an option as there will be hundreds at some point in the future. MySQL is an option i'd need to take a look at further.

    Thanks for your help. :)
     
    hw26, Nov 4, 2009 IP