Current location: Hot Scripts Forums » Programming Languages » PHP » Question about layouts


Question about layouts

Reply
  #1 (permalink)  
Old 02-04-04, 01:42 AM
DarkSamurai2003 DarkSamurai2003 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Question about layouts

What is the logic or idea behind doing multiple layouts while having per se the same index file, or a user being able to choose layouts.

It's kind of confusing for me

See my news goes like index.php?cat=1

Would the code be to have a different layout be somethoing

if(cat=1)
{
// stuff here to choose a different layout
}
if(cat=2)
{
// stuff here to choose a different layout
}
etc.
else
// show the regular layout

?
Reply With Quote
  #2 (permalink)  
Old 02-04-04, 02:09 PM
KeithMcL KeithMcL is offline
Newbie Coder
 
Join Date: Jul 2003
Location: Dublin, Ireland
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
You could do something like this.

PHP Code:

if (isset($_GET['cat1'])) && $_GET['cat1'] != '') {
// layout 1 goes here
elseif (isset($_GET['cat2'])) && $_GET['cat2'] != '')
// layout 2 goes here
else;
// default layout goes here

And then you could use links to change the layout like so:

http://www.domain.com/index.php?cat=1
http://www.domain.com/index.php?cat=2
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ADO Recordsets question vbNovice Visual Basic 0 12-22-03 10:25 PM
Substitution question $_eq Arowana Perl 2 12-10-03 10:01 AM
Perl-PHP software Copyright question! kevin PHP 8 10-29-03 08:03 AM
preg_match question Dj_Farout PHP 0 10-27-03 05:51 PM
PHP header question khadlock PHP 2 09-23-03 08:17 AM


All times are GMT -5. The time now is 08:16 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.