WeBFreaKZ
10-09-2003, 03:57 AM
there my subject actualy says it...
Is there a way that i can make it like index.php?view=contact
or something like that???
Is there a way that i can make it like index.php?view=contact
or something like that???
|
||||
Creating a index.php?view=thingWeBFreaKZ 10-09-2003, 03:57 AM there my subject actualy says it... Is there a way that i can make it like index.php?view=contact or something like that??? Cloudski 10-09-2003, 06:21 AM Just make a link to the page: <a href="page.php?action=view">Link</a> Or something like that... Unless I am misunderstanding your question? SDP2006 10-09-2003, 12:30 PM Yes, you are majorly misunderstanding his question. Okay ?action=view is called a query. There are a lot of ways to do this, I'm gonna show you one that you might consider using, but If you have a lot of links, I would not recommend this. <?php $page = $_GET['action']; switch ($page) { case "home": $include = "includes/index.html"; break; case "arts": $include = "includes/arts.html"; break; case "aaexpert": $include = "includes/aaexpert.html"; break; case "career": $include = "includes/career.html"; break; case "comics": $include = "includes/comics.html"; break; case "graphics": $include = "includes/graphics.html"; break; case "computers": $include = "includes/computers.html"; break; case "consumers": $include = "includes/consumer.html"; break; default: $include = "includes/home.html"; break; } include ($include); ?> Now when you link, name this page something like links.php or cats.php or whatever.php! For instance http://www.yourdomain.com/whatever.php?action=computers That would include computers.html. You'll obviously need to change the paths/to/files. Hope this helps. missing-score 10-09-2003, 05:06 PM another simple way would be to have an array of pages, but once again, not reccomended for very big sites. <?php $pages = array( 'page1'=>'page1.html', 'page2'=>'page2.html', 'home'=>'index.html'); if(isset($_GET['view']) && isset($pages[$_GET['view']])){ include($pages[$_GET['view']]); } else { include('defaultpage.html'); } ?> SDP2006 10-09-2003, 06:17 PM Yeah, I would recommend the array. Its much easier and the case: break; can get kinda old and long. Well, I learned something new today, thanks missing-score |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum