NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page PHP Includes on a part of a page when clicked

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 12-20-2005, 09:24 PM THREAD STARTER               #1 (permalink)
NamePros Member
Join Date: Nov 2005
Posts: 66
nigelwong is an unknown quantity at this point
 



PHP Includes on a part of a page when clicked


Does anyone know a tutorial that teaches you how to: When A Link is clicked a portion of the website changes according to the link.Something to do with <?php $get or something similar....

Thanks!
nigelwong is offline  
Old 12-20-2005, 09:31 PM   #2 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
PHP Code:

<a href="?page=page_name">Page Name</a>

<?php

$page 
$_GET['page'];
????: NamePros.com http://www.namepros.com/programming/149917-php-includes-part-page-when-clicked.html

switch(
$page)
{
  case: 
'page_name'
  
include("somefile.php");
  break;
}
?>
//Etc
Hope this helps...I'll try to find you a tutorial tho
Last edited by SecondVersion; 12-20-2005 at 09:34 PM. Reason: Oops
Eric is offline  
Old 12-21-2005, 04:28 AM THREAD STARTER               #3 (permalink)
NamePros Member
Join Date: Nov 2005
Posts: 66
nigelwong is an unknown quantity at this point
 



can you please give an example where a link could switch between several includes (several page_names)?
nigelwong is offline  
Old 12-21-2005, 06:16 AM   #4 (permalink)
mch
NamePros Regular
Join Date: Nov 2005
Location: EU
Posts: 248
mch is on a distinguished road
 



I think what you mean is that a click on a link changes some content without reloading the page, right? For that you need CSS and JavaScript.
mch is offline  
Old 12-21-2005, 06:17 AM   #5 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
PHP Code:
<a href="?page=about.php">About</a>
????: NamePros.com http://www.namepros.com/showthread.php?t=149917
<a href="?page=contact.php">Contact</a>
<a href="?page=links.php">Links</a>

<?php

$page 
trim($_GET['page']);
//Meh, trim not necessarily needed, just an ol' habbit I guess:P

switch ($page)
{
  case 
'about'
        include(
'about.php');
        break;
  case 
'contact'
        include(
'contact.php');
        break;
  case 
'links'
        include(
'links.php');
        break;
  default 
'home'
        include(
'index.php');
}

?>
Last edited by SecondVersion; 12-21-2005 at 07:19 AM. Reason: Oops, my bad - nEed some sleep :(
Eric is offline  
Old 12-21-2005, 07:09 AM THREAD STARTER               #6 (permalink)
NamePros Member
Join Date: Nov 2005
Posts: 66
nigelwong is an unknown quantity at this point
 



Parse error: parse error, unexpected ':' on the line which About : "about.php" is on... is it supposed to be = ? =s

Ah found a helpful thread here: http://www.programmingtalk.com/showthread.php?t=14581

Thanks for your help though!!
nigelwong is offline  
Closed Thread


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
17 Canada Databases For Sale odditysoftware Content For Sale 0 12-13-2005 10:08 PM
Question regarding php includes grungemusic Website Development 2 04-06-2005 08:15 AM
inserting a phpbb2 forum in a php page using includes r22pl Programming 13 03-07-2005 02:43 PM
Page Rank 5 Site with Banner and Text Links!! MUCH MORE! High Traffic Sites ebizcraftsman Advertising & SEO Services 0 12-09-2004 10:43 PM
Five-Day .INFO SALE - Part Five - 133 Domains Including StockResearch.info Duke Domains For Sale - Make Offer 0 03-31-2004 12:49 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 08:49 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger