Re: Question about how to do this...

From: Date: Sun, 08 Jul 2001 21:28:22 +0000
Subject: Re: Question about how to do this...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-56810@lists.php.net to get a copy of this message
Or even better, create a system where you can create new pages without adding to the switch statement: <? $page = "/home/full/path/to/site/page_includes/".str_replace("..", "", $page); if (file_exists($page)) require($page); ?> Note that you _need_ to have the full path, else you're creating a security issue. /* Chris Lambert, CTO - chris@whitecrown.net WhiteCrown Networks - More Than White Hats Web Application Security - www.whitecrown.net */ ----- Original Message ----- From: Ben Bleything <bleythbe@mailbox.orst.edu> To: <cuzo@mediaone.net>; 'PHP General List (E-mail)' <php-general@lists.php.net> Sent: Sunday, July 08, 2001 5:17 PM Subject: RE: [PHP] Question about how to do this... | Yup => Try splitting the pages out into separate files. I'm betting | you'll find it easier to work with. | | Ben | | | -----Original Message----- | From: Chris Cocuzzo [mailto:cuzo@mediaone.net] | Sent: Sunday, July 08, 2001 2:02 PM | To: PHP General List (E-mail) | Subject: RE: [PHP] Question about how to do this... | | so the switch statement idea works I guess. sounds good. | | -----Original Message----- | From: Mark Charette [mailto:charette@sneezy.org] | Sent: Sunday, July 08, 2001 5:05 PM | To: Ben Bleything; cuzo@mediaone.net; 'PHP General List (E-mail)' | Subject: Re: [PHP] Question about how to do this... | | | This is probably "not a good idea" if the data is mostly static. There's | no | real reason to use the power of a db engine for something this trivial, | and | static serving will be faster than a DB system. | | Mark C. | | ----- Original Message ----- | From: "Ben Bleything" <bleythbe@mailbox.orst.edu> | To: <cuzo@mediaone.net>; "'PHP General List (E-mail)'" | <php-general@lists.php.net> | Sent: Sunday, July 08, 2001 3:59 PM | Subject: RE: [PHP] Question about how to do this... | | | > Use a database. With mysql, you can store the text into a table with | > primary key called 'page' or something like that, and a text field of | > some sort. | > | > Then, do mysql_query("SELECT pagetext FROM website WHERE | page=$page;"); | > | > => | > | > Dive into it. It's easier than it looks. | > | > Ben | > | > -----Original Message----- | > From: Chris Cocuzzo [mailto:cuzo@mediaone.net] | > Sent: Sunday, July 08, 2001 1:44 PM | > To: PHP General List (E-mail) | > Subject: [PHP] Question about how to do this... | > | > hey- | > | > so I want to have my site so that the urls are like | /index.php?page=bio | > .... | > the way I made the index.php so far is just one gigantic switch | > statement...is there a better way to do it? | > | > | > chris | > | > | > -- | > PHP General Mailing List (http://www.php.net/) | > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net | > For additional commands, e-mail: php-general-help@lists.php.net | > To contact the list administrators, e-mail: | php-list-admin@lists.php.net | > | > | > | > -- | > PHP General Mailing List (http://www.php.net/) | > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net | > For additional commands, e-mail: php-general-help@lists.php.net | > To contact the list administrators, e-mail: | php-list-admin@lists.php.net | > | > | | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net | For additional commands, e-mail: php-general-help@lists.php.net | To contact the list administrators, e-mail: php-list-admin@lists.php.net | | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net | For additional commands, e-mail: php-general-help@lists.php.net | To contact the list administrators, e-mail: php-list-admin@lists.php.net | | | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net | For additional commands, e-mail: php-general-help@lists.php.net | To contact the list administrators, e-mail: php-list-admin@lists.php.net | | |

« previous php.general (#56810) next »