PHP Title Question

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
chloe.gray
Forum Newbie
Posts: 10
Joined: Fri Jun 19, 2009 3:08 pm

PHP Title Question

Post by chloe.gray »

Hi,

I'm fairly new to PHP and I've taken over maintaining a site that is written in PHP.
At the top of each page, the code reads:

Code: Select all

<?php $pagename="Eyelash Extensions";
$description="Skin Care treatments at the NYC office of Ronni Kolotkin, Inc. ";
$keywords="esthetician in NYC, facial, massage, exfoliation, skin care treatment, back treatment, anti-aging facial, enzyme peel, collagen eye treatment, hand treatment";
 include ('top-noflash.php');?>

the pagename (ie "Eyelash Extension") displays at the top of each page when viewed in a web browser. I would like to replace this page name text with a script text that is a .gif file, but I believe that the page name helps with SEO. Is this correct? If so, how can I use a .gif file and still have the page name in the code?

Thanks!

Chloe
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP Title Question

Post by requinix »

Depends where $pagename goes. Into the <title>? You can't put images in there.

We have no idea what code you're working with. To help you with your questions you'll have to explain a lot more.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: PHP Title Question

Post by Eric! »

You probably need to define a $banner section to display at the head section or wherever it would look good. $banner would just hold the img tag and any formating that is appropriate for your page. But that is only a suggestion because we don't know what you are asking and there isn't enough code posted.

When titles and page content are very similar and they match search phrases, then search engines will rank you higher. The name of the link being similar to the content and title also helps.
chloe.gray
Forum Newbie
Posts: 10
Joined: Fri Jun 19, 2009 3:08 pm

Re: PHP Title Question

Post by chloe.gray »

Thanks for your reply!

Here is a link to the page:

http://www.ronnikolotkin.com/testing_cu ... nsions.php

I am wondering if it is necessary for the page title (code posted above) to be there?

Here is all the code for the page:

Code: Select all

<?php $pagename="Eyelash Extensions";
$description="Skin Care treatments at the NYC office of Ronni Kolotkin, Inc. ";
$keywords="esthetician in NYC, facial, massage, exfoliation, skin care treatment, back treatment, anti-aging facial, enzyme peel, collagen eye treatment, hand treatment";
 include ('top-noflash.php');?><br/>
<div id="c">
<div class="columnLeftEyelash"> 
<img class="headerImg" src="images/headers/eyelash_extensions.gif" alt="Ronni Kolotkin Eyelash Extensions" longdesc="images/headers/eyelash_extensions.gif" />
Eyelash extensions are a fast, easy way to significantly improve the look and youthfulness of your eyes and face.  After one treatment, you will have a complete set of beautiful, natural-looking, lush eyelashes that are indistinguishable from your own.<br />
<br />
<img class="paddingImg" src="images/brunette_lashes.jpg" height="546" width="390" alt="Ronni Kolotkin Eyelash Extension" longdesc="images/eyelash_girls.jpg" />
<h2>How Extensions Work</h2>
Lash extensions are hair-like fibers that are bonded, lash-by-lash, onto your own individual lashes, near the base.  This synthetic hair never touches skin or impedes the growth of the lash to which it is attached.  The adhesive is formaldehyde-free and safe for use near the eye.<br />
<br />
<h2>Semi-Permanent</h2>
The extensions we use are semi-permanent but with regular maintenance you’ll have your new set of lash extensions forever!  Each individual lash lasts about one to three months, depending on personal factors.  Once your initial appointment is over, you return to us for replenishment and spot-fixes.  Your aesthetician will advise you as to how best to care for your lashes to maximize their lifespan.   <br /><br />
</div> <!-- columnRightSkin -->
 
<div class="columnRightEyelash">
<h2 style="text-align:left;">We use only NovaLash™ Lash Extensions and Adhesive</h2>
NovaLash ™ is the only line of eyelash extension products featuring a USP (US Pharmaceutical Grade), formaldehyde-free, FDA and AEWCA approved adhesive.  And the eyelash remover is acetone-free.  No other line of products has received these approvals.<br /><br />
 
<h2>More to Know</h2>
 
Lash extensions need not be maintained permanently. They are perfect treats for important events: vacations, weddings, proms, photo sessions.  Any time you want some extra firepower.  
 
Our aestheticians can easily tailor your lash extensions to your own preferences.   We have both straight and curly extensions available and can make your lashes as subtle or as dramatic as you wish.   
 
