[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 12-20-2005, 08:24 PM   #1 (permalink)
NamePros Member
 
Join Date: Nov 2005
Posts: 66
64.00 NP$ (Donate)

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, 08:31 PM   #2 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services


 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,545
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
PHP Code:

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

<?php

$page
= $_GET['page'];

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 08:34 PM. Reason: Oops
Eric is offline  
Old 12-21-2005, 03:28 AM   #3 (permalink)
NamePros Member
 
Join Date: Nov 2005
Posts: 66
64.00 NP$ (Donate)

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, 05:16 AM   #4 (permalink)
mch
NamePros Regular
 
Join Date: Nov 2005
Location: EU
Posts: 248
99.25 NP$ (Donate)

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, 05:17 AM   #5 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services


 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,545
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
PHP Code:
<a href="?page=about.php">About</a>
<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 06:19 AM. Reason: Oops, my bad - nEed some sleep :(
Eric is offline  
Old 12-21-2005, 06:09 AM   #6 (permalink)
NamePros Member
 
Join Date: Nov 2005
Posts: 66
64.00 NP$ (Donate)

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

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
17 Canada Databases For Sale odditysoftware Content For Sale 0 12-13-2005 09:08 PM
Question regarding php includes grungemusic Website Development 2 04-06-2005 07:15 AM
inserting a phpbb2 forum in a php page using includes r22pl Programming 13 03-07-2005 01:43 PM
Page Rank 5 Site with Banner and Text Links!! MUCH MORE! High Traffic Sites ebizcraftsman Advertising & SEO Services 0 12-09-2004 09:43 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 03:25 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85