PHP include not working in echo statement
07-02-06, 07:30 AM
Newbie Coder
Join Date: Jun 2006
Location: Boston
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
PHP include not working in echo statement
So, I had posted the other day, and got some great help. Now I'm stuck again.
I managed to get my if else statement working correctly. However, now, in my "include" statement, it won't work, when called from the "echo" statement, and I can't figure out why.
Here's my original code (which is sloppy, I know, I'm still learning)
PHP Code:
<?
$username = "XXXXXXXXXXXx" ;
$password = "XXXXXXXX" ;
$database = "XXXXXXXXXXXXX" ;
mysql_connect ( "XXXXXXXXXXXXXX" , $username , $password );
@ mysql_select_db ( $database ) or die( "Unable to select database" );
$query = "SELECT * FROM reviews WHERE movieid=' $movieid '" ;
$result = mysql_query ( $query );
$num = mysql_numrows ( $result );
mysql_close ();
echo "" ;
$i = 0 ;
//while ($i < $num) {
while ( $row = mysql_fetch_array ( $result )) {
$title = $row [ 'title' ];
$stars = $row [ 'stars' ];
$rating = $row [ 'rating' ];
$main_cast = $row [ 'main_cast' ];
$review = $row [ 'review' ];
$runtime = $row [ 'runtime' ];
$release_dvd = $row [ 'release_dvd' ];
$release_theater = $row [ 'release_theater' ];
$reviewed_by = $row [ 'reviewed_by' ];
$links = $row [ 'links' ];
$director = $row [ 'director' ];
$writer = $row [ 'writer' ];
$tags = $row [ 'tags' ];
$poster = $row [ 'poster' ];
$date_written = $row [ 'date_written' ];
$page_title = $row [ 'page_title' ];
$amazon = $row [ 'amazon' ];
$netflix = $row [ 'netflix' ];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><link rel="icon" href="http://www.moviesnobs.net/favicon.ico" type="image/bmp" />
<script language="JavaScript">
var arImages=new Array();
function Preload() {
var temp = Preload.arguments;
for(x=0; x < temp.length; x++) {
arImages[x]=new Image();
arImages[x].src=Preload.arguments[x];
}
}
</script>
<meta NAME="description" CONTENT="Movie Snobs ; Movies Reviews by people who love movies">
<meta NAME="keywords" CONTENT="<? echo $tags ; ?> ">
<meta name="revisit-after" content="4days">
<meta name="robots" content="index,follow">
<title>Movie Snobs ; <? echo $page_title ; ?> </title>
<script>
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
</script>
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
<script type="text/javascript" src="http://www.moviesnobs.net/mover_script.js"></script>
<link rel="stylesheet" href="http://www.moviesnobs.net/style1.css" type="text/css" media="screen">
<script>
function popupWindow(link, width, height) {
var trpopWin = window.open(link,"trpopWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable-0,width="+width+",height="+height);
}
</script></head>
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" onload="Preload('images/bg_bottmenu.gif','images/bg_conbott.gif','images/bg_footer.gif','images/bg_head.gif','images/bg_menu.gif','images/bg_sidepanel.gif','images/bmenu_01.gif','images/bmenu_02.gif','images/bmenu_03.gif','images/bmenu_04.gif','images/bmenu_08.gif','images/box_01.gif','images/box_02.gif','images/box_03.gif','images/box_04.gif','images/box_05.gif','images/box_06.gif','images/box_08.gif','images/box_09.gif','images/box_10.gif','images/box_11.gif','images/box_12.gif','images/box_14.gif','images/box_17.gif','images/bullet.gif','images/buttbs_back.gif','images/buttbs_back_sel.gif','images/buttbs_home.gif','images/buttbs_home_sel.gif','images/buttbs_top.gif','images/buttbs_top_sel.gif','images/dfs_03.gif','images/dfs_08.gif','images/dfs_12.gif','images/logo.gif','images/pg_02.gif','images/pg_04.gif','images/pg_05.gif','images/pg_06.gif','images/pg_08.gif','images/pg_09.gif','images/pg_11.gif','images/spacer.gif','images/sub2_bullet.gif','images/sub_bullet.gif','images/subnav_bullet.gif','images/sub_bullet_dvd.gif','images/tmenu_01.gif','images/tmenu_02.gif','images/tmenu_03.gif','images/tmenu_04.gif','images/tmenu_05.gif','images/tmenu_07.gif','images/tmenu_08.gif','images/tmenu_11.gif','images/tmenu_12.gif','images/tmenu_13.gif','images/tmenu_14.gif','images/tmenu_head.gif')"><a name="top">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="http://www.moviesnobs.net/images/bg_head.gif" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="291" height="124">
<table width="280" border="0" cellpadding="0" cellspacing="0"><tr>
<td><http://www.moviesnobs.net/images/spacer.gif" width="1" height="1"><img src="http://www.moviesnobs.net/images/tmenu_01.gif" width="26" height="36"></td>
<td><img src="http://www.moviesnobs.net/images/tmenu_02.gif" width="78" height="36"><img src="http://www.moviesnobs.net/images/tmenu_03.gif" width="88" height="36"><img src="http://www.moviesnobs.net/images/tmenu_04.gif" width="88" height="36"></td>
</tr><tr>
<td rowspan="3"><img src="http://www.moviesnobs.net/images/spacer.gif" width="1" height="1"><img src="http://www.moviesnobs.net/images/tmenu_05.gif" width="26" height="64"></td>
<td rowspan="3"><img src="http://www.moviesnobs.net/images/tmenu_head.gif" width="79" height="64"><img src="http://www.moviesnobs.net/images/tmenu_07.gif" width="88" height="64"><img src="http://www.moviesnobs.net/images/tmenu_08.gif" width="88" height="64"></td>
</tr><tr>
</tr><tr>
</tr><tr>
<td><img src="http://www.moviesnobs.net/images/spacer.gif" width="1" height="1"><img src="http://www.moviesnobs.net/images/tmenu_11.gif" width="26" height="24"></td>
<td><img src="http://www.moviesnobs.net/images/tmenu_12.gif" height="24"><img src="http://www.moviesnobs.net/images/tmenu_13.gif" width="88" height="24"><img src="http://www.moviesnobs.net/images/tmenu_14.gif" width="88" height="24"></td>
</tr>
</table>
</td>
<td width="716" height="124"><p align="right">
</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td background="http://www.moviesnobs.net/images/bg_menu.gif" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="http://www.moviesnobs.net/images/spacer.gif" width="1" height="1"><img src="http://www.moviesnobs.net/images/dfs_03.gif" width="215" height="36"></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr></table></td>
</tr>
<tr>
<td height="100%" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="http://www.moviesnobs.net/images/bg_sidepanel.gif" width="212" height="100%" align="center" valign="top">
<!-- Side Panel -->
<!-- News -->
<table width="198" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<!-- Begin Reviews Box Box-->
<table width="198" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="http://www.moviesnobs.net/images/box_01.gif" width="7" height="12"></td>
<td colspan="2"><img src="http://www.moviesnobs.net/images/box_02.gif" width="186" height="12"></td>
<td><img src="http://www.moviesnobs.net/images/box_03.gif" width="5" height="12"></td>
</tr>
<tr>
<td><img src="http://www.moviesnobs.net/images/box_04.gif" width="7" height="21"></td>
<td><img src="http://www.moviesnobs.net/images/box_05.gif" width="30" height="21"></td>
<td background="http://www.moviesnobs.net/images/box_06.gif" width="156" height="21" class="sub_title"> Review Info </td>
<td><img src="http://www.moviesnobs.net/images/box_08.gif" width="5" height="21"></td>
</tr>
<tr>
<td><img src="http://www.moviesnobs.net/images/box_09.gif" width="7" height="10"></td>
<td colspan="2"><img src="http://www.moviesnobs.net/images/box_10.gif" width="186" height="10"></td>
<td><img src="http://www.moviesnobs.net/images/box_11.gif" width="5" height="10"></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="http://www.moviesnobs.net/images/box_12.gif" width="7" height="100%"></td>
<td bgcolor="#FAFAFA" width="186" height="43" valign="top">
<? echo "" ; $i ++;} ?> <b>Movie Title:</b> <? echo $title ; ?> <br><b>Director:</b> <? echo $director ; ?> <br><b>Written by:</b> <? echo $writer ; ?> <br> <b>Main Cast:</b> <? echo $main_cast ; ?> <br><b>MPAA Rating:</b> <? echo $rating ; ?> <br><b>Runtime:</b> <? echo $runtime ?> <br> <b>Reviewed by: </b><? echo $reviewed_by ; ?> <br>
<B>Snob-Rating:</b><br><center><img src="http://www.moviesnobs.net/images/stars/<? echo $stars ; ?> .gif" alt="Rating"></center>
<hr width="100%" size="1" color="#B2B2B2" noshade><br><b>Release Date:</b> <? echo $release_theater ; ?> <br><b>DVD Release Date:</b> <? echo $release_dvd ; ?> <br><img src="http://www.moviesnobs.net/images/sub_bullet.gif" alt=""> <a href="http://www.netflix.com/AddToQueue?movieid=<? echo $netflix ; ?> " target="_blank" onmouseover="window.status='';return true" onmouseout="window.status='';return true" target="_blank" title="Add <? echo $title ; ?> To Your Netflix Queue">Netflix <? echo $title ; ?> </a><Br><img src="http://www.moviesnobs.net/images/sub_bullet.gif" alt=""> <a href=" <? echo $amazon ; ?> " title="Buy <? echo $title ; ?> at Amazon.com" target="_blank" onmouseover="window.status='';return true" onmouseout="window.status='';return true">Buy <? echo $title ; ?> at Amazon</a><img src="http://www.assoc-amazon.com/e/ir?t=moviesnobs-20&l=ur2&o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br>
</td>
<td><img src="http://www.moviesnobs.net/images/box_14.gif" width="5" height="100%"></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="http://www.moviesnobs.net/images/box_17.gif" width="198" height="8"></td>
</tr>
</table>
<!-- End Reviews Box Box --><? include( "boxes/boxes.php" ) ?>
<p> </p></td>
<td width="785" height="339" valign="top">
<table height="100%" border="0" cellpadding="6" cellspacing="0" width="768"><tr>
<p> <br> <!-- Begin Body Here -->
<center><span class="castlarge"><? echo " $title " ; ?> </span><br>
Review written on <? echo " $date_written " ; ?> <br><br><img src="http://www.moviesnobs.net/images/content/email_send.gif" alt=""> <a href="refer_a_review.php" onmouseover="window.status='';return true" onmouseout="window.status='';return true" target="_blank" title="Send this review to a friend!">E-mail this review to a friend</a> <img src="http://www.moviesnobs.net/images/content/printer.gif" alt=""> <a href="print_view.php?movieid=<? echo " $movieid " ; ?> " target="_blank" title="Printable Version">Printable View</a></center><Br>
<blockquote><blockquote><img src="http://www.moviesnobs.net/images/posters/<? echo " $poster " ; ?> " border="2" align="right" hspace="15" vspace="5" alt="<? echo $page_title ; ?> "><? echo " $review " ; ?> <p><B>See more reviews for the main cast of <? echo " $title " ; ?> </b>: <? echo $main_cast ; ?> </blockquote></blockquote>
<!--End Body -->
</td></tr></table>
</td>
</tr>
</table>
<tr>
<td background="http://www.moviesnobs.net/images/bg_conbott.gif" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="28"><img src="http://www.moviesnobs.net/images/bmenu_01.gif" width="28" height="37"></td>
<td width="24"><img src="http://www.moviesnobs.net/images/bmenu_02.gif" width="24" height="37"></td>
<td width="22"><img src="http://www.moviesnobs.net/images/bmenu_03.gif" width="22" height="37"></td>
<td width="66"><img src="http://www.moviesnobs.net/images/bmenu_04.gif" width="66" height="37"></td>
<td width="75"><img src="http://www.moviesnobs.net/images/dfs_12.gif" width="75" height="37"></td>
<td width="788" height="37"></td>
</tr>
</table></td>
</tr>
<tr>
<td background="http://www.moviesnobs.net/images/bg_bottmenu.gif" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a href="http://www.moviesnobs.net/index.php" onmouseover="on8();" onmouseout="off8();"><img src="http://www.moviesnobs.net/images/buttbs_home.gif" width="28" height="24" border="0" name="h" onmouseover="window.status='Home Page';return true" onmouseout="window.status='';return true"></a></td>
<td><a href="javascript :history.back(1)" onmouseover="on9();" onmouseout="off9();"><img src="http://www.moviesnobs.net/images/buttbs_back.gif" width="24" height="24" border="0" name="i" onmouseover="window.status='Back A Page';return true" onmouseout="window.status='';return true"></a></td>
<td><a href="#top" onmouseover="on10();" onmouseout="off10();"><img src="http://www.moviesnobs.net/images/buttbs_top.gif" width="22" height="24" border="0" name="j" onmouseover="window.status='Top Of Page';return true" onmouseout="window.status='';return true"></a></td>
<td><img src="http://www.moviesnobs.net/images/bmenu_08.gif" width="66" height="24" border="0"></td>
</tr>
</tr>
</table></td>
</tr>
<tr>
<td background="http://www.moviesnobs.net/images/bg_footer.gif" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="http://www.moviesnobs.net/images/spacer.gif" width="770" height="40"></td>
</tr>
</table></td>
</tr>
</table>
<? include( "footer.php" ) ?>
</body>
</html>
</span></center><br><br>
My php includes work fine in this context. However, here's the code I'm trying to change to (to handle errors better), and the php includes don't work in my echo statement. Any ideas why?
PHP Code:
<?
$username = "XXXXXXXXX" ;
$password = "XXXXXXXXX" ;
$database = "XXXXXXXXXXXXX" ;
mysql_connect ( "XXXXXXXXXX" , $username , $password );
@ mysql_select_db ( $database ) or die( "Unable to select database" );
$query = "SELECT * FROM reviews WHERE movieid=' $movieid '" ;
$result = mysql_query ( $query ) or die( 'Query failed: ' . mysql_error ());
$num = mysql_numrows ( $result );
mysql_close ();
echo "" ;
//while ($i < $num) {
while ( $row = mysql_fetch_array ( $result )){
$tags = $row [ 'tags' ];
$stars = $row [ 'stars' ];
$rating = $row [ 'rating' ];
$main_cast = $row [ 'main_cast' ];
$review = $row [ 'review' ];
$runtime = $row [ 'runtime' ];
$release_dvd = $row [ 'release_dvd' ];
$release_theater = $row [ 'release_theater' ];
$reviewed_by = $row [ 'reviewed_by' ];
$links = $row [ 'links' ];
$director = $row [ 'director' ];
$writer = $row [ 'writer' ];
$tags = $row [ 'tags' ];
$poster = $row [ 'poster' ];
$date_written = $row [ 'date_written' ];
$page_title = $row [ 'page_title' ];
$amazon = $row [ 'amazon' ];
$netflix = $row [ 'netflix' ];
$title = $row [ 'title' ];
}
?>
<?
if( mysql_num_rows ( $result ) === 0 )
{
echo "No Movie Review Found" ; // echo message that there is no movie that matched the request
}
else {
echo "<meta NAME=\"description\" CONTENT=\"Movie Snobs Movies Reviews by people who love movies\">
<meta NAME=\"keywords\" CONTENT=\" $tags \">
<meta name=\"revisit-after\" content=\"4days\">
<meta name=\"robots\" content=\"index,follow\">
<title>Movie Snobs - $page_title </title>
<script>
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = \"\"
}
</script>
<script type=\"text/javascript\" src=\"http://www.moviesnobs.net/mover_script.js\"></script>
<link rel=\"stylesheet\" href=\"http://www.moviesnobs.net/style1.css\" type=\"text/css\" media=\"screen\">
<script>
function popupWindow(link, width, height) {
var trpopWin =
window.open(link,\"trpopWin\",\"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable-0,width=\"+width+\",height=\"+height);
}
</script></head>
<body marginwidth=\"0\" marginheight=\"0\" leftmargin=\"0\" topmargin=\"0\"
onload=\"Preload('images/bg_bottmenu.gif','images/bg_conbott.gif','images/bg_footer.gif','images/bg_head.gif','images/bg_menu.gif','images/bg_sidepanel.gif',
'images/bmenu_01.gif','images/bmenu_02.gif','images/bmenu_03.gif','images/bmenu_04.gif','images/bmenu_08.gif','images/box_01.gif','images/box_02.gif','images
/box_03.gif','images/box_04.gif','images/box_05.gif','images/box_06.gif','images/box_08.gif','images/box_09.gif','images/box_10.gif','images/box_11.gif','ima
ges/box_12.gif','images/box_14.gif','images/box_17.gif','images/bullet.gif','images/buttbs_back.gif','images/buttbs_back_sel.gif','images/buttbs_home.gif','i
mages/buttbs_home_sel.gif','images/buttbs_top.gif','images/buttbs_top_sel.gif','images/dfs_03.gif','images/dfs_08.gif','images/dfs_12.gif','images/logo.gif',
'images/pg_02.gif','images/pg_04.gif','images/pg_05.gif','images/pg_06.gif','images/pg_08.gif','images/pg_09.gif','images/pg_11.gif','images/spacer.gif','ima
ges/sub2_bullet.gif','images/sub_bullet.gif','images/subnav_bullet.gif','images/sub_bullet_dvd.gif','images/tmenu_01.gif','images/tmenu_02.gif','images/tmenu
_03.gif','images/tmenu_04.gif','images/tmenu_05.gif','images/tmenu_07.gif','images/tmenu_08.gif','images/tmenu_11.gif','images/tmenu_12.gif','images/tmenu_13
.gif','images/tmenu_14.gif','images/tmenu_head.gif')\"><a name=\"top\">
<table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td background=\"http://www.moviesnobs.net/images/bg_head.gif\" valign=\"top\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"291\" height=\"124\">
<table width=\"280\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>
<td><img src=\"http://www.moviesnobs.net/images/spacer.gif\" width=\"1\" height=\"1\"><img src=\"http://www.moviesnobs.net/images/tmenu_01.gif\" width=\"26\"
height=\"36\"></td>
<td><img src=\"http://www.moviesnobs.net/images/tmenu_02.gif\" width=\"78\" height=\"36\"><img src=\"http://www.moviesnobs.net/images/tmenu_03.gif\"
width=\"88\" height=\"36\"><img src=\"http://www.moviesnobs.net/images/tmenu_04.gif\" width=\"88\" height=\"36\"></td>
</tr><tr>
<td rowspan=\"3\"><img src=\"http://www.moviesnobs.net/images/spacer.gif\" width=\"1\" height=\"1\"><img
src=\"http://www.moviesnobs.net/images/tmenu_05.gif\" width=\"26\" height=\"64\"></td>
<td rowspan=\"3\"><img src=\"http://www.moviesnobs.net/images/tmenu_head.gif\" width=\"79\" height=\"64\"><img
src=\"http://www.moviesnobs.net/images/tmenu_07.gif\" width=\"88\" height=\"64\"><img src=\"http://www.moviesnobs.net/images/tmenu_08.gif\" width=\"88\"
height=\"64\"></td>
</tr><tr>
</tr><tr>
</tr><tr>
<td><img src=\"http://www.moviesnobs.net/images/spacer.gif\" width=\"1\" height=\"1\"><img src=\"http://www.moviesnobs.net/images/tmenu_11.gif\" width=\"26\"
height=\"24\"></td>
<td><img src=\"http://www.moviesnobs.net/images/tmenu_12.gif\" height=\"24\"><img src=\"http://www.moviesnobs.net/images/tmenu_13.gif\" width=\"88\"
height=\"24\"><img src=\"http://www.moviesnobs.net/images/tmenu_14.gif\" width=\"88\" height=\"24\"></td>
</tr>
</table>
</td>
<td width=\"716\" height=\"124\"><p align=\"right\"><script type=\"text/javascript\"><!--
google_ad_client = \"pub-6708600750793239\";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = \"468x60_as\";
google_ad_type = \"text\";
google_ad_channel =\"\";
google_color_border = \"CA5B00\";
google_color_link = \"CA5B00\";
google_color_bg = \"EEEEEE\";
google_color_text = \"000000\";
google_color_url = \"CA5B00\";
//--></script>
<script type=\"text/javascript\"
src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script>
</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td background=\"http://www.moviesnobs.net/images/bg_menu.gif\" valign=\"top\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td><img src=\"http://www.moviesnobs.net/images/spacer.gif\" width=\"1\" height=\"1\"><img src=\"http://www.moviesnobs.net/images/dfs_03.gif\" width=\"215\"
height=\"36\"></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr></table></td>
</tr>
<tr>
<td height=\"100%\" valign=\"top\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td background=\"http://www.moviesnobs.net/images/bg_sidepanel.gif\" width=\"212\" height=\"100%\" align=\"center\" valign=\"top\">
<!-- Side Panel -->
<!-- News -->
<table width=\"198\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td>
<!-- Begin Reviews Box Box-->
<table width=\"198\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td><img src=\"http://www.moviesnobs.net/images/box_01.gif\" width=\"7\" height=\"12\"></td>
<td colspan=\"2\"><img src=\"http://www.moviesnobs.net/images/box_02.gif\" width=\"186\" height=\"12\"></td>
<td><img src=\"http://www.moviesnobs.net/images/box_03.gif\" width=\"5\" height=\"12\"></td>
</tr>
<tr>
<td><img src=\"http://www.moviesnobs.net/images/box_04.gif\" width=\"7\" height=\"21\"></td>
<td><img src=\"http://www.moviesnobs.net/images/box_05.gif\" width=\"30\" height=\"21\"></td>
<td background=\"http://www.moviesnobs.net/images/box_06.gif\" width=\"156\" height=\"21\" class=\"sub_title\"> Review Info </td>
<td><img src=\"http://www.moviesnobs.net/images/box_08.gif\" width=\"5\" height=\"21\"></td>
</tr>
<tr>
<td><img src=\"http://www.moviesnobs.net/images/box_09.gif\" width=\"7\" height=\"10\"></td>
<td colspan=\"2\"><img src=\"http://www.moviesnobs.net/images/box_10.gif\" width=\"186\" height=\"10\"></td>
<td><img src=\"http://www.moviesnobs.net/images/box_11.gif\" width=\"5\" height=\"10\"></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td><img src=\"http://www.moviesnobs.net/images/box_12.gif\" width=\"7\" height=\"100%\"></td>
<td bgcolor=\"#FAFAFA\" width=\"186\" height=\"43\" valign=\"top\">
<b>Movie Title:</b> $title <br><b>Director:</b> $director <br><b>Written by:</b> $writer <br> <b>Main Cast:</b> $main_cast <br><b>MPAA Rating:</b>
$rating <br><b>Runtime:</b> $runtime <br> <b>Reviewed by: </b> $reviewed_by <br>
<B>Snob-Rating:</b><br><center><img src=\"http://www.moviesnobs.net/images/stars/ $stars .gif\" alt=\"Rating\"></center>
<hr width=\"100%\" size=\"1\" color=\"#B2B2B2\" noshade><br><b>Release Date:</b> $release_theater <br><b>DVD Release Date:</b> $release_dvd <br><img
src=\"http://www.moviesnobs.net/images/sub_bullet.gif\" alt=\"\"> <a href=\"http://www.netflix.com/AddToQueue?movieid= $netflix \" target=\"_blank\"
onmouseover=\"window.status='';return true\" onmouseout=\"window.status='';return true\" target=\"_blank\" title=\"Add $title To Your Netflix Queue\">Netflix
$title </a><Br><img src=\"http://www.moviesnobs.net/images/sub_bullet.gif\" alt=\"\"> <a href=\" $amazon \" title=\"Buy $title at Amazon.com\" target=\"_blank\"
onmouseover=\"window.status='';return true\" onmouseout=\"window.status='';return true\">Buy $title at Amazon</a><img
src=\"http://www.assoc-amazon.com/e/ir?t=moviesnobs-20&l=ur2&o=1\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important;
margin:0px !important;\" /><br>
</td>
<td><img src=\"http://www.moviesnobs.net/images/box_14.gif\" width=\"5\" height=\"100%\"></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src=\"http://www.moviesnobs.net/images/box_17.gif\" width=\"198\" height=\"8\"></td>
</tr>
</table>
<!-- End Reviews Box Box --><? include('boxes/boxes.php') ?>
<p> </p></td>
<td width=\"785\" height=\"339\" valign=\"top\">
<table height=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\" width=\"768\"><tr>
<p> <br> <!-- Begin Body Here -->
<center><span class=\"castlarge\"> $title </span><br>
Review written on $date_written <br><br><img src=\"http://www.moviesnobs.net/images/content/email_send.gif\" alt=\"\"> <a href=\"refer_a_review.php\"
onmouseover=\"window.status='';return true\" onmouseout=\"window.status='';return true\" target=\"_blank\" title=\"Send this review to a friend!\">E-mail
this review to a friend</a> <img src=\"http://www.moviesnobs.net/images/content/printer.gif\" alt=\"\"> <a href=\"print_view.php?movieid= $movieid \"
target=\"_blank\" title=\"Printable Version\">Printable View</a></center><Br>
<blockquote><blockquote><img src=\"http://www.moviesnobs.net/images/posters/ $poster \" border=\"2\" align=\"right\" hspace=\"15\" vspace=\"5\"
alt=\" $page_title \"> $review <p><B>See more reviews for the main cast of $title </b>: $main_cast </blockquote></blockquote>
<!--End Body -->
</td></tr></table>
</td>
</tr>
</table>
<tr>
<td background=\"http://www.moviesnobs.net/images/bg_conbott.gif\" valign=\"top\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"28\"><img src=\"http://www.moviesnobs.net/images/bmenu_01.gif\" width=\"28\" height=\"37\"></td>
<td width=\"24\"><img src=\"http://www.moviesnobs.net/images/bmenu_02.gif\" width=\"24\" height=\"37\"></td>
<td width=\"22\"><img src=\"http://www.moviesnobs.net/images/bmenu_03.gif\" width=\"22\" height=\"37\"></td>
<td width=\"66\"><img src=\"http://www.moviesnobs.net/images/bmenu_04.gif\" width=\"66\" height=\"37\"></td>
<td width=\"75\"><img src=\"http://www.moviesnobs.net/images/dfs_12.gif\" width=\"75\" height=\"37\"></td>
<td width=\"788\" height=\"37\"></td>
</tr>
</table></td>
</tr>
<tr>
<td background=\"http://www.moviesnobs.net/images/bg_bottmenu.gif\" valign=\"top\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td><a href=\"http://www.moviesnobs.net/index.php\" onmouseover=\"on8();\" onmouseout=\"off8();\"><img
src=\"http://www.moviesnobs.net/images/buttbs_home.gif\" width=\"28\" height=\"24\" border=\"0\" name=\"h\" onmouseover=\"window.status='Home Page';return
true\" onmouseout=\"window.status='';return true\"></a></td>
<td><a href=\"javascript :history.back(1)\" onmouseover=\"on9();\" onmouseout=\"off9();\"><img src=\"http://www.moviesnobs.net/images/buttbs_back.gif\"
width=\"24\" height=\"24\" border=\"0\" name=\"i\" onmouseover=\"window.status='Back A Page';return true\" onmouseout=\"window.status='';return
true\"></a></td>
<td><a href=\"#top\" onmouseover=\"on10();\" onmouseout=\"off10();\"><img src=\"http://www.moviesnobs.net/images/buttbs_top.gif\" width=\"22\" height=\"24\"
border=\"0\" name=\"j\" onmouseover=\"window.status='Top Of Page';return true\" onmouseout=\"window.status='';return true\"></a></td>
<td><img src=\"http://www.moviesnobs.net/images/bmenu_08.gif\" width=\"66\" height=\"24\" border=\"0\"></td>
</tr>
</tr>
</table></td>
</tr>
<tr>
<td background=\"http://www.moviesnobs.net/images/bg_footer.gif\" valign=\"top\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td><img src=\"http://www.moviesnobs.net/images/spacer.gif\" width=\"770\" height=\"40\"></td>
</tr>
</table></td>
</tr>
</table>
<? include(\"footer.php\") ?>
</body>
</html>" ;
// put your existing code here to display the results
}
echo "" ;
?>
The two includes (boxes/boxes.php) and (footer.php) don't work in the second "new" version of the code. But work flawlessly in the original. Any ideas?
07-02-06, 07:45 AM
Community Leader
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
You have to break the string.
Plus, if you use single quotes to echo a string, you won't have to escape the double quotes.
Plus plus, you won't have to escape anything if you break the <?php tags.
EDIT
And you can simplify this:
To this
http://us2.php.net/manual/en/function.extract.php
Last edited by nico_swd; 07-02-06 at 07:49 AM .
07-02-06, 07:55 AM
Newbie Coder
Join Date: Jun 2006
Location: Boston
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Dude, you're my hero.
Thanks for the help. I knew there was something simple I was missing.
And for the tip on using single quotes. Escaping all the quotes was starting to bug the hell outta me.
Appreciate the help.
07-02-06, 07:59 AM
Community Leader
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
You have to keep i mind that variables won't be parsed between single quotes.
You have to break the string
07-02-06, 08:13 AM
Newbie Coder
Join Date: Jun 2006
Location: Boston
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks. That part I had learned from when I set up the search engine (for echoing the results page)
Looks like I'm on my way to a long day of recoding pages. But well worth it.
Thanks again for your help.
04-02-07, 09:52 PM
Newbie Coder
Join Date: Apr 2007
Location: Local Disk C:
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
here is a shortcut.
Instead of <? echo $page_title; ?> you can try
<?= $page_title; ?>
04-03-07, 05:02 AM
Community Liaison
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
Quote:
Originally Posted by
_net
here is a shortcut.
Instead of <? echo $page_title; ?> you can try
<?= $page_title; ?>
that will only work if short_open_tags is set to On
__________________
"Good judgement comes from experience, and experience comes from bad judgement." -
Fred Brooks
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off