News:

Join the Facebook Fan Page.

Main Menu

Learn PHP

Started by Microcyb, August 18, 2003, 04:58:26 PM

Previous topic - Next topic

Wezz6400

Quote from: [Unknown] on August 22, 2003, 07:28:36 PM
Quote from: Aquilo on August 22, 2003, 07:26:02 PM
oh [unknown] is always so right!

I don't deserve such high praise - and I am so very often wrong too.

-[Unknown]
That's not true! You're always right! But then you are wrong here, which means you are not always right, which means you're right here after all, which means you're always right. But then you are wrong here, which means you are not always right, which means you're right here after all, which means you're always right... ;D

Big P

I just like the way I did it with PHPNews. Here's some modified code of what I did:


        include_once('pages.php');

        /* Place the function names in an Array */
        $Array = array(
                'search',
                'contact',
                'links',
                'news',
                'pictures',
                'downloads');

        /* If action doesn't exist, do the main() function */
        if (!in_array($_GET['action'], $Array, TRUE))
        {
          main();
        }
        else
        {
          $_GET['action']();
        }


Obviously, each section above is in its own function, but it could be easily modified to open up *.txt files with content in them, plus it's as secure as you're likely to get.
PHPNews has been released! Download it now!

Read My Blog!

Aquilo

I just went with the in_array approach in one of my scripts.

what is the advantage of using the strict argument if it's in there it's true if not false?

Advertisement: