index.php?id=blah

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • index.php?id=blah

    Hi there..

    I notice on lots of php sites that pages are linked using code such as..

    index.php?id=blah

    I have a small personal site and wish to be able to have when someone clicks on a link say.. downloads.. and the link would be... index.php?id=blah

    I've come across a few ways to do this.. but have never managed to be able to do it.. if you can help me configure a php script to do the above on my website.. i would be very thankful!

    Thanks..

    pom

  • #2
    hy ja

    bcause my english is not the vry gratest - and of course i am not realy myself yet i'll post code -> hope u understand


    code of index.php ..



    kenrgoe
    er
    e
    rv

    <a href="index.php?page=downloads">downloads</a>

    this is you link


    code of index.php

    you have to check witch $page is selected

    if (($page=="downloads")){
    do what u want
    }else{
    post the normal page ....
    }


    any questions? -well if i cant help u with that may contact me via icq or mail

    Kommentar


    • #3
      hey...

      thanks for the reply..

      I've been using this code to do what i asked..

      code for index.php:

      <?php
      switch($id){
      case '01':
      include '01.php';
      break;
      case '02':
      include '02.php';
      case '03':
      include '03.php';
      break;
      break;
      default:
      include 'home.php';
      }
      ?>

      This code works just fine.. but I just wondered if there might be any security flaws/problems with this code..

      thanks..

      pom

      Kommentar


      • #4
        Re: hey...

        no, i don't think that there are any security flaws in this kind of script.
        the user of your web site can call this page with whatever parameter he likes - if it's not between 01 and 03, the default page will be served in any case - so there is no risk at all that anyone could call your script for including files which are not mentioned in your switch() statement.
        I don't believe in rebirth. Actually, I never did in my whole lives.

        Kommentar


        • #5
          but if u want to do sth like an admin-zone u should check session aso cause if u just login and dont create a session you can walk-through-login

          that means you have the login.php and if u are logged in you can go to login?jump=delete

          DANGEROUS because u can call login?jump=delete without passing the normal login.php

          u know what i mean?

          Kommentar


          • #6
            I understand

            Hey..

            Yeah I understand what you mean.

            I dont need an admin section for the main pages..

            I do have a news script running where I log in as admin etc.. but this runs separately from the rest of my main pages and uses a completely different code so there should not be any security risk there!

            Thanks for the help guys.

            pom

            Kommentar

            Lädt...
            X