PHP
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists PHP

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 19th, 2008, 06:01 PM
Sudhakar
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
accessing variable value

i need help with accessing the value of a variable from a different page.

i have an index.php file which has 2 files included to display header and
footer and the center portion changes based on the link clicked on the
footer.

header.php

<?php
echo "<h2Text from header.php file </h2>";
?>

footer.php

<?php
$title="Title of Footer Page";
?>
<a href="index.php?page=web">Web Development</a| <a
href="index.php?page=software">Software </a>

index.php

<?php
$pagename=$_GET["page"];
$title="Index page of Company name";
?>
<html>
<head>
<title><?php echo $title; ?</title>
<meta name="keywords" content="<?php echo $keyword; ?>">
<meta name="description" content="<?php echo $pagedescription; ?>">
</head>
<body>
<?php include("header.php"); ?<p</p>
<center>This is the text in the center</center<p</p>
<?php
if($pagename=="web")
{
include("web.php");
}
if($pagename=="software")
{
include("software.php");
}
?>
<?php include("footer.php"); ?>
</body>
</html>

whenever i click the links for Web Development or Software which appears
from the footer a query string is passed to index.php I am able to display
the content of web.php and software.php using the if() condition and
include()
what i need to display is a different title for web.php and software.php
when a user clicks Web Development along with the content i want the title
of the page to change for SE purpose. i have defined $title differently in
web.php and software.php however presently the title being displayed for
index.php when a user clicks web.php and software.php the title is the same
"Index page of Company name" as this is defined in index.php and my title
tag is written as
<title><?php echo $title; ?</titlehowever the title tag remains the same
whether i click web development or software link. how change i change the
code to display different titles.

i am doing this for SE purpose so that different pages have different
titles and meta tags.

actually there can be indivdual files with links to individual pages however
the people i am dealing with who developed the website want the header and
footer to remain so that a flash file does not have to load each time an
indivdual link is clicked.

please advice.

thanks

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists PHP > accessing variable value


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
Stay green...Green IT