links

  • 18 years ago

    I got my menu like this


    Home
    Links
    Site Index
    News
    TSO
    Sims 2
    Sims
    Link 2 Us
    Contact Us
    About Us
    Vacancies  
    Which are all links
    but i saw that you can't go like. links.php to goto that page. how do you do it other wise

  • 18 years ago

    can you re-phrase your problem

  • 18 years ago

    well i have a menu.php
    which has links to certain pages these are the links in text
    Home
    Links
    Site Index
    News
    TSO
    Sims 2
    Sims
    Link 2 Us
    Contact Us
    About Us
    Vacancies  
    I read that you arent suppose to say eg. links.php to use as url but to use
    index.php?whatever=pagename
    i dont exactly understand and when i tried it on one of the it didn't work.

  • 18 years ago

    it sound like you've heard about include();
    whilst this is a very useful function, it can lead to easy exposure of code and remote code execution.
    if you want to use the include(); method to open pages, you should use something like the following:


    Code:

    if (ereg("[a-z]+(\[a-z]+)", $whatever) && !ereg("[.].[.]*",$whatever)) {
       include($whatever.".php");
    } else {
       echo "Sorry, that is not a valid file name.";
    }

    whilst this is still not totaly secure, it would be better than nothing.


    FYI: this method is used so you don't have only have to worry about sorting out the menu, and header and footer on one page, and just include the main content for each other page.  But there is nothing wrong with linking to links.php or any other page... but you are creating more work for yourself.


    ps, the in my experience, the include(); method is easier for creating themes.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone” - Bjarne Stroustrup