Website Title in PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
clarkhaddock
Forum Newbie
Posts: 6
Joined: Wed Nov 26, 2008 10:20 am

Website Title in PHP?

Post by clarkhaddock »

Can anyone help with this stupid question. Sorry to ask. I have a website and i am trying to rename the site pages for all of my landing pages. they are all showing the general site title: Custom Design Dog T-Shirts Online for our site/landing page: http://www.designadoggietee.com/customi ... shirts.php i have used GoLive and renames the Title and header but when i post it, it still uses the same :Custom Design Dog T-Shirts Online any ideas on where i go to edit this or get it to use the title an header from that page and not grab it from other source? thanks!
sparrrow
Forum Commoner
Posts: 81
Joined: Mon Oct 20, 2008 12:22 pm

Re: Website Title in PHP?

Post by sparrrow »

I'm not familiar with your HTML editor. I personally use Notepad2 to edit all my pages. Text only as opposed to WYSIWYG gives you more control over subtle things like that. I would recommend opening your files in Notepad, fine the title tag, and change the title. If you aren't comfortable in text-only mode, try to refrain from changing anything else.

Code: Select all

<title>Custom Design Dog T-Shirts Online</title>
mintedjo
Forum Contributor
Posts: 153
Joined: Wed Nov 19, 2008 6:23 am

Re: Website Title in PHP?

Post by mintedjo »

I personally use Notepad2
Notepad++ FTW!

I used Notepad 2 for about 2 years to develop in Windows. I don't know how its changed since i last used it but now i use Notepad++. It has all the syntax highlighting you could ever want and lots of nice built in scripts that 99% of people will never use. Also it has a nice regex find and replace that notepad 2 never had when i was a kid...
clarkhaddock
Forum Newbie
Posts: 6
Joined: Wed Nov 26, 2008 10:20 am

Re: Website Title in PHP?

Post by clarkhaddock »

see, i have done that. i have replaced the title section on that file but it never shows up once i upload the changes. it still uses the same old site wide standard name. any ideas?

see the demo page at: http://www.designadoggietee.com/customi ... hirtsb.php

i changed the code like you said to be the page name:

<?php
$topText = "Custom Dog Shirts | Custom Dog T-Shirts | Personalized Dog T-Shirts | Personalized Dog bandanas | Personalized Dog Tee Shirts | Make Your Own Dog T-Shirts | Personalized Dog Clothes | Custom Pet Shirts | Create a Dog Tee Shirt | Custom Dog Bandanas.";
include_once('top.php');
include_once('classes/Product.php');

$product = new Product();
?>

<html>

<head>
<title>customized_dog_t_shirts</title>
<style type="text/css">
.indximg{
height:130px;
width:125px;

}
.prodclass{
background:url(<?=FOLDER?>/images/productbg.jpg);
background-repeat:no-repeat;
padding:10 10;

did not paste all the page code:

still does not work
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Website Title in PHP?

Post by onion2k »

You need to be changing top.php.
clarkhaddock
Forum Newbie
Posts: 6
Joined: Wed Nov 26, 2008 10:20 am

Re: Website Title in PHP?

Post by clarkhaddock »

if i change the top.php file. does that change every page that uses it to that page title then?

is there a way to name that file because i have tons of copies that are for different landing pages. If i change the top.phpfile, all of them will have the same name.

the other issue is the Title area. it has the words: ?=$pageTitle?

is it ok to change that by just putting in a page name or is that going to mess up other things?

Here is the code from the top page:
<?php
include_once("lib/include.php");
require_once("classes/Email.php");
require_once("classes/User.php");
require_once("classes/HTMLLink.php");
require_once("classes/Login.php");
include_once("language.php");




function static_page_language()
{
$q="select * from language where page='".basename($_SERVER['PHP_SELF'])."'";

$r=mysql_query($q);
while($data=mysql_fetch_array($r)){
if("eng"==$_COOKIE["language"])
{
if($data['location']=="title")
echo "<h1>".$data['eng']."</h1>";
else
echo $data['eng'];
}
if("de"==$_COOKIE["language"]){
if($data['location']=="title")
echo "<h1>".$data['de']."</h1>";
else
echo $data['de'];
}
if("sw"==$_COOKIE["language"]){
if($data['location']=="title")
echo "<h1>".$data['sw']."</h1>";
else
echo $data['sw'];
}
}
}

?>
<html>
<head>
<title><?=$pageTitle?></title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<meta HTTP-EQUIV="description" CONTENT="Design a Doggie Tee | Create a custom designed dog t-shirts with your own text, images and photographs. Popular products include dog tee shirts, tank tops, sweatshirts, bandanas & more.">
<meta HTTP-EQUIV="keywords" CONTENT="Personalized t-shirts for dogs, dog clothes, designer dog clothes, personalized dog shirts, pet clothes, dog apparel, puppy, puppies, pet apparel, buy dog shirt t, pet gift, dog lover gift, designer dog clothing, dog tee, funny dog t shirt, pet shirt, dog breed shirt">
<link href="css/design.css" rel="stylesheet" type="text/css">
<link href="css/main.css" rel="stylesheet" type="text/css">
<link href="css/player.css" rel="stylesheet" type="text/css">
<link href="js/niftyCorners.css" rel="stylesheet" type="text/css">
<link href="css/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/SpryTabbedPanels.js"></script>
<script language="JavaScript" type="text/javascript" src="js/common.js"></script>
<script language="javascript" src="moo.fx/scripts/prototype.lite.js"></script>
<script language="javascript" src="moo.fx/scripts/moo.fx.js"></script>
<script language="javascript" src="moo.fx/scripts/moo.fx.pack.js"></script>
<script language="javascript" src="moo.fx/scripts/moo.ajax.js"></script>
<script language="JavaScript" type="text/javascript" src="js/swfobject.js"></script>
<script language="JavaScript" type="text/javascript" src="js/common.js"></script>
<script language="javascript">AC_FL_RunContent = 0;</script>
clarkhaddock
Forum Newbie
Posts: 6
Joined: Wed Nov 26, 2008 10:20 am

Re: Website Title in PHP?

Post by clarkhaddock »

Also, i do not see on the top.php file anywhere with the text: Custom Design Dog T-Shirts Online

that is the text we are trying to change.

sorry for these questions which i am sure are very simple to you guys!
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Website Title in PHP?

Post by onion2k »

$pageTitle is a variable that contains "Custom Design Dog T-Shirts Online" ... you'll need to work out where that is being set and change it, or add some code to set it to be different things depending on what page is being opened. Whatever the case, you definitely won't be able to change this with a simple "find and replace".
clarkhaddock
Forum Newbie
Posts: 6
Joined: Wed Nov 26, 2008 10:20 am

Re: Website Title in PHP?

Post by clarkhaddock »

any idea on where to look for the: $pageTitle is a variable that contains "Custom Design Dog T-Shirts Online"

any ideas on how we can create custom page names for all of the pages instead of useing the page title from the top.php?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Website Title in PHP?

Post by onion2k »

It'll be set in one of the include files somewhere I guess. There's no way for anyone who doesn't have access to all the code to tell you that. As for creating custom page titles, I'd comment out whatever code is setting $pageTitle at the moment, and set "$pageTitle = 'my page title';" on each page to something depending on what script is running before top.php is included.

Also, the first time that page loads the user has to download 1.1 megabytes of stuff (HTML, CSS, images, and Javascript). That's an awful lot for what is a pretty basic page. Do you really need all those Javascript libraries on every page? They only seem to be used on the T Shirt designing page so they really should only be loaded on that page...
clarkhaddock
Forum Newbie
Posts: 6
Joined: Wed Nov 26, 2008 10:20 am

Re: Website Title in PHP?

Post by clarkhaddock »

not sure if i need all of the code or not. Each image loads that design inside the design studio. if i take it out, will they still load the correct information or is the code you are talking about not have anything to do with loading the correct designs.
Post Reply