Link to home
Start Free TrialLog in
Avatar of nanharbison
nanharbisonFlag for United States of America

asked on

Adding javascript to PHP, causing problems with single quotes

I am using some javascript that works perfectly well when added to a page of html, see code below labeled 1.
Then on another site I want to insert this into PHP, but PHP requires the backslash in front of a single quote and when you look at the page source you don't see it. But for the javascript, I need to have the backslash still showing, or else I get errors and the effect doesn't work.See the code below labeled 2.
How do I change this so it works? I have left off the code surrounding this mouseover, since that part is not the problem.
1.
 onmouseover="Tip('<img src=\'2010-10-14/020.jpg\' width=\'1000\' height=\'1333\'>')" onmouseout="UnTip()">

2.
onmouseover="Tip(\'<img src=\'images/emersonroom2_lg.jpg\';  width=\'600\' height=\'367\'>\')" onmouseout="UnTip()">

3. #2 looks like this when you view source:
onmouseover="Tip('<img src='images/emersonrm.jpg' width='600' height='728'>')" onmouseout="UnTip()">

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Justin Mathews
Justin Mathews

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nanharbison

ASKER

I tried that. I should have mentioned that I have tried all the tricks that I know!
Avatar of Justin Mathews
Justin Mathews

What about this:

onmouseover="Tip('<img src=\"2010-10-14/020.jpg\" width=\"1000\" height=\"1333\">')" onmouseout="UnTip()">
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I get PHP errors if I use double quotes, and the javascript won't work with no quotes.
Whoa!  I think I got it. I used the ASCII code for backslash:
&#092;

but I had to use it specifically BEFORE the real backslash
width=&#092;\'600&#092;\'

How ugly to read!
thanks for trying everyone, I assigned points anyway, for the effort.
This worked fine for me:

<?

echo "onmouseover=\"Tip('<img src=\\'2010-10-14/020.jpg\\' width=\\'1000\\' height=\\'1333\\'>')\" onmouseout=\"UnTip()\">";

?>

@jmatix:

The problem with that  is that I have a page full of php, which is collecting all the content in
$pagecontent = '
using single quotes, mixed in with database calls, etc so if I switched to double quotes the way you did, it messes up all the single and double quotes on hundreds of lines of php, which would take me hours to change! But thank you for letting me know.
Why would you use a variable in php for that?
Just stop the ?>
here you can have html and javascript - much easier to read!!!
It's a long story, I am using a template file and then including the page content using a php variable and then creating the page.
The code on the actual page looks like this code below, and the page content is on the page that has the content:
$guestroom_content

require_once ("classes/HTMLTemplate.class");
require_once ("news.php");
require_once ("navigation.php");
require_once ("guestroom-text.php");
include("news/config.php");
$page = new HtmlTemplate ("templates/main-template.php"); // Create an instance.

$page->SetParameter("PAGE_TITLE", "Concord Massachusetts Country Bed and Breakfast Inn"); 
$page->SetParameter("NAVIGATION_CONTENT", $navcontent);
$page->SetParameter("PAGE_CONTENT", $guestroom_content);
$page->SetParameter("NEWS_CONTENT", $newscontent);


$page->CreatePage(); // Send the page to the browser.
unset ($page);

Open in new window

yeees, and what does guestroom-text.php look like (obscure anything personal please)
This has all of the new stuff I have been adding all day, how tedious was that!

<?PHP 
$guestroom_content .= '<script type="text/javascript" src="wz_tooltip/wz_tooltip.js"></script><h1>Our Guestrooms</h1>
<div id="intro"><a href="inn-specials.php"><img class="photospace" align="right" src="images/specials-icon-sm2.jpg" alt="click here for inn specials" border="0"/></a>
The Hawthorne Inn offers the comfort of seven vibrant guestrooms that abound in a refreshing mix of original artworks, antique furnishings, poetry books and decorative items of interest. Guest accommodations offer Wireless Internet, DVD-CD player, iron, hair dryer, in season air-conditioning, bottled water, snacks, bathrobes and a private bath replete with abundant toiletries. Our overnight guests also enjoy a complimentary breakfast and a welcoming coffee / tea tray at check-in.</div>
 <h2>Lodging Rates vary with Demand by Season, Length of Stay and Number of Guests. Call for our latest Postings, Specials and Corporate Rates.</h2><br />
 <div id="emersonroom"><h2>Emerson Room / Four-Poster Queen Bed</h2>';
 $query = "SELECT * FROM room_prices WHERE room_name = 'Emerson'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		$guestroom_content .= '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
$guestroom_content .= '
<a href="images/emersonroom2_lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/emersonroom2_lg.jpg&#092;\'  width=&#092;\'600&#092;\' height=&#092;\'367&#092;\' border=&#092;\'0&#092;\'>\')" onmouseout="UnTip()"><img class="photospace"  align="left"  src="images/emerson-room2.jpg" alt="Emerson Room"  width="270" height="173" border="0"></a> Pull the overstuffed armchair close to the flickering flame of your private gas-log fireplace, peruse a copy of Emerson‘s Essays and let the evening drift by in warmth and reverie. From this ground-floor guestroom you can gaze through the bay window to witness the setting sun glorify an aged tree, planted by Bronson Alcott’s own hand, or study the intricate outline of Nathaniel Hawthorne’s home that stands directly across the roadway.<br /> 
<a href="images/emersonrm.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/emersonrm.jpg&#092;\' width=&#092;\'600&#092;\' height=&#092;\'728&#092;\'>\')" onmouseout="UnTip()"><img class="photospace"  align="right"  src="images/emersonrm_sm.jpg" alt="Emerson Room"  width="226" height="270" border="0"></a>

 
<br /><br />The Emerson room is appointed with a Pineapple Four-poster Queen bed, room-size Oriental rug, Eastlake loveseat and Asian and American antique side tables. The colorful striped wallpaper and balloon curtains convey the design sensibility of the 19th century and compliment the variety of artwork on display that include antique ukiyo-e prints by Hiroshige, Kunisada, Takeuchi and Hokusai, Indonesian bas-relief of birds and flowers and a decorative fireplace mantle, hand-carved by the Innkeeper. A doily, made by Margaret Sydney [author of Five Little Peppers], is displayed above the claw foot desk.  An ample bathroom with cherry-wood floor provides tub/shower and pedestal sink.</div>

<div id="sleepyhollowroom"><h2>Sleepy Hollow Room / Canopy Double Bed</h2>';
 $query = "SELECT * FROM room_prices WHERE room_name = 'Sleepy Hollow'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		$guestroom_content .= '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
$guestroom_content .= ' 

<a href="images/sleepyhollowroom-lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/sleepyhollowroom-lg.jpg&#092;\' width=&#092;\'600&#092;\' height=&#092;\'402&#092;\'>\')" onmouseout="UnTip()"><img class="photospace" align="right" src="images/sleepyhollowroom.jpg" alt="Sleepy Hollow Room" width="270" height="188" border="0"/></a>

A radiance brushes the skylight and bathes your west-facing guestroom in a natural glow, highlighting the peach tint of flowered wallpaper and formal green swag curtains, as you rest from a day’s activities and sink into the down-stuffed Henronden armchairs. 
 <br /><br />This cozy, ground-floor room is furnished with a [c.1820] Double Canopy bed made of tiger maple, Eastlake commode and a pair of Sheraton [c.1820-1830] bedside tables. You will be intrigued studying the artwork hung for your pleasure that include 19th century works by Toyokuni and Hiroshige, Indonesian wood carving and Balinese mask. Double windows look out over birdfeeders and quarter-acre field. Bathroom offers tub/shower and west-looking window.</div>

<div id="punkatassetroom"><h2>Punkatasset Room / Canopy Queen Bed</h2>';
 $query = "SELECT * FROM room_prices WHERE room_name = 'Punkatasset'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		$guestroom_content .= '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
$guestroom_content .= '
<a href="images/punkatasset-room2_lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/punkatasset-room2_lg.jpg&#092;\' width=&#092;\'600&#092;\' height=&#092;\'399&#092;\'>\')" onmouseout="UnTip()"><img class="photospace"  src="images/punkatasset-room2.jpg" width="300" height="206" border="0" align="left"  alt="Punkatasset Room" ></a>

Your eyes are pleased by the exciting contrast of subdued shadow and vibrant color. The play of sun through skylight washes the lace-draped iron and brass Canopy Queen bed, Italian glass lamps are lit from within and a marvelous red velvet Empire daybed calls you to lounge by the windows and smell the flowerbeds that lie beyond. 
<br /><br />
<a href="images/punkatasrm_lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/punkatasrm_lg.jpg&#092;\' width=&#092;\'600&#092;\' height=&#092;\'402&#092;\'>\')" onmouseout="UnTip()"><img class="photospace" align="right" src="images/punkatasrm_sm.jpg" alt="Punkatasset Room" width="270" height="188" border="0"/></a>


The stunning wallpaper of this ground-floor guestroom is the perfect backdrop to showcase fine furnishings. Here you will enjoy Empire and Sheraton [c.1830-1840] bedside tables, a museum quality [c.1740] George III handkerchief table, Empire side-chair, a rare [c.1870] Stevensograph from Hangchow, a framed example of the “Forbidden Stitch” and a lovely Ukiyo-e diptych, by Toyokuni, dated 1857. An intimate bathroom with walk-in shower shows a bold stroke of color and is hung with original artwork.</div>

<div id="musketaquidroom"><h2>Musketaquid Room / Canopy Queen Bed</h2>';
 $query = "SELECT * FROM room_prices WHERE room_name = 'Musketaquid'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		$guestroom_content .= '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
$guestroom_content .= '<div class = "guestrooms">
<a href="images/musketaquid-room2-lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/musketaquid-room2-lg.jpg&#092;\' width=&#092;\'600&#092;\' height=&#092;\'399&#092;\'>\')" onmouseout="UnTip()"><img class="photospace" src="images/musketaquid-room2.jpg" width="270" height="183" border="0" align="right" alt="Musketquid Room"></a>
Sunrise filters through a sieve of ancient maple boughs and breaches the bay window sill; a new morning embraces you. The flood of warmth charges the room with a glow of burnt umber, sienna and rust as walls and carpets and the burnished wood of antiques awaken. </div>
<a href="images/musketaquidroom-lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/musketaquidroom-lg.jpg&#092;\' width=&#092;\'500&#092;\' height=&#092;\'705&#092;\'>\')" onmouseout="UnTip()"><img class="photospace" src="images/musketaquidroom.jpg" alt="Musketquid Room" width="218" height="300" border="0" align="left"></a>
<br /><br /><br />The second-floor Musketaquid room offers respite upon a Reed-post Queen Canopy bed that is flanked by black and gold Chinese lacquer cabinets. Beside the Victorian [c.1860] marble-top, walnut table you will find a leather armchair for reflective moments studying the wall decorations: Balinese screen mirror, hand-stitched panel depicting koi and woodblock prints [c.1840] by Eisen and Kunisada. The drop-front paneled desk [c.1840] offers workspace and a leaded-glass window ushers light into the agreeably cozy bathroom with walk-in shower.  </div>

<div id="alcottroom"><h2>Alcott Room / Canopy Queen Bed</h2>';
 $query = "SELECT * FROM room_prices WHERE room_name = 'Alcott'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		$guestroom_content .= '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
$guestroom_content .= '

	<a href="images/alcottrm_lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/alcottrm_lg.jpg&#092;\' width=&#092;\'500&#092;\' height=&#092;\'724&#092;\'>\')" onmouseout="UnTip()"><img class="photospace"  align="left"  src="images/alcottrm_sm.jpg" alt="Alcott Room" width="193" height="270" border="0"></a>
	
	<br />Double entry doors add privacy to your airy corner retreat where you may find the Rice-post Canopy Queen bed as inviting as the sweeping view from the bay window. Take your ease upon the intricately in-laid fruitwood settee and give thanks for the treasures that you hold in your heart.<br /><br />
	
	<a href="images/alcott-room2-lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/alcott-room2-lg.jpg&#092;\' width=&#092;\'600&#092;\' height=&#092;\'399&#092;\'>\')" onmouseout="UnTip()"><img class="photospace"  align="right"  src="images/alcott-room2.jpg" alt="Alcott Room"  width="280" height="193" border="0"></a>


A Victorian butternut bureau [c.1850].  Rococo Revival slipper chair and an elaborate ball and spool table [c.1860] are reflected in the full-length mirror against a backdrop of delicately flowered wallpaper in this second floor guestroom. Look out your window and see the Alcott/ Hawthorne home or contemplate the objects d’art in the display cabinet. Your attention may be drawn by the varied framed art works that include an original brush painting by Kagetashi [c.1930], ukiyo-e print by Toyokuni I [c.1810], and 19th century bird prints from the USGA Survey. Tiled bathroom offers pedestal sink and tub/shower accented with a hand-made batik shower curtain. </div>

<div id="waldenroom"><h2>Walden Room / Canopy Queen Bed</h2>
';
 $query = "SELECT * FROM room_prices WHERE room_name = 'Walden'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		$guestroom_content .= '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
$guestroom_content .= '
Lace subdued windows open through flowering-vine impressed black wallpaper, Chinese-red walls create a counter point below the white painted chair-rail, and you relax in a pair of Renaissance Revival chairs sharing memories of your journey.
<a href="images/waldenrm-lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/waldenrm-lg.jpg&#092;\' width=&#092;\'600&#092;\' height=&#092;\'400&#092;\'>\')" onmouseout="UnTip()"><img class="photospace"  align="left"  src="images/waldenrm_sm.jpg" alt="Walden Room"  width="270" height="186" border="0"></a>
	
<br /><br />
A sense of security permeates this second floor guestroom enhanced by the solid forms of antique furnishings. Appointments include a Captain’s Davenport desk made of walnut [c.1870], English Georgian cock-bead chest  [c.1800], pair of Chinese hand-painted lacquer cabinets and 19th century ukiyo-e woodblock print by Kunisada. The color scheme continues in the L- shaped bathroom that features tub/shower, fir floor and Chinese grass paintings.</div>

<div id="concordroom"><h2>Concord Room / Four-Poster Queen Bed</h2>';
 $query = "SELECT * FROM room_prices WHERE room_name = 'Concord'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		$guestroom_content .= '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
		
$guestroom_content .= '<div class = "guestrooms">
<a href="images/concord-room-lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/concord-room-lg.jpg&#092;\' width=&#092;\'648&#092;\' height=&#092;\'432&#092;\'>\')" onmouseout="UnTip()"><img class="photospace"  align="right"  alt="Concord Room"  src="images/concordroom2_sm.jpg" alt="Concord Room"  width="270" height="187" border="0"></a>
Texture and color playfully commingle to amuse you in this Folk-art filled guestroom, where teal walls sprout hand-crafted decorations and grapevines entwine the carved posts of your Queen bed.</div>
<br /><br />
<a href="images/concordrm2_lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/concordrm2_lg.jpg&#092;\' width=&#092;\'600&#092;\' height=&#092;\'510&#092;\'>\')" onmouseout="UnTip()"><img class="photospace"  align="left"  alt="Concord Room"  src="images/concordrm_sm.jpg"  alt="Concord Room" width="270" height="233" border="0"></a>



A Swiss armoire [c.1860] painted with Nature’s inspiration, a Larkin desk holding an unfinished journal, the platform rocker from generations past, and the quiet of a moonlit night invites your repose. The second-floor Concord room offers a foldout bed, for an extra overnight guest, and provides a tiled  bathroom with walk-in shower </div>

<div id="concordroom"><h2>Breakfast Is Served</h2>

<a href="images/diningrm_lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/diningrm_lg.jpg&#092;\' width=&#092;\'600&#092;\' height=&#092;\'399&#092;\'>\')" onmouseout="UnTip()"><img class="photospace"  align="right"  alt="Concord Room"  src="images/diningrm_sm.jpg" alt="Dining Room"  width="220" height="153" border="0"></a>

The rich scent of the Inn’s own blend of organic coffee, fine teas brewing and warm muffins mingle in joyful greeting as you join the convivial common table for an ample breakfast. Find your place, set with hand-painted Dedham pottery, and enjoy the daily offering of succulent, seasonal fruit. You may choose to head straight for the popular Hawthorne Inn homemade granola, topped-off with a generous dollop of yogurt, before exploring the variety of wholesome fresh-baked goods, specialty jams and aged cheeses that offer themselves up to satisfy your desires. <br /><br />

<a href="images/dining-room-lg.jpg"  onmouseover="Tip(\'<img src=&#092;\'images/dining-room-lg.jpg&#092;\' width=&#092;\'600&#092;\' height=&#092;\'407&#092;\'>\')" onmouseout="UnTip()"><img class="photospace"  align="left"  alt="Concord Room"  src="images/diningroom_sm.jpg" alt="Dining Room"  width="295" height="206" border="0"></a>

Something to sate a variety of tastes is offered daily and may include Marilyn’s hot and nutty Fruit-Crisp topped with mascarpone, chilled Fresh-fruit Cup, Gregory’s Cold Cherry Soup or our Award Winning Hickory-Dickory-Bosc (poached pear with hickory syrup).  Homemade treats and the yield of niche bakeries contend for your attention, including wholesome Caraway-Rye, Pumpernickel, Harvest and Pepper Jack breads. Or richer items like: Currant or Cinnamon Scones, Coffee Cake laced with spices and nuts, hot Gingerbread or buttery Croissants.  Regional and imported cheeses, boiled eggs, yogurt and cereal round out the morning repast.  
<br /><br />
See our <a href="/InnkeeperJournal/category/hawthorne-inn-recipes/">Recipe section for the Inn’s Specialties.</a><br /><br />
</div>';
?>

Open in new window

This makes it REALLY easy to change the whole design without having to redo the content. My client has the ability to change the prices of the rooms, so I have to grab that from the DB, as you can see.
Try this then. I am not  php person so I cannot guarantee this is optimal, but this is what I found. You may need to fully qualify the include

<?PHP
require_once ("classes/HTMLTemplate.class");
require_once ("news.php");
require_once ("navigation.php");
ob_start(); # start buffer
include_once( 'guestroom-text.php' );
# we pass the output to a variable
$guestroom_content = ob_get_contents();
ob_end_clean(); # end buffer

include("news/config.php");
$page = new HtmlTemplate ("templates/main-template.php"); // Create an instance.

$page->SetParameter("PAGE_TITLE", "Concord Massachusetts Country Bed and Breakfast Inn");
$page->SetParameter("NAVIGATION_CONTENT", $navcontent);
$page->SetParameter("PAGE_CONTENT", $guestroom_content);
$page->SetParameter("NEWS_CONTENT", $newscontent);


$page->CreatePage(); // Send the page to the browser.
unset ($page);

and here is the new and easier to read guestroom file

<?PHP?> 
<script type="text/javascript" src="wz_tooltip/wz_tooltip.js"></script><h1>Our Guestrooms</h1>
<div id="intro"><a href="inn-specials.php"><img class="photospace" align="right" src="images/specials-icon-sm2.jpg" alt="click here for inn specials" border="0"/></a>
The Hawthorne Inn offers the comfort of seven vibrant guestrooms that abound in a refreshing mix of original artworks, antique furnishings, poetry books and decorative items of interest. Guest accommodations offer Wireless Internet, DVD-CD player, iron, hair dryer, in season air-conditioning, bottled water, snacks, bathrobes and a private bath replete with abundant toiletries. Our overnight guests also enjoy a complimentary breakfast and a welcoming coffee / tea tray at check-in.</div>
 <h2>Lodging Rates vary with Demand by Season, Length of Stay and Number of Guests. Call for our latest Postings, Specials and Corporate Rates.</h2><br />
 <div id="emersonroom"><h2>Emerson Room / Four-Poster Queen Bed</h2>
 <?PHP
 
 $query = "SELECT * FROM room_prices WHERE room_name = 'Emerson'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		echo '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
?>
<a href="images/emersonroom2_lg.jpg"  onmouseover="Tip('<img src='+this.href+'  width=600 height=367 border=0>')" onmouseout="UnTip()"><img class="photospace"  align="left"  src="images/emerson-room2.jpg" alt="Emerson Room"  width="270" height="173" border="0"></a> Pull the overstuffed armchair close to the flickering flame of your private gas-log fireplace, peruse a copy of Emerson‘s Essays and let the evening drift by in warmth and reverie. From this ground-floor guestroom you can gaze through the bay window to witness the setting sun glorify an aged tree, planted by Bronson Alcott’s own hand, or study the intricate outline of Nathaniel Hawthorne’s home that stands directly across the roadway.<br /> 
<a href="images/emersonrm.jpg"  onmouseover="Tip('<img src='+this.href+' width=600 height=728>')" onmouseout="UnTip()"><img class="photospace"  align="right"  src="images/emersonrm_sm.jpg" alt="Emerson Room"  width="226" height="270" border="0"></a>

 
<br /><br />The Emerson room is appointed with a Pineapple Four-poster Queen bed, room-size Oriental rug, Eastlake loveseat and Asian and American antique side tables. The colorful striped wallpaper and balloon curtains convey the design sensibility of the 19th century and compliment the variety of artwork on display that include antique ukiyo-e prints by Hiroshige, Kunisada, Takeuchi and Hokusai, Indonesian bas-relief of birds and flowers and a decorative fireplace mantle, hand-carved by the Innkeeper. A doily, made by Margaret Sydney [author of Five Little Peppers], is displayed above the claw foot desk.  An ample bathroom with cherry-wood floor provides tub/shower and pedestal sink.</div>

<div id="sleepyhollowroom"><h2>Sleepy Hollow Room / Canopy Double Bed</h2>
<?PHP
 $query = "SELECT * FROM room_prices WHERE room_name = 'Sleepy Hollow'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		echo '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
?> 

<a href="images/sleepyhollowroom-lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=600 height=402>')" onmouseout="UnTip()"><img class="photospace" align="right" src="images/sleepyhollowroom.jpg" alt="Sleepy Hollow Room" width="270" height="188" border="0"/></a>

A radiance brushes the skylight and bathes your west-facing guestroom in a natural glow, highlighting the peach tint of flowered wallpaper and formal green swag curtains, as you rest from a day’s activities and sink into the down-stuffed Henronden armchairs. 
 <br /><br />This cozy, ground-floor room is furnished with a [c.1820] Double Canopy bed made of tiger maple, Eastlake commode and a pair of Sheraton [c.1820-1830] bedside tables. You will be intrigued studying the artwork hung for your pleasure that include 19th century works by Toyokuni and Hiroshige, Indonesian wood carving and Balinese mask. Double windows look out over birdfeeders and quarter-acre field. Bathroom offers tub/shower and west-looking window.</div>

<div id="punkatassetroom"><h2>Punkatasset Room / Canopy Queen Bed</h2>';
<?PHP
 $query = "SELECT * FROM room_prices WHERE room_name = 'Punkatasset'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		echo '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
?>
<a href="images/punkatasset-room2_lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=600 height=399>')" onmouseout="UnTip()"><img class="photospace"  src="images/punkatasset-room2.jpg" width="300" height="206" border="0" align="left"  alt="Punkatasset Room" ></a>

Your eyes are pleased by the exciting contrast of subdued shadow and vibrant color. The play of sun through skylight washes the lace-draped iron and brass Canopy Queen bed, Italian glass lamps are lit from within and a marvelous red velvet Empire daybed calls you to lounge by the windows and smell the flowerbeds that lie beyond. 
<br /><br />
<a href="images/punkatasrm_lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=600 height=402>')" onmouseout="UnTip()"><img class="photospace" align="right" src="images/punkatasrm_sm.jpg" alt="Punkatasset Room" width="270" height="188" border="0"/></a>


The stunning wallpaper of this ground-floor guestroom is the perfect backdrop to showcase fine furnishings. Here you will enjoy Empire and Sheraton [c.1830-1840] bedside tables, a museum quality [c.1740] George III handkerchief table, Empire side-chair, a rare [c.1870] Stevensograph from Hangchow, a framed example of the “Forbidden Stitch” and a lovely Ukiyo-e diptych, by Toyokuni, dated 1857. An intimate bathroom with walk-in shower shows a bold stroke of color and is hung with original artwork.</div>

<div id="musketaquidroom"><h2>Musketaquid Room / Canopy Queen Bed</h2>
<?PHP
 $query = "SELECT * FROM room_prices WHERE room_name = 'Musketaquid'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		echo '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
?>
<div class = "guestrooms">
<a href="images/musketaquid-room2-lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=600 height=399>')" onmouseout="UnTip()"><img class="photospace" src="images/musketaquid-room2.jpg" width="270" height="183" border="0" align="right" alt="Musketquid Room"></a>
Sunrise filters through a sieve of ancient maple boughs and breaches the bay window sill; a new morning embraces you. The flood of warmth charges the room with a glow of burnt umber, sienna and rust as walls and carpets and the burnished wood of antiques awaken. </div>
<a href="images/musketaquidroom-lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=500 height=705>')" onmouseout="UnTip()"><img class="photospace" src="images/musketaquidroom.jpg" alt="Musketquid Room" width="218" height="300" border="0" align="left"></a>
<br /><br /><br />The second-floor Musketaquid room offers respite upon a Reed-post Queen Canopy bed that is flanked by black and gold Chinese lacquer cabinets. Beside the Victorian [c.1860] marble-top, walnut table you will find a leather armchair for reflective moments studying the wall decorations: Balinese screen mirror, hand-stitched panel depicting koi and woodblock prints [c.1840] by Eisen and Kunisada. The drop-front paneled desk [c.1840] offers workspace and a leaded-glass window ushers light into the agreeably cozy bathroom with walk-in shower.  </div>

<div id="alcottroom"><h2>Alcott Room / Canopy Queen Bed</h2>
<?PHP
 $query = "SELECT * FROM room_prices WHERE room_name = 'Alcott'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		echo '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
?>

	<a href="images/alcottrm_lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=500 height=724>')" onmouseout="UnTip()"><img class="photospace"  align="left"  src="images/alcottrm_sm.jpg" alt="Alcott Room" width="193" height="270" border="0"></a>
	
	<br />Double entry doors add privacy to your airy corner retreat where you may find the Rice-post Canopy Queen bed as inviting as the sweeping view from the bay window. Take your ease upon the intricately in-laid fruitwood settee and give thanks for the treasures that you hold in your heart.<br /><br />
	
	<a href="images/alcott-room2-lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=600 height=399>')" onmouseout="UnTip()"><img class="photospace"  align="right"  src="images/alcott-room2.jpg" alt="Alcott Room"  width="280" height="193" border="0"></a>


A Victorian butternut bureau [c.1850].  Rococo Revival slipper chair and an elaborate ball and spool table [c.1860] are reflected in the full-length mirror against a backdrop of delicately flowered wallpaper in this second floor guestroom. Look out your window and see the Alcott/ Hawthorne home or contemplate the objects d’art in the display cabinet. Your attention may be drawn by the varied framed art works that include an original brush painting by Kagetashi [c.1930], ukiyo-e print by Toyokuni I [c.1810], and 19th century bird prints from the USGA Survey. Tiled bathroom offers pedestal sink and tub/shower accented with a hand-made batik shower curtain. </div>

<div id="waldenroom"><h2>Walden Room / Canopy Queen Bed</h2>
<?PHP
 $query = "SELECT * FROM room_prices WHERE room_name = 'Walden'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		echo '<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
?>
Lace subdued windows open through flowering-vine impressed black wallpaper, Chinese-red walls create a counter point below the white painted chair-rail, and you relax in a pair of Renaissance Revival chairs sharing memories of your journey.
<a href="images/waldenrm-lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=600 height=400>')" onmouseout="UnTip()"><img class="photospace"  align="left"  src="images/waldenrm_sm.jpg" alt="Walden Room"  width="270" height="186" border="0"></a>
	
<br /><br />
A sense of security permeates this second floor guestroom enhanced by the solid forms of antique furnishings. Appointments include a Captain’s Davenport desk made of walnut [c.1870], English Georgian cock-bead chest  [c.1800], pair of Chinese hand-painted lacquer cabinets and 19th century ukiyo-e woodblock print by Kunisada. The color scheme continues in the L- shaped bathroom that features tub/shower, fir floor and Chinese grass paintings.</div>

<div id="concordroom"><h2>Concord Room / Four-Poster Queen Bed</h2>
<?PHP
 $query = "SELECT * FROM room_prices WHERE room_name = 'Concord'";
		//echo $query;
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$row['blurb'] = stripslashes($row['blurb']);				
		<div class="specials_price">$'.$row['low_price'].' - $'.$row['high_price'].' '.$row['blurb'].'</div><br />';
?>		
<div class = "guestrooms">
<a href="images/concord-room-lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=648 height=432>')" onmouseout="UnTip()"><img class="photospace"  align="right"  alt="Concord Room"  src="images/concordroom2_sm.jpg" alt="Concord Room"  width="270" height="187" border="0"></a>
Texture and color playfully commingle to amuse you in this Folk-art filled guestroom, where teal walls sprout hand-crafted decorations and grapevines entwine the carved posts of your Queen bed.</div>
<br /><br />
<a href="images/concordrm2_lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=600 height=510>')" onmouseout="UnTip()"><img class="photospace"  align="left"  alt="Concord Room"  src="images/concordrm_sm.jpg"  alt="Concord Room" width="270" height="233" border="0"></a>



A Swiss armoire [c.1860] painted with Nature’s inspiration, a Larkin desk holding an unfinished journal, the platform rocker from generations past, and the quiet of a moonlit night invites your repose. The second-floor Concord room offers a foldout bed, for an extra overnight guest, and provides a tiled  bathroom with walk-in shower </div>

<div id="concordroom"><h2>Breakfast Is Served</h2>

<a href="images/diningrm_lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=600 height=399>')" onmouseout="UnTip()"><img class="photospace"  align="right"  alt="Concord Room"  src="images/diningrm_sm.jpg" alt="Dining Room"  width="220" height="153" border="0"></a>

The rich scent of the Inn’s own blend of organic coffee, fine teas brewing and warm muffins mingle in joyful greeting as you join the convivial common table for an ample breakfast. Find your place, set with hand-painted Dedham pottery, and enjoy the daily offering of succulent, seasonal fruit. You may choose to head straight for the popular Hawthorne Inn homemade granola, topped-off with a generous dollop of yogurt, before exploring the variety of wholesome fresh-baked goods, specialty jams and aged cheeses that offer themselves up to satisfy your desires. <br /><br />

<a href="images/dining-room-lg.jpg"  onmouseover="Tip('<img src='+this.href+' width=600 height=407>')" onmouseout="UnTip()"><img class="photospace"  align="left"  alt="Concord Room"  src="images/diningroom_sm.jpg" alt="Dining Room"  width="295" height="206" border="0"></a>

Something to sate a variety of tastes is offered daily and may include Marilyn’s hot and nutty Fruit-Crisp topped with mascarpone, chilled Fresh-fruit Cup, Gregory’s Cold Cherry Soup or our Award Winning Hickory-Dickory-Bosc (poached pear with hickory syrup).  Homemade treats and the yield of niche bakeries contend for your attention, including wholesome Caraway-Rye, Pumpernickel, Harvest and Pepper Jack breads. Or richer items like: Currant or Cinnamon Scones, Coffee Cake laced with spices and nuts, hot Gingerbread or buttery Croissants.  Regional and imported cheeses, boiled eggs, yogurt and cereal round out the morning repast.  
<br /><br />
See our <a href="/InnkeeperJournal/category/hawthorne-inn-recipes/">Recipe section for the Inn’s Specialties.</a><br /><br />
</div>

Open in new window

WOW! Thank you for talking the time to write this all out for me!
Hmmm, this doesn't work, maybe this part is the part that doesn't work?

ob_start(); # start buffer
include_once( 'test-include.php' );
# we pass the output to a variable
$guestroom_content = ob_get_contents();
ob_end_clean(); # end buffer

But I don't know much about ob_buffer, I haven't ever used it.

You can see what it looks like here:
http://www.concordmass.com/test.php
Actually, I think I need to put the whole content area in a div to keep it in place in the center of the page, it is taking over the whole browser window right now. I think if I start with this kind of page to begin with it would work really well, and I will do that in the future!
Thanks again for your time!
you can ask a new question in the php zone to see how to get the page into a var
Thanks for the info and suggestion, but this site is up and running. I will use this technique for future sites!