RE: [PHP] Question about how to do this...

2001-07-08 Thread Ben Bleything

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:[EMAIL PROTECTED]] 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Chris Cocuzzo


what if I'm storing HTML into the database, or even PHP code itself for that
matter, is this method that you mentioned still better than the switch
statement method?

chris

-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 08, 2001 4:59 PM
To: [EMAIL PROTECTED]; 'PHP General List (E-mail)'
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:[EMAIL PROTECTED]]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Question about how to do this...

2001-07-08 Thread Mark Charette

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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; 'PHP General List (E-mail)'
[EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Ben Bleything

This is a very good valid point that I completely failed to consider =

Chris, to answer your last question, yes, it _would_ work, but as Mark
points out, it's probably not a very good idea.  Still cool, but hey,
you can tell I don't work in a production environment =

The other method I sent will reduce the size (and maintenance cost) of
your index.php page, while being fast (as Mark says).

Ben

-Original Message-
From: Mark Charette [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 2:05 PM
To: Ben Bleything; [EMAIL PROTECTED]; '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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; 'PHP General List (E-mail)'
[EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
[EMAIL PROTECTED]



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
[EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Chris Cocuzzo

so the switch statement idea works I guess. sounds good. 

-Original Message-
From: Mark Charette [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 08, 2001 5:05 PM
To: Ben Bleything; [EMAIL PROTECTED]; '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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; 'PHP General List (E-mail)'
[EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Ben Bleything

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:[EMAIL PROTECTED]] 
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:[EMAIL PROTECTED]]
Sent: Sunday, July 08, 2001 5:05 PM
To: Ben Bleything; [EMAIL PROTECTED]; '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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; 'PHP General List (E-mail)'
[EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
[EMAIL PROTECTED]



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
[EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Question about how to do this...

2001-07-08 Thread Chris Lambert - WhiteCrown Networks

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 - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Ben Bleything [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; 'PHP General List (E-mail)'
[EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
| 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:[EMAIL PROTECTED]]
| Sent: Sunday, July 08, 2001 5:05 PM
| To: Ben Bleything; [EMAIL PROTECTED]; '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 [EMAIL PROTECTED]
| To: [EMAIL PROTECTED]; 'PHP General List (E-mail)'
| [EMAIL PROTECTED]
| 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:[EMAIL PROTECTED]]
|  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: [EMAIL PROTECTED]
|  For additional commands, e-mail: [EMAIL PROTECTED]
|  To contact the list administrators, e-mail:
| [EMAIL PROTECTED]
| 
| 
| 
|  --
|  PHP General Mailing List (http://www.php.net/)
|  To unsubscribe, e-mail: [EMAIL PROTECTED]
|  For additional commands, e-mail: [EMAIL PROTECTED]
|  To contact the list administrators, e-mail:
| [EMAIL PROTECTED]
| 
| 
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Chris Cocuzzo

ok so if I use this method below, or a hash table, etcand it has an
include/require statement...in those files to be included...do I need to
start it off with the ?phpor can I just write all the code and it'll be
set?

chris

-Original Message-
From: Chris Lambert - WhiteCrown Networks [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 08, 2001 5:28 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Question about how to do this...


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 - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Ben Bleything [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; 'PHP General List (E-mail)'
[EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
| 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:[EMAIL PROTECTED]]
| Sent: Sunday, July 08, 2001 5:05 PM
| To: Ben Bleything; [EMAIL PROTECTED]; '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 [EMAIL PROTECTED]
| To: [EMAIL PROTECTED]; 'PHP General List (E-mail)'
| [EMAIL PROTECTED]
| 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:[EMAIL PROTECTED]]
|  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: [EMAIL PROTECTED]
|  For additional commands, e-mail: [EMAIL PROTECTED]
|  To contact the list administrators, e-mail:
| [EMAIL PROTECTED]
| 
| 
| 
|  --
|  PHP General Mailing List (http://www.php.net/)
|  To unsubscribe, e-mail: [EMAIL PROTECTED]
|  For additional commands, e-mail: [EMAIL PROTECTED]
|  To contact the list administrators, e-mail:
| [EMAIL PROTECTED]
| 
| 
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Ben Bleything

I believe (and I'm sure someone will correct me if I'm wrong) that
whenever you 'include' or 'require' a file, it drops to regular HTML
mode... so, yes, you will need to use ?php tags at the beginning and ?
tags at the ends =

Hope that helps =
Ben

-Original Message-
From: Chris Cocuzzo [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 9:25 PM
To: PHP General List (E-mail)
Subject: RE: [PHP] Question about how to do this...

ok so if I use this method below, or a hash table, etcand it has an
include/require statement...in those files to be included...do I need to
start it off with the ?phpor can I just write all the code and
it'll be
set?

chris

-Original Message-
From: Chris Lambert - WhiteCrown Networks [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 08, 2001 5:28 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Question about how to do this...


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 - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Ben Bleything [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; 'PHP General List (E-mail)'
[EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
| 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:[EMAIL PROTECTED]]
| Sent: Sunday, July 08, 2001 5:05 PM
| To: Ben Bleything; [EMAIL PROTECTED]; '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 [EMAIL PROTECTED]
| To: [EMAIL PROTECTED]; 'PHP General List (E-mail)'
| [EMAIL PROTECTED]
| 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:[EMAIL PROTECTED]]
|  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: [EMAIL PROTECTED]
|  For additional commands, e-mail: [EMAIL PROTECTED]
|  To contact the list administrators, e-mail:
| [EMAIL PROTECTED]
| 
| 
| 
|  --
|  PHP General Mailing List (http://www.php.net/)
|  To unsubscribe, e-mail: [EMAIL PROTECTED]
|  For additional commands, e-mail: [EMAIL PROTECTED]
|  To contact the list administrators, e-mail:
| [EMAIL PROTECTED]
| 
| 
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail:
[EMAIL PROTECTED]
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail:
[EMAIL PROTECTED]
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail:
[EMAIL PROTECTED]
|
|
|



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net

Re: [PHP] Question about how to do this...

2001-07-08 Thread Steve Werby

Ben Bleything [EMAIL PROTECTED] wrote:
 I believe (and I'm sure someone will correct me if I'm wrong) that
 whenever you 'include' or 'require' a file, it drops to regular HTML
 mode... so, yes, you will need to use ?php tags at the beginning and ?
 tags at the ends =

Think of the behavior of include() as copying the exact text from your code
in the include'd file and pasting it as is into the calling code...a la
paper and scissors.  There is no special transformation.  So if the code in
the include'd file would have needed PHP codes if it was directly within the
calling code then it needs it in the include'd file too and if it wouldn't
have in the calling code then it won't in the include'd file.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Question about how to do this...

2001-07-08 Thread mike cullerton

on 7/8/01 10:58 PM, Steve Werby at [EMAIL PROTECTED] wrote:

 Ben Bleything [EMAIL PROTECTED] wrote:
 I believe (and I'm sure someone will correct me if I'm wrong) that
 whenever you 'include' or 'require' a file, it drops to regular HTML
 mode... so, yes, you will need to use ?php tags at the beginning and ?
 tags at the ends =
 
 Think of the behavior of include() as copying the exact text from your code
 in the include'd file and pasting it as is into the calling code...a la
 paper and scissors.  There is no special transformation.  So if the code in
 the include'd file would have needed PHP codes if it was directly within the
 calling code then it needs it in the include'd file too and if it wouldn't
 have in the calling code then it won't in the include'd file.

from http://php.net/include

An important note about how this works is that when a file is include()ed or
require()ed, parsing drops out of PHP mode and into HTML mode at the
beginning of the target file, and resumes again at the end. For this reason,
any code inside the target file which should be executed as PHP code must be
enclosed within valid PHP start and end tags.

 -- mike cullerton



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Ben Bleything

Thanks, I was looking for that =

Ben

-Original Message-
From: mike cullerton [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 10:01 PM
To: 'PHP General List (E-mail)'
Subject: Re: [PHP] Question about how to do this...

on 7/8/01 10:58 PM, Steve Werby at [EMAIL PROTECTED] wrote:

 Ben Bleything [EMAIL PROTECTED] wrote:
 I believe (and I'm sure someone will correct me if I'm wrong) that
 whenever you 'include' or 'require' a file, it drops to regular HTML
 mode... so, yes, you will need to use ?php tags at the beginning and
?
 tags at the ends =
 
 Think of the behavior of include() as copying the exact text from your
code
 in the include'd file and pasting it as is into the calling code...a
la
 paper and scissors.  There is no special transformation.  So if the
code in
 the include'd file would have needed PHP codes if it was directly
within the
 calling code then it needs it in the include'd file too and if it
wouldn't
 have in the calling code then it won't in the include'd file.

from http://php.net/include

An important note about how this works is that when a file is
include()ed or
require()ed, parsing drops out of PHP mode and into HTML mode at the
beginning of the target file, and resumes again at the end. For this
reason,
any code inside the target file which should be executed as PHP code
must be
enclosed within valid PHP start and end tags.

 -- mike cullerton



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]