You will be given thorough instructions from your aesthetician about how to care for and maintain your new lashes. You may safely wear them swimming.<br /><br />
 
 
<h2>The Cult of RKI Lashes!</h2>
 
We’ve already got some fanatical lash extensions clients, including our own staffers.  Here are some typical quotes:<br /><br />
 
“People stop me in the subway and ask me what mascara I use.”<br /><br />
 
“I wish I’d done this years ago.  I feel great.”<br /><br />
 
“My friends tell me how youthful I look these days.  They want to know what’s different…!”<br /><br />
 
“Just like with electrolysis, it’s so great to have something <em>taken care of</em>.”<br /><br />
 
<h2>Pricing</h2>
<table width="391" border="0" cellspacing="5" cellpadding="5" class="priceTable">
  <tr>
    <td>Initial Session:</td>
    <td align="right"><span class="price">$375</span></td>
  </tr>
  <tr>
    <td ><span class="price">Maintenance</span></td>
    <td></td>
  </tr>
  <tr>
    <td >2 weeks since last appointment:</td>
    <td align="right"><span class="price">$75-$100</span></td>
  </tr>
  <tr>
    <td >3 – 4 weeks since last appointment:</td>
    <td align="right"><span class="price">$125</span></td>
  </tr>
   <tr>
    <td >4 - 5 weeks since last appointment:</td>
    <td align="right"><span class="price">$150</span></td>
  </tr>
    <tr>
    <td >5 - 6 weeks since last appointment:</td>
    <td align="right"><span class="price">$200</span></td>
  </tr>
    <tr>
    <td >5 - 6 weeks since last appointment:</td>
    <td align="right"><span class="price">$200</span></td>
  </tr>
   <td >safe eyelash removal:</td>
    <td align="right"><span class="price">$100</span></td>
  </tr>
    <tr>
    <td colspan="2" ><span class="price">*at 6+ weeks, you must schedule an Initial Session</span></td>
  </tr>  
</table><br /><br />
    
 
  </div><!-- secondColumnSkin --><br />
 
</div>
<?php include ('bottom.php');?></td></tr></table>
<!-- start google analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7720204-1");
pageTracker._trackPageview();
} catch(err) {}</script>
  <!-- end google analytics -->
</BODY>
</HTML>
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: PHP Title Question

Post by Eric! »

Without seeing the contents of topnoflash.php and bottom.php, I can't tell you if you need that code or not.

However I did learn that when I need more firepower I need eyelash extentions.
chloe.gray
Forum Newbie
Posts: 10
Joined: Fri Jun 19, 2009 3:08 pm

Re: PHP Title Question

Post by chloe.gray »

haha, firepower indeed.

Here is the code for the header and footer:

TOP NO FLASH

Code: Select all

<HTML>
<HEAD>
<TITLE><?php if ($pagename){echo $pagename . ': ';} echo 'Ronni Kolotkin, Inc. ';?></TITLE>
<script src="/mint/?js" type="text/javascript"></script>
<meta name="description" content="<?php echo $description;?>"/>
<meta name="keywords" content="<?php echo $keywords;?>" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<link rel="stylesheet" type="text/css" href="ronnik.css">
<link rel="Shortcut Icon" href="/favicon.ico"/>
</HEAD>
<BODY><table align="center"><tr><td>
<div id="t"><h1> <?php echo $pagename;?></h1>
Ronni Kolotkin, Inc. | (212) 366-6663 | 80 Fifth Avenue, Suite 1508 New York, New York 10011</div>
<div id="m">
<ul>
<li><a href="index.php" title="Ronni Kolotkin">HOME</a></li>
<li><a href="electrolysis.php" title="Electrolysis: Permanent Hair Removal">ELECTROLYSIS</a></li> <li><a href="hair-removal-appointments.php#pricing" title="Electrolysis Pricing">PRICING</a></li> 
<li><a href="skincare.php" title="Skin Care: Facials, Peels & Treatments">SKIN CARE</a></li>
<li><a href="eyelash_extensions.php" title="Skin Care: Facials, Peels & Treatments">EYELASH EXTENSIONS</a></li> 
<li><a href="electrolysis-gift.php" title="Electrolysis Gift Certificates">GIFT CARDS</a></li> 
<li><a href="electrolysis-testimonials.php" title="Electrolysis Testimonials">TESTIMONIALS</a></li>
<li><a href="press.php" title="Make an Electrolysis, skin care or massage appointments">PRESS</a></li> 
<li><a href="contact.php" title="Contact Us">CONTACT US</a></li>
<li><a href="ask_ronni.php" title="Contact Us">ASK RONNI</a></li>
 
</ul></div>
BOTTOM

Code: Select all

<div id="b" style="clear:both;">
<img src="http://www.ronnikolotkin.com/images/creditcards.jpg"  align="right"><div style="padding-top: 3px;">Copyright &copy; 2008 Ronni Kolotkin, Inc. <br/><a href="http://www.ifireflydesign.com">Web Design and Development</a> by iFirefly Design </div>       
</div>
 
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: PHP Title Question

Post by Eric! »

In a word: yes. top-noflash.php needs that info to set up your title and some crappy meta tags.

More firepower to you :mrgreen:
chloe.gray
Forum Newbie
Posts: 10
Joined: Fri Jun 19, 2009 3:08 pm

Re: PHP Title Question

Post by chloe.gray »

Is it possible to have it in the code but not have it displayed on the site? It seems weird to me that it HAS to be there; I've seen sites in PHP that don't have a title displayed at the top . . . but obviously I'm no PHP whiz.

And what makes the keywords "crappy"?
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: PHP Title Question

Post by Eric! »

I think that bit of code should be kept on that page because it is directly relevant to only that page. Since it is php, the users will never see it. You might be surprised to browse to your test link and the view the html source in your browser. It will look very different than the php file you are working on. The server will suck out your php code and replace it with whatever the php code prints. That's why php is so cool.

Your key words aren't crappy, but meta tags in general are. I don't think any search engines use them anymore because they are unreliable. Try googling seo and meta tags for info.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: PHP Title Question

Post by Eric! »

Oh by the way, back to your original question. The top-noflash.php file would be the place to change if you wanted to insert images, however I bet all of your client's pages call that file to show the banner for the page, so keep that in mind that changing top-noflash will affect all the pages that call it. You'll have to learn a bit of php to edit it properly too.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: PHP Title Question

Post by Eric! »

I'm on a real computer now so I thought I'd show you your html code after the PHP scripts on your server has run them. Does this look more like what you are used to seeing?

Code: Select all

<HTML>
<HEAD>
<TITLE>Eyelash Extensions: Ronni Kolotkin, Inc. </TITLE>
<script src="/mint/?js" type="text/javascript"></script>
<meta name="description" content="Skin Care treatments at the NYC office of Ronni Kolotkin, Inc. "/>
<meta name="keywords" content="esthetician in NYC, facial, massage, exfoliation, skin care treatment, back treatment, anti-aging facial, enzyme peel, collagen eye treatment, hand treatment" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<link rel="stylesheet" type="text/css" href="ronnik.css">
<link rel="Shortcut Icon" href="/favicon.ico"/>
</HEAD>
<BODY><table align="center"><tr><td>
<div id="t"><h1> Eyelash Extensions</h1>
Ronni Kolotkin, Inc. | (212) 366-6663 | 80 Fifth Avenue, Suite 1508 New York, New York 10011</div>
<div id="m">
<ul>
<li><a href="index.php" title="Ronni Kolotkin">HOME</a></li>
<li><a href="electrolysis.php" title="Electrolysis: Permanent Hair Removal">ELECTROLYSIS</a></li> <li><a href="hair-removal-appointments.php#pricing" title="Electrolysis Pricing">PRICING</a></li> 
<li><a href="skincare.php" title="Skin Care: Facials, Peels & Treatments">SKIN CARE</a></li>
<li><a href="eyelash_extensions.php" title="Skin Care: Facials, Peels & Treatments">EYELASH EXTENSIONS</a></li> 
<li><a href="electrolysis-gift.php" title="Electrolysis Gift Certificates">GIFT CARDS</a></li> 
<li><a href="electrolysis-testimonials.php" title="Electrolysis Testimonials">TESTIMONIALS</a></li>
<li><a href="press.php" title="Make an Electrolysis, skin care or massage appointments">PRESS</a></li> 
<li><a href="contact.php" title="Contact Us">CONTACT US</a></li>
<li><a href="ask_ronni.php" title="Contact Us">ASK RONNI</a></li>
 
