Help - Search - Members - Calendar
Full Version: php help
Krazy Letter Forums > The Modern World > Tech Help and Advice
peanut butter
hi, dont know if this is the right place, but here it goes.


im creating a CMS. I need to have the variable $title set to different things hence:
<?php echo $sitesettings['sitename'];?>::<?php echo ($title) ; ?>
CODE
<title><?php echo $sitesettings['sitename'];?>::<?php echo $title ; ?></title>


to generate the $title variable i use the following code:
CODE
<?php
if(isset($_GET['content'])) {
$content = ($_GET['content']);
if (file_exists("pages/$content.txt") != false){
$title = ($_GET['content']);
}else{
$title = ('404 Error!');
}
}else{
$title = ('Home');
};
?>


in my mind it seems it should work, but it just shows

Wahoo:: - Firefox and completely ignoores the 2nd variable.
any ideas why? Im completely stumped.
lappy512
Could you give some more information? Like, where's the position of the second piece of code in relation to the first one?
myncknm
QUOTE(lappy512 @ Nov 28 2006, 02:53 PM) *
Could you give some more information? Like, where's the position of the second piece of code in relation to the first one?

I was just about to suggest that. Before I was working on some scripting, and Firefox's Javascript console kept telling me that the variable was not defined, that a certain object did not exist on the page. Then I realized that the script that gave me the error came at the beginning of the body, so all those objects that I was referencing didn't even exist yet.
peanut butter
i really need to do more php. Yah lappy was right. the Vars werent defined yet. Well it works now wahoo. I might make a SF project for this cms.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.