Go Back   CodingForums.com > :: Client side development > General web building

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-07-2007, 08:54 AM   PM User | #1
mike_tw
New Coder

 
Join Date: Apr 2007
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
mike_tw is an unknown quantity at this point
file.php?page=whatever

Hi,

Im noticing quite a bit of websites have urls like index.php?page=23241

Is this an example of a database driven website? Ive tried searching google for this page=whatever method but dont know how to word the search. What is this method called?

Also, I see some where there is a content area, when you click another link that area changes but the areas around it seem to stay exactly the same like header , side menu + footer. What is this method? Include?

Thanks for any info you can provide to help me

Thanks
mike_tw is offline   Reply With Quote
Old 06-07-2007, 09:11 AM   PM User | #2
GSimpson
Regular Coder

 
GSimpson's Avatar
 
Join Date: Aug 2006
Location: New Zealand
Posts: 268
Thanks: 9
Thanked 0 Times in 0 Posts
GSimpson is an unknown quantity at this point
doesn't have to be database but could very well be. And yes it could very well have the variable in the url (?id=34343) and then going include($id);

It is a very smart way of doing things. Much better for the manager aswell.
GSimpson is offline   Reply With Quote
Old 06-07-2007, 09:16 AM   PM User | #3
croatiankid
Regular Coder

 
croatiankid's Avatar
 
Join Date: Jan 2006
Posts: 665
Thanks: 1
Thanked 12 Times in 12 Posts
croatiankid is on a distinguished road
Those are most often $_GET variables.
__________________
Hrvoje
Croatiankid designs
Downtown host
croatiankid is offline   Reply With Quote
Old 06-07-2007, 09:40 AM   PM User | #4
mike_tw
New Coder

 
Join Date: Apr 2007
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
mike_tw is an unknown quantity at this point
yes, I like the looks of it very much. Tidy and professional looking.

Which method do you use? Im going to be making a basic introductory website for a company soon and just looking at ways i could build it. Which way would you guys do it?

I think ill do that index.php?page=about
mike_tw is offline   Reply With Quote
Old 06-07-2007, 10:08 AM   PM User | #5
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Originally Posted by mike_tw View Post
yes, I like the looks of it very much. Tidy and professional looking.

Which method do you use? Im going to be making a basic introductory website for a company soon and just looking at ways i could build it. Which way would you guys do it?

I think ill do that index.php?page=about
If you wanna keep all the content in the same page, this method may be suitable

PHP Code:
if($_GET['page']=='home')

Code:
<div class="content">
HOME CONTENT
</div>
PHP Code:
}
else if((
$_GET['page']=='about')

Code:
<div class="content">
ABOUT CONTENT
</div>
PHP Code:
}
...............
..............
else

Code:
PAGE ERROR
PHP Code:

__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

Last edited by abduraooft; 06-07-2007 at 10:10 AM..
abduraooft is offline   Reply With Quote
Old 06-07-2007, 11:43 AM   PM User | #6
GSimpson
Regular Coder

 
GSimpson's Avatar
 
Join Date: Aug 2006
Location: New Zealand
Posts: 268
Thanks: 9
Thanked 0 Times in 0 Posts
GSimpson is an unknown quantity at this point
yep that's good. Or....
Code:
$mypage = "sources/" . $_GET['page'] . ".txt";
include($mypage);
your directory could look like:

index.php
style.css
sources/
home.txt
about.txt

and so on, so on. But that's just cause I don't like having a lot of coding.

Last edited by GSimpson; 06-07-2007 at 12:26 PM..
GSimpson is offline   Reply With Quote
Old 06-07-2007, 12:34 PM   PM User | #7
mike_tw
New Coder

 
Join Date: Apr 2007
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
mike_tw is an unknown quantity at this point
could i still use html tags in that .txt file? For images and such
mike_tw is offline   Reply With Quote
Old 06-07-2007, 01:17 PM   PM User | #8
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,046
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
PHP Include simply takes whatever file you want to include and sticks
it in the same spot as the "Include" ... all text verbatim. So, you can use
html, css, whatever. This all happens on the server before your page is
sent to the user.
mlseim is offline   Reply With Quote
Old 06-07-2007, 09:42 PM   PM User | #9
croatiankid
Regular Coder

 
croatiankid's Avatar
 
Join Date: Jan 2006
Posts: 665
Thanks: 1
Thanked 12 Times in 12 Posts
croatiankid is on a distinguished road
It looks "cool", but the thing is, it's actually much better to use a / architecture. This puts keywords in your URL (for SEO), and is human-readable.
__________________
Hrvoje
Croatiankid designs
Downtown host
croatiankid is offline   Reply With Quote
Old 06-08-2007, 01:13 PM   PM User | #10
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,046
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Have a main page (index.php), and then, all other pages can
be one dynamic PHP script, example: page.php?p=2 or page.php?p=13

Those variables will determine which "includes" will be used for
the content of the pages. See example below ... mouse-over the
links in the menu, notice the URL. The actual menu can also be a
PHP script, so you only need to edit one file if you add more navigation
items (and the navigation script is also a PHP include).

http://www.palosantodesigns.com/
mlseim is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:11 PM.


Advertisement
Log in to turn off these ads.