</ul></div><br/>
<div id="c">
<div class="columnLeftEyelash"> 
<img class="headerImg" src="images/headers/eyelash_extensions.gif" alt="Ronni Kolotkin Eyelash Extensions" longdesc="images/headers/eyelash_extensions.gif" />
Eyelash extensions are a fast, easy way to significantly improve the look and youthfulness of your eyes and face.  After one treatment, you will have a complete set of beautiful, natural-looking, lush eyelashes that are indistinguishable from your own.<br />
<br />
<img class="paddingImg" src="images/brunette_lashes.jpg" height="546" width="390" alt="Ronni Kolotkin Eyelash Extension" longdesc="images/eyelash_girls.jpg" />
<h2>How Extensions Work</h2>
Lash extensions are hair-like fibers that are bonded, lash-by-lash, onto your own individual lashes, near the base.  This synthetic hair never touches skin or impedes the growth of the lash to which it is attached.  The adhesive is formaldehyde-free and safe for use near the eye.<br />
<br />
<h2>Semi-Permanent</h2>
The extensions we use are semi-permanent but with regular maintenance you?ll have your new set of lash extensions forever!  Each individual lash lasts about one to three months, depending on personal factors.  Once your initial appointment is over, you return to us for replenishment and spot-fixes.  Your aesthetician will advise you as to how best to care for your lashes to maximize their lifespan.   <br /><br />
</div> <!-- columnRightSkin -->
 
<div class="columnRightEyelash">
<h2 style="text-align:left;">We use only NovaLash? Lash Extensions and Adhesive</h2>
NovaLash ? is the only line of eyelash extension products featuring a USP (US Pharmaceutical Grade), formaldehyde-free, FDA and AEWCA approved adhesive.  And the eyelash remover is acetone-free.  No other line of products has received these approvals.<br /><br />
 
<h2>More to Know</h2>
 
Lash extensions need not be maintained permanently. They are perfect treats for important events: vacations, weddings, proms, photo sessions.  Any time you want some extra firepower.  
 
Our aestheticians can easily tailor your lash extensions to your own preferences.   We have both straight and curly extensions available and can make your lashes as subtle or as dramatic as you wish.   
 
You will be given thorough instructions from your aesthetician about how to care for and maintain your new lashes. You may safely wear them swimming.<br /><br />
 
 
<h2>The Cult of RKI Lashes!</h2>
 
We?ve already got some fanatical lash extensions clients, including our own staffers.  Here are some typical quotes:<br /><br />
 
?People stop me in the subway and ask me what mascara I use.?<br /><br />
 
?I wish I?d done this years ago.  I feel great.?<br /><br />
 
?My friends tell me how youthful I look these days.  They want to know what?s different?!?<br /><br />
 
?Just like with electrolysis, it?s so great to have something <em>taken care of</em>.?<br /><br />
 
<h2>Pricing</h2>
<table width="391" border="0" cellspacing="5" cellpadding="5" class="priceTable">
  <tr>
    <td>Initial Session:</td>
    <td align="right"><span class="price">$375</span></td>
  </tr>
  <tr>
    <td ><span class="price">Maintenance</span></td>
    <td></td>
  </tr>
  <tr>
    <td >2 weeks since last appointment:</td>
    <td align="right"><span class="price">$75-$100</span></td>
  </tr>
  <tr>
    <td >3 ? 4 weeks since last appointment:</td>
    <td align="right"><span class="price">$125</span></td>
  </tr>
   <tr>
    <td >4 - 5 weeks since last appointment:</td>
    <td align="right"><span class="price">$150</span></td>
  </tr>
    <tr>
    <td >5 - 6 weeks since last appointment:</td>
    <td align="right"><span class="price">$200</span></td>
  </tr>
    <tr>
    <td >5 - 6 weeks since last appointment:</td>
    <td align="right"><span class="price">$200</span></td>
  </tr>
   <td >safe eyelash removal:</td>
    <td align="right"><span class="price">$100</span></td>
  </tr>
    <tr>
    <td colspan="2" ><span class="price">*at 6+ weeks, you must schedule an Initial Session</span></td>
  </tr>  
</table><br /><br />
    
 
  </div><!-- secondColumnSkin --><br />
 
</div>
<div id="b">
<img src="http://www.ronnikolotkin.com/images/creditcards.jpg"  align="right"><div style="padding-top: 3px;">Copyright &copy; 2008 Ronni Kolotkin, Inc. <br/><a href="http://www.ifireflydesign.com">Web Design and Development</a> by iFirefly Design </div>       
</div>
</td></tr></table>
<!-- start google analytics -->
<script type="text/javascript"> 
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7720204-1");
pageTracker._trackPageview();
} catch(err) {}</script>
  <!-- end google analytics -->
</BODY>
</HTML>
Post Reply