Jump to content

[SOLVED] Trying to include


jaxdevil

Recommended Posts

I have a file for each 'model' that gets pulled in my page with the the name of modelnumber.php (where modelnumber is the actual model number), I am trying to include that file in my pages, but instead it just breaks the page (the html of the page stops where the include is used. What am I doing wrong?

 

<?php
include "/specs/".$row[mod].".php";
?>

Link to comment
Share on other sites

I actually just tried taking out the $row element, I used the direct page variable since the page variable and the model number and the $row['mod'] are the same. So now it is just as it is below, so its no longer using the sql query.

 

<?php
include "/specs/".$restaurant_equipment.".php";
?>

Link to comment
Share on other sites

A leading / in a file system path refers to the root of the current drive, which I doubt is where your specs folder is located.

 

I recommend forming an absolute file system path using $_SERVER['DOCUMENT_ROOT'] so that include() statements can find the path/file no matter what the path is or where the file is that is including another file.

 

Edit: Also turn on full php error reporting to get php to help you find any errors that are occurring. Add the following two lines after your first opening <?php tag -

 

ini_set ("display_errors", "1");
error_reporting(E_ALL);

Link to comment
Share on other sites

<?php
require('/home/global/public_html/speed_racer/php_speedy.php');
?>
<?php
$db_host = "localhost";
$db_user = "xxx_xxx";
$db_pwd = "xxxxxxx";
$db_name = "xxx_xxx";
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name) or die(mysql_error()); 
$query = "SELECT * FROM `products` WHERE `mod` = '$restaurant_equipment' LIMIT 1";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
$man = $row['man'];
?>
<?php
$unformated_price = $row['price'];
$price = number_format($unformated_price, 2, '.', ',');
?>
<html>
<head>
<title><?=$row['man'];?> <?=$restaurant_equipment?> at Global Restaurant Equipment and Supplies, Inc.</title>

<script language="JavaScript" type="text/JavaScript" src="/livehelp/include/javascript.php"></script>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
a         { color: blue; text-decoration: none; }
</style>
<script language="javascript" type="text/javascript">
//<![CDATA[
var cot_loc0=(window.location.protocol == "https:")? "https://secure.comodo.net/trustlogo/javascript/cot.js" :
"http://www.trustlogo.com/trustlogo/javascript/cot.js";
document.writeln('<scr' + 'ipt language="JavaScript" src="'+cot_loc0+'" type="text\/javascript">' + '<\/scr' + 'ipt>');
//]]>
</script>	<link rel="stylesheet" href="/css/slide-out-menu-new.css" media="screen" type="text/css"></link>
<script type="text/javascript" src="/js/slide-out-menu-new.js"></script>
<script type="text/javascript" src="/clickcall/globalswap.js"></script>
<style type="text/css">
li a {display:inline-block;}
li a {display:block;}
li {zoom: 1}
li {align: left;}
</style>
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<div id="floatLayer" align="left" style="position:absolute; left:10px; top:10px; visibility:hidden; z-index:5000;"><map name="LiveHelpInitiateChatMap" id="LiveHelpInitiateChatMap"><area shape="rect" coords="50,210,212,223" href="http://livehelp.stardevelop.com" target="_blank" alt="stardevelop.com Live Help"/><area shape="rect" coords="113,183,197,206" href="#" onclick="openLiveHelp();acceptInitiateChat();return false;" alt="Accept"/><area shape="rect" coords="206,183,285,206" href="#" onclick="declineInitiateChat();return false;" alt="Decline"/>
<area shape="rect" coords="263,86,301,104" href="#" onclick="declineInitiateChat();return false;" alt="Close"/></map>
<div id="InitiateText" align="center" style="position:relative; left:30px; top:145px; width:275px; height:35px; z-index:5001; text-align:center; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold;">Do you have any questions that I can help you with?</div><img src="/livehelp/locale/en/images/InitateChat.gif" alt="stardevelop.com Live Help" width="323" height="229" border="0" usemap="#LiveHelpInitiateChatMap"/></div>

<center>
<table id="Table_01" width="800" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td colspan="3">
		<img src="images/used-restaurant-equipment.gif" width="800" height="136" alt="Used Restaurant Equipment" usemap="#Used-Restaurant-Equipment" border="0"></td>
</tr>
<tr>
	<td background="images/stretchy-back.gif" valign="top">
<table cellpadding="0" cellspacing="0" border="0">
<tr background="/images/free-live-help.gif" height="30" width="201">
<td width="201">
</td>
</tr>
<tr background="/images/side-box-back.gif" width="201">
<td width="201">
<div style="padding-left: 50px; padding-top: 20px; pading-bottom: 0px;">
<a href="http://www.ringcentral.com" target="Callback_RingMe" onclick='var wind = window; var winop = wind.open; winop("http://www.ringcentral.com/ringme/?uc=56594644,0,&s=no&v=2", "Callback_RingMe", "resizable=no,width=380,height=240"); return false;'><img src="/clickcall/clicktocall_bttn.gif" alt="click to call" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image13','','/clickcall/clicktocall_bttn_over.gif',1)" id="Image13" border="0" height="59" width="59"></a>
<a href="#" target="_blank" onclick="openLiveHelp(); return false"><img src="/clickcall/clicktochat_bttn.gif" alt="click to chat" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image18','','/clickcall/clicktochat_bttn_over.gif',1)" id="Image18" border="0" height="59" width="59"></a>
</div>
</td>
</tr>
<tr background="/images/side-box-bottom.gif" height="25" width="201">
<td width="201">
</td>
</tr>
</table><br>
<div id="leftContainer"><div id="dhtmlgoodies_menu"><img src="/images/side_menu_top.gif" border="0"><ul><?php
mysql_connect('localhost','xxx_xxx','xxxxxxx');
mysql_select_db('xxx_xxx') or die(mysql_error());
$sql_make = "SELECT DISTINCT `cat` FROM products  ORDER BY `cat` ASC";
$query_make = mysql_query($sql_make);
while($row = mysql_fetch_array($query_make)){
?><li><font face="Tahoma,Arial,Verdana" size="2"><a href="categories.php?action=Subcats&subcats=<?=$row['cat']?>" style="padding-left:50px;"><?
$string = $row['cat'];
$replacement = ' ';
$pattern = '/_/';
echo preg_replace($pattern, $replacement, $string);
$cat = $row['cat'];
?></a></font><ul><?php
$sql2_make2 = "SELECT DISTINCT `subcat` FROM products WHERE `cat` = '$cat' ORDER BY `subcat` ASC";
$query2_make2 = mysql_query($sql2_make2);
while($row2 = mysql_fetch_array($query2_make2)){
?><li><font face="Tahoma,Arial,Verdana" size="2"><a href="restaurant.php?equipment=<?=$row2['subcat']?>"><?
$string2 = $row2['subcat'];
$replacement2 = ' ';
$pattern2 = '/_/';
echo preg_replace($pattern2, $replacement2, $string2);
?></a></font></li><?
}
?></ul><? } ?><li><font face="Tahoma,Arial,Verdana" size="2"><a href="/used.refurbished.restaurant.equipment.php" style="padding-left:50px;">Used Equipment</a></font></li><li><font face="Tahoma,Arial,Verdana" size="2"><a href="/restaurant.equipment.search.php" style="padding-left:50px;">Search Equipment</a></font></li>
<img src="/images/side_menu_bottom.gif" border="0">
<br><img src="/images/contact_side_box.gif" alt="Contact Restaurant Equipment" usemap="#contact_side_box" border="0">
	</div>
</ul>
</div>	
<script type="text/javascript">
document.getElementById('dhtmlgoodies_menu').style.visibility='hidden';	// Because the ads make it a little slow
</script>
</td>
	<td bgcolor="#FFFFFF" width="572" valign="top">
<table cellpadding="0" cellspacing="0" border="0" align="left">
<tr align="left">
<td align="left">
<font face="Tahoma,Arial,Verdana" size="2" STYLE="text-decoration; underline; "><a href="/">Home</a></font> | <?php
mysql_connect('localhost','xxx_xxx','xxxxxxx');
mysql_select_db('xxx_xxx') or die(mysql_error());
$sql_make = "SELECT DISTINCT `cat` FROM products WHERE `mod`='$restaurant_equipment' ORDER BY `cat` ASC";
$query_make = mysql_query($sql_make);
while($row = mysql_fetch_array($query_make)){
?><font face="Tahoma,Arial,Verdana" size="2" STYLE="text-decoration; underline; "><a href="categories.php?action=Subcats&subcats=<?=$row['cat']?>"><?
$string = $row['cat'];
$replacement = ' ';
$pattern = '/_/';
echo preg_replace($pattern, $replacement, $string);
}
?></a></font> | <?php
mysql_connect('localhost','xxx_xxx','xxxxxxx');
mysql_select_db('xxx_xxx') or die(mysql_error());
$sql_make = "SELECT DISTINCT `subcat` FROM products WHERE `mod`='$restaurant_equipment' ORDER BY `cat` ASC";
$query_make = mysql_query($sql_make);
while($row = mysql_fetch_array($query_make)){
?><font face="Tahoma,Arial,Verdana" size="2" STYLE="text-decoration; underline; "><a href="categories.php?action=Subcats&subcats=<?=$row['subcat']?>"><?
$string = $row['subcat'];
$replacement = ' ';
$pattern = '/_/';
echo preg_replace($pattern, $replacement, $string);
}
?></a></font> | <?php
mysql_connect('localhost','xxx_xxx','xxxxxxx');
mysql_select_db('xxx_xxx') or die(mysql_error());
$sql_make = "SELECT DISTINCT `man` FROM products WHERE `mod`='$restaurant_equipment' ORDER BY `cat` ASC";
$query_make = mysql_query($sql_make);
while($row = mysql_fetch_array($query_make)){
?><font face="Tahoma,Arial,Verdana" size="2" STYLE="text-decoration; underline; "><a href="restaurant.equipment.search.results.php?searchstring=<?=$row['man']?>"><?
$string = $row['man'];
$replacement = ' ';
$pattern = '/_/';
echo preg_replace($pattern, $replacement, $string);
}
?></a></font> | <font face="Tahoma,Arial,Verdana" size="2" STYLE="text-decoration; underline; "><a href="product.php?restaurant_equipment=<?=$restaurant_equipment?>"><?
$string = $restaurant_equipment;
$replacement = ' ';
$pattern = '/_/';
echo preg_replace($pattern, $replacement, $string);
?></a>
</font>
</td>
</tr>
</table>
<br>
<div style="padding-left: 3px;">
<font face=Tahoma style="font-size: 0.70em;">
<div style="padding-left: 3px; padding-right: 3px; padding-top: 5px; padding-bottom: 5px;">


<table width="380" cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td width="380" valign="top">
<table width="380" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="380">
<font style="font:bold 1.6em Arial, Helvetica, sans-serif; color:#94200d;">
<?=$row['mod'];?> <?=$row['name']?></font><br>
<font style="font:bold 1.1em Arial, Helvetica, sans-serif; color:#0b7ecc;">
Manufactured by <?=$row['man']?></font><br>
<font style="font:bold 1.1em Arial, Helvetica, sans-serif; color:#fb0909;">THIS ITEM INCLUDES WARRANTY</font><br>
<font style="font:bold 1.1em Arial, Helvetica, sans-serif; color:#000000;">SPECIAL INTERNET ONLY PRICING</font>
</td>
</tr>
<tr>
<td height="3">
</td>
</tr>
<tr>
<td width="380" background="/images/pdpricing.gif" style="background-repeat: no-repeat;" valign="middle" height="28">
<table width="380" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="100" align="left" valign="middle">
<img src="/images/blank.gif" width="10" height="1"><font style="font:bold 1.25em Arial, Helvetica, sans-serif; color:#1b3975;">


<script language="JavaScript1.2">

/*
Neon Lights Text
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

var message="$<?=$price?>"
var neonbasecolor="black"
var neontextcolor="red"
var flashspeed=100  //in milliseconds

///No need to edit below this line/////

var n=0
if (document.all||document.getElementById){
document.write('<font color="'+neonbasecolor+'">')
for (m=0;m<message.length;m++)
document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
document.write('</font>')
}
else
document.write(message)

function crossref(number){
var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
return crossobj
}

function neon(){

//Change all letters to base color
if (n==0){
for (m=0;m<message.length;m++)
//eval("document.all.neonlight"+m).style.color=neonbasecolor
crossref(m).style.color=neonbasecolor
}

//cycle through and change individual letters to neon color
crossref(n).style.color=neontextcolor

if (n<message.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",1500)
return
}
}

function beginneon(){
if (document.all||document.getElementById)
flashing=setInterval("neon()",flashspeed)
}
beginneon()
</script>
</font>
</td>
<td width="198" align="right" valign="middle">
<font style="font:bold 0.70em Arial, Helvetica, sans-serif; color:#1b3975;"><a href="#restaurant-equipment-spec-sheet">See comparision rates below</a></font><img src="/images/blank.gif" width="30" height="1">
<?php
mysql_connect('localhost','xxx_xxx','xxxxxxx');
mysql_select_db('xxx_xxx') or die(mysql_error());
$sql_make = "SELECT `price` FROM products WHERE `mod`='$restaurant_equipment'";
$query_make = mysql_query($sql_make);
while($row = mysql_fetch_array($query_make)){
$raw_price = $row['price'];
}
?>
</td>
</tr>
<tr>
<td colspan="2">
<br>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<div class="pad5tb"><iframe src='http://globalrestaurantequip.com/eBay_Sniper_API.php?QueryKeywords=<?=$restaurant_equipment?>&PriceMin=<?=$raw_price?>' width='380' height='66' frameborder='0' scrolling='no' border='0'></iframe></div>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<div class="pad5tb"><iframe src='http://globalrestaurantequip.com/Yahoo_Shop_API.php?QueryKeys=<?=$restaurant_equipment?>&MinPrice=<?=$raw_price?>' width='380' height='66' frameborder='0' scrolling='no' border='0'></iframe></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div style="padding-left: 2px; padding-right: 2px; padding-top: 5px;">
<font style="font:0.75em Arial, Helvetica, sans-serif; color:#000000;">
<?php
$query = "SELECT `details` FROM `manufacturers` WHERE `name` = '$man' LIMIT 1";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
echo  $row['details'];
}
?>
<?php
$query = "SELECT * FROM `products` WHERE `mod` = '$restaurant_equipment' LIMIT 1";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
?>
</font><br><br>
<font style="font:bold 1.1em Arial, Helvetica, sans-serif; color:#94200d;"><a name="restaurant-equipment-spec-sheet">Product Specifications</a></font><br><br>
<font style="font:0.75em Arial, Helvetica, sans-serif; color:#000000;"><?=$row['specs']; } ?></font>
<br><br>
<table>
<?php include ("http://globalrestaurantequip.com/specs/".$restaurant_equipment.".php"); ?>
</table
<?php
$query = "SELECT * FROM `products` WHERE `mod` = '$restaurant_equipment' LIMIT 1";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
?>
</div>
</td>
</tr>
<tr>
<td>
	<div style="padding-top: 25px;">
	<a href="mailto:?&subject=Check this out&body=I found this item and thought you would be interested.%0D%0Ahttp://www.globalrestaurantequip.com/product.php?restaurant_equipment=<?=$restaurant_equipment?>"><img src="images/tellafriend.gif" border="0"></a>
	</div>
	</td>
</tr>
<tr>
	<td width="174">
	<div style="display: inline;">
	<form method="post" action="https://globalrestaurantequip.com/shipping.php" style="display: inline;">
	  <input name="Title" type="hidden" value="<?=$row['name']?>">
	  <input name="SerialNum" type="hidden" value="<?=$row['mod']?>">
	  <input name="Price" type="hidden" value="<?=$row['price']?>">
	  <input name="Shipping1" type="hidden" value="0.00>
	  <input name="Shipping2" type="hidden" value="0.00">
	  <input name="cmd" type="hidden" id="cmd" value="1">
      <input type="image" src="images/addtocart.gif" name="submit">
	</form>
</div>
</td>
</tr>
<tr valign="top">
<td valign="top">
	<div style="display: inline;">
	<a href="mailto:&#115;&#101;&#108;&#108;&#064;&#103;&#108;&#111;&#098;&#097;&#108;&#114;&#101;&#115;&#116;&#097;&#117;&#114;&#097;&#110;&#116;&#101;&#113;&#117;&#105;&#112;&#046;&#099;&#111;&#109;?&subject=Website Inquiry"><img src="images/getmoreinfo.gif" border="0" style="display: inline;"></a>
	</div>
	</td>
</tr>
</table>
</td>
<td width="174" align="center" valign="top">
<table width="174" cellpadding="0" cellspacing="0" border="0">
<tr>
	<td height="10" width="174">
	</td>
</tr>
<tr>
<td>
<a href="javascript: void(0)" 
   onclick="window.open('/lpgua.gif', 
  'windowname3', 
  'width=525, height=725'); 
   return false;"><img src="/lowpriceguarantee.gif" border="0"></a>
</td>
</tr>
<tr>
	<td width="174">
		<table cellpadding="0" cellspacing="0" border="0" width="174">
		<tr valign="top" background="/images/mainimageerror.gif">
		<td width="174" height="225" background="/productimages/<?=$restaurant_equipment?>_tn.jpg" style="background-repeat: no-repeat;">
		<a href="/productimages/<?=$restaurant_equipment?>.jpg"><img src="/productimages/overlay.png" border="0" width="174"></a>
		</td>
		</tr>
	</td>
</tr>
<tr>
	<td height="3" width="174">
	</td>
</tr>


<?php
if ($row['pdf']=='yes')
{
?>
<tr>
	<td width="174">
	<div style="padding-left:2px;">
	<font style="font:bold 1em Arial, Helvetica, sans-serif; color:#8a8a8a;">PRODUCT DOCUMENTS:</font>
		<a href="/productdocs/<?=$row['mod']?>.pdf"><img src="/images/docs.gif" border="0" width="174"></a>
	</div>
	</td>
</tr>
<?php
}
?>

<?php
if ($row['pdf']=='Yes')
{
?>
<tr>
	<td width="174">
	<div style="padding-left:2px;">
	<font style="font:bold 1em Arial, Helvetica, sans-serif; color:#8a8a8a;">PRODUCT DOCUMENTS:</font>
		<a href="/productdocs/<?=$row['mod']?>.pdf"><img src="/images/docs.gif" border="0" width="174"></a>
	</div>
	</td>
</tr>
<?php
}
?>

<tr>
	<td width="174">
	<div style="padding-left:2px;">
	<img src="/images/orderhelper1.gif" border="0" usemap="#orderhelper" width="174"><br>
	<form name"form2" method="post" action="https://globalrestaurantequip.com/shipping.php" style="display: inline;">
	  <input name="Title" type="hidden" value="<?=$row['name']?>" />
	  <input name="SerialNum" type="hidden" value="<?=$row['mod']?>" />
	  <input name="Price" type="hidden" value="<?=$row['price']?>" />
	  <input name="Shipping1" type="hidden" value="0.00" />
	  <input name="Shipping2" type="hidden" value="0.00" />
	  <input name="cmd" type="hidden" id="cmd" value="1" />
      <input type="image" src="images/orderhelper2.gif" name="submit">
	</form>
	</div>
	</td>
</tr>
</table>
</td>
</tr>
<tr align="center">
<td align="center">
<a href="javascript: void(0)" 
   onclick="window.open('/sgua.gif', 
  'windowname4', 
  'width=525, height=725'); 
   return false;"><img src="/satisfaction.gif" border="0"></a>
</td>
</tr>
<tr align="center">
<td align="center">

<a href="javascript: void(0)" 
   onclick="window.open('https://secure.comodo.com/ttb_searcher/trustlogo?v_querytype=W&v_shortname=SC2&v_search=globalrestaurantequip.com&x=6&y=5', 
  'windowname1', 
  'width=550, height=700'); 
   return false;"><img src="/SSLSeal5.gif" border="0"></a>
</td>
</tr>
</table>

</td>
</tr>
</table>



</div>
</font>
</div>
<br>
	</td>
	<td background="images/used-restaurant-equipment-side.gif" width="27" height="643">
</td>
</tr>
<tr>
	<td colspan="3">
		<img src="images/related-restaurant-equipment.gif" width="800" height="34" alt="Featured Used Restaurant Equipment"></td>
</tr>
<tr>
	<td colspan="3" background="images/featured-restaurant-equipment-back.gif" width="800" align="center" valign="top">
<div style="padding-left: 6px;">
<center>
<?php
// Select total results for pagination
$result = mysql_query("SELECT count(*) FROM products WHERE `specs` LIKE '%$restaurant_equipment%' OR `man` LIKE '%$restaurant_equipment%' OR `mod` LIKE '%$restaurant_equipment%' OR `name` LIKE '%$restaurant_equipment%'") or die(mysql_error());
$num_records = mysql_result($result,0,0);

// Set maximum number of rows and columns
$max_num_rows = 1;
$max_num_columns = 4;
$per_page = $max_num_columns * $max_num_rows;

// Work out how many pages there are
$total_pages = ceil($num_records / $per_page);

// Get the current page number
if (isset($_GET['page'])) $page = $_GET['page']; else $page = 1;

// Work out the limit offset
$start = ($page - 1) * $per_page;

// Select the results we want including limit and offset
$result = mysql_query("SELECT `mod` FROM products WHERE `specs` LIKE '%$restaurant_equipment%' OR `man` LIKE '%$restaurant_equipment%' OR `mod` LIKE '%$restaurant_equipment%' OR `name` LIKE '%$restaurant_equipment%' ORDER BY `mod` LIMIT $start, $per_page") or die(mysql_error());
$named = mysql_query("SELECT `name` FROM products WHERE `specs` LIKE '%$restaurant_equipment%' OR `man` LIKE '%$restaurant_equipment%' OR `mod` LIKE '%$restaurant_equipment%' OR `name` LIKE '%$restaurant_equipment%' ORDER BY `mod` LIMIT $start, $per_page") or die(mysql_error());
$maker = mysql_query("SELECT `man` FROM products WHERE `specs` LIKE '%$restaurant_equipment%' OR `man` LIKE '%$restaurant_equipment%' OR `mod` LIKE '%$restaurant_equipment%' OR `name` LIKE '%$restaurant_equipment%' ORDER BY `mod` LIMIT $start, $per_page") or die(mysql_error());
$cost = mysql_query("SELECT `price` FROM products WHERE `specs` LIKE '%$restaurant_equipment%' OR `man` LIKE '%$restaurant_equipment%' OR `mod` LIKE '%$restaurant_equipment%' OR `name` LIKE '%$restaurant_equipment%' ORDER BY `mod` LIMIT $start, $per_page") or die(mysql_error());
$num_columns = ceil(mysql_num_rows($result)/$max_num_rows);
$num_rows = ceil(mysql_num_rows($result)/$num_columns);
// Echo the results
?>
<br>
<?
echo "<center><table width=\"700\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">\n";
for ($r = 0; $r < $max_num_rows; $r++){
echo "<tr>\n";
for ($c = 0; $c < $max_num_columns; $c++){ // 1
	$x = $r * $max_num_columns + $c;
	if ($x < mysql_num_rows($result)){
//                   $y = mysql_result($result, $x, 0); // Commented out so I could show your example
                     $num = mysql_result($result, $x, 0);
				$name = mysql_result($named, $x, 0);
				$make = mysql_result($maker, $x, 0);
				$price = mysql_result($cost, $x, 0);
$unformated_price = $price;
$price = number_format($unformated_price, 2, '.', ',');
                   $y = <<<HTML
<table cellpadding="0" cellspacing="0" border="0" width="174">
<tr valign="top" background="/images/mainimageerror.gif">
<td width="174" height="225" background="/productimages/{$num}_tn.jpg">
<a href="/productimages/{$num}.jpg"><img src="/productimages/overlay.png" border="0"></a>
</td>
</tr>
<tr valign="top">
<td height="40">
<font face="Tahoma" color="#2b86c5" style="font-size:0.75em"><b>
{$name}
</font></b>
</td>
</tr>
<tr>
<td height="10">
<font face="Tahoma" color="#000000" style="font-size:0.60em"><b>
{$make}
</font></b>
</td>
</tr>
<tr>
<td height="10">
<font face="Tahoma" color="#000000" style="font-size:0.60em"><b>
Model # {$num}
</font></b>
</td>
</tr>
<tr>
<td height="10">
<font face="Tahoma" color="#94200d" style="font-size:0.70em"><b>
$ {$price}
</font></b>
</td>
</tr>
<tr>
<td>
<a href="/product.php?restaurant_equipment={$num}"><img src="images/details.gif" border="0"></a>
</td>
<td>
<img src="/images/spacer.gif" width="8">
</td>
</tr>
<tr>
<td>
<br style="line-height:3px;">
	<form method="post" action="shipping.php" style="display: inline;">
	  <input name="Title" type="hidden" value="{$name}" />
	  <input name="SerialNum" type="hidden" value="{$num}" />
	  <input name="Price" type="hidden" value="{$unformated_price}" />
	  <input name="Shipping1" type="hidden" value="0.00" />
	  <input name="Shipping2" type="hidden" value="0.00" />
	  <input name="cmd" type="hidden" id="cmd" value="1" />
      <input type="image" src="images/addtocart.gif" name="submit">
	</form>
</div>
</td>
<td>
<img src="/images/spacer.gif" width="8">
</td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" height="10">
</td>
</tr>
</table>
HTML;

                }
                else {
                   $y = '<table align="center" border="0" cellpadding="0" cellspacing="0" width="145">
      <tr>
        <td width="16" align="center"><center></center></td>
      </tr>
    </table>';
                }
	echo "<td>";
                echo "$y";
                echo "</td>";
}
echo "</tr>\n";
}

// Echo page numbers
echo "</table></center>\n";
?>
</center>
</div>
</td>
</tr>
<tr>
	<td colspan="3">
<a name="ship"><img src="images/used-restaurant-equipment-shipping.gif" width="800" height="45" alt="Shipping Used Restaurant Equipment"></a></td>
</tr>
<tr>
	<td colspan="3" background="images/used-restaurant-equipment-shipping-back.gif" width="800" align="center" valign="top"> 
<center>
<table width="720" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top">
<center>
<font face=Tahoma size=2>
Buyer to pay all shipping costs. All merchandise is shipped FOB Miami, Florida 33168. Global Restaurant Equipment & Supply, Inc. will do their best to ship within the 24 hours of receipt of a completed order. If a completed order is being shipped directly from a manufacturer, lead times may vary based on their shipping policies. If Global Restaurant Equipment & Supplies, Inc. becomes aware of a delay in your order, we will notify you via email. We do not accept responsibility for any equipment after it leaves our warehouse. Please check the equipment(s) when you receive them and note any concealed damage on the bill of landing, so that it will ease your claim with the freight carrier if needed. Inside delivery and lift gate services are available at a premium, customer must request this service if needed. P.O. Box will not suffice as a valid shipping address. Additional handling and freight charges may be apply to each order. We use the most cost efficient means of freight, normally freightquote.com handles our shipments. You can also arrange shipping using your own carrier or you can pick your item(s) up from our factory warehouse. Our location has loading docks for efficient loading for you or your carrier.
</font>
<br><br>
</center>
</td>
</tr>
</table>
</center>
</td>
</tr>
<tr>
	<td colspan="3">
<a name="location"><img src="images/used-restaurant-equipment-location.gif" width="800" height="47" alt="Used Restaurant Equipment Location"></a></td>
</tr>
<tr>
	<td colspan="3" background="images/used-restaurant-equipment_10.gif" width="800" align="center" valign="top">
<center>
<table width="720" border="0" cellpadding="0" cellspacing="0">
<td width="400" valign="top" align="center">
<div style="padding-right: 4px;">
<font face=Tahoma size=2>
<b>Click the map below for driving directions</b>
<br>
<a href="http://maps.google.com/maps?q=650+NW+123rd+St,+Miami,+FL+33168,+USA&sa=X&oi=map&ct=title" target="_blank"><img src="/images/mapdata.gif" border="0"></a>
<br><br>
<b>650 NW 123rd Street, Miami, FL 33168</b>
<br>
Our 1 full city block factory warehouse is conveniently located right off of Interstate 95 in Miami, Florida. Take I-95 from anywhere, exit at NW 125th Street in Miami, go west and make the first left onto NW 7th Avenue. 2 blocks down you will reach 123rd Street, make another left and you will be entering the Global Restaurant Equipment and Supplies factory warehouse. Click the map above for visual and/or printable driving directions.
</font>
</div>
</td>
<td align="center">
<a href="images/location.jpg"><img src="images/location_tn.jpg" border="0"></a>
<br><br>
<a href="images/location.jpg"><img src="images/view.gif" border="0" alt="View Image"></a><br>
<a href="images/location_hr.jpg"><img src="images/viewhr.gif" border="0" alt="View High Resolution Image"></a>
<br><br>
</td>
</tr>
</table>
<table width="720">
<tr>
<td width=220" align="center">
<a href="images/showroom1.jpg"><img src="images/showroom1_tn.jpg" border="0"></a>
<br><br>
<a href="images/showroom1.jpg"><img src="images/view.gif" border="0" alt="View Image"></a><br>
<a href="images/showroom1_hr.jpg"><img src="images/viewhr.gif" border="0" alt="View High Resolution Image"></a>
</td>
<td width="30">
</td>
<td width=220" align="center">
<a href="images/showroom2.jpg"><img src="images/showroom2_tn.jpg" border="0"></a>
<br><br>
<a href="images/showroom2.jpg"><img src="images/view.gif" border="0" alt="View Image"></a><br>
<a href="images/showroom2_hr.jpg"><img src="images/viewhr.gif" border="0" alt="View High Resolution Image"></a>
</td>
<td width="30">
</td>
<td width=220" align="center">
<a href="images/showroom3.jpg"><img src="images/showroom3_tn.jpg" border="0"></a>
<br><br>
<a href="images/showroom3.jpg"><img src="images/view.gif" border="0" alt="View Image"></a><br>
<a href="images/showroom3_hr.jpg"><img src="images/viewhr.gif" border="0" alt="View High Resolution Image"></a>
</td>
</tr>
</table>
</center>
</td>
</tr>
<tr>
	<td colspan="3">
		<img src="images/used-restaurant-equipment-line.gif" width="800" height="23" alt="Used Restaurant Equipment Line"></td>
</tr>
<tr>
	<td colspan="3" background="images/used-restaurant-equipment-stock.gif" width="800" height="29">
<div style="padding-left: 35px;">
<font face="Tahoma,Verdana,Arial" size="2">	
&copy 2005-2008 Global Restaurant Equipment and Supplies, Inc.
</font>
</div>
</td>
</tr>
</center>
<MAP NAME="Used-Restaurant-Equipment">
<AREA SHAPE=RECT COORDS="572,101,742,132" HREF="restaurant.equipment.search.php">

<AREA SHAPE=CIRCLE COORDS="718,49,45" href="javascript: void(0)" 
   onclick="window.open('https://secure.comodo.com/ttb_searcher/trustlogo?v_querytype=W&v_shortname=SC2&v_search=globalrestaurantequip.com&x=6&y=5', 
  'windowname1', 
  'width=550, height=700'); 
   return false;">
<AREA SHAPE=CIRCLE COORDS="599,47,43" href="javascript: void(0)" 
   onclick="window.open('/lpgua.gif', 
  'windowname2', 
  'width=525, height=725'); 
   return false;">
<AREA SHAPE=RECT COORDS="42,110,81,126" HREF="/">
<AREA SHAPE=RECT COORDS="99,112,190,124" HREF="http://stores.ebay.com/Global-Restaurant-Equipment">
<AREA SHAPE=RECT COORDS="212,112,262,124" HREF="/products.php">
<AREA SHAPE=RECT COORDS="291,111,360,124" HREF="mailto:&#115;&#101;&#108;&#108;&#064;&#103;&#108;&#111;&#098;&#097;&#108;&#114;&#101;&#115;&#116;&#097;&#117;&#114;&#097;&#110;&#116;&#101;&#113;&#117;&#105;&#112;&#046;&#099;&#111;&#109;?Subject=Website Inquiry">
<AREA SHAPE=RECT COORDS="386,110,464,123" HREF="#location">
</MAP>
<MAP NAME="contact_side_box">
<AREA SHAPE=RECT COORDS="33,259,194,268" HREF="mailto:&#115;&#101;&#108;&#108;&#064;&#103;&#108;&#111;&#098;&#097;&#108;&#114;&#101;&#115;&#116;&#097;&#117;&#114;&#097;&#110;&#116;&#101;&#113;&#117;&#105;&#112;&#046;&#099;&#111;&#109;">
</MAP>
<MAP NAME="orderhelper">
<AREA SHAPE=RECT COORDS="16,47,164,59" HREF="mailto:&#115;&#101;&#108;&#108;&#064;&#103;&#108;&#111;&#098;&#097;&#108;&#114;&#101;&#115;&#116;&#097;&#117;&#114;&#097;&#110;&#116;&#101;&#113;&#117;&#105;&#112;&#046;&#099;&#111;&#109;?&subject=Website Inquiry">
<AREA SHAPE=RECT COORDS="67,61,158,74" HREF="#ship">
<AREA SHAPE=RECT COORDS="67,75,159,88" HREF="#ship">
</MAP>
<MAP NAME="Used-Restaurant-Equipment">
<AREA SHAPE=RECT COORDS="572,101,742,132" HREF="restaurant.equipment.search.php">

<AREA SHAPE=CIRCLE COORDS="718,49,45" href="javascript: void(0)" 
   onclick="window.open('https://secure.comodo.com/ttb_searcher/trustlogo?v_querytype=W&v_shortname=SC2&v_search=globalrestaurantequip.com&x=6&y=5', 
  'windowname1', 
  'width=550, height=700'); 
   return false;">
<AREA SHAPE=CIRCLE COORDS="599,47,43" href="javascript: void(0)" 
   onclick="window.open('/lpgua.gif', 
  'windowname2', 
  'width=525, height=725'); 
   return false;">
<AREA SHAPE=RECT COORDS="42,110,81,126" HREF="/">
<AREA SHAPE=RECT COORDS="99,112,190,124" HREF="http://stores.ebay.com/Global-Restaurant-Equipment">
<AREA SHAPE=RECT COORDS="212,112,262,124" HREF="/products.php">
<AREA SHAPE=RECT COORDS="291,111,360,124" HREF="mailto:&#115;&#101;&#108;&#108;&#064;&#103;&#108;&#111;&#098;&#097;&#108;&#114;&#101;&#115;&#116;&#097;&#117;&#114;&#097;&#110;&#116;&#101;&#113;&#117;&#105;&#112;&#046;&#099;&#111;&#109;?Subject=Website Inquiry">
<AREA SHAPE=RECT COORDS="386,110,464,123" HREF="#location">
</MAP>
<a href="http://www.instantssl.com" id="comodoTL">SSL</a>
<script language="JavaScript" type="text/javascript">
COT("http://globalrestaurantequip.com/cornertrust.gif", "SC2", "none");
</script></body>
</html>
<?
}
}
?>
<?php
$compressor->finish();
?>

Link to comment
Share on other sites

when you use an array whos index isn't a number, you need to put single quotes. for example: $row['index'] instead of $row[index]

 

Okay, actually, since PHP is loosely typed and wants to be on your side, you don't, but it's faster, neater and more proper to use ' '.  This is because when PHP encounters a string not enclosed in "" or ' ', it assumes it's a constant so it looks for one by that name.  If it doesn't find one, it attempts to cast it to a string, which allows you to use it in that way.  But you shouldn't.  So don't.

Link to comment
Share on other sites

I should clarify...

 

if you're using the variable within double quotes, then you can't use the single quote. But if it's anywhere else, you need the single quotes.

 

 

fake edit: I'm not gonna look over all that code.. sorry. I need some kinda error message or line #

Link to comment
Share on other sites

when you use an array whos index isn't a number, you need to put single quotes. for example: $row['index'] instead of $row[index]

 

Okay, actually, since PHP is loosely typed and wants to be on your side, you don't, but it's faster, neater and more proper to use ' '.  This is because when PHP encounters a string not enclosed in "" or ' ', it assumes it's a constant so it looks for one by that name.  If it doesn't find one, it attempts to cast it to a string, which allows you to use it in that way.  But you shouldn't.  So don't.

 

shouldn't put it in single quotes?

Link to comment
Share on other sites

when you use an array whos index isn't a number, you need to put single quotes. for example: $row['index'] instead of $row[index]

 

Okay, actually, since PHP is loosely typed and wants to be on your side, you don't, but it's faster, neater and more proper to use ' '.  This is because when PHP encounters a string not enclosed in "" or ' ', it assumes it's a constant so it looks for one by that name.  If it doesn't find one, it attempts to cast it to a string, which allows you to use it in that way.  But you shouldn't.  So don't.

 

shouldn't put it in single quotes?

 

No, you should.  You shouldn't let PHP try to make it a string and all that garbage I meant.

Link to comment
Share on other sites

You know if you indented your script like a good programmer, you would be able to more easily tell where things are broken.  I immediately see that surrounding line 306 is a table opening and closing tags.  There are no tr and td tags inside it, and your closing table tag is missing the > at the end.  If that doesn't fix it, then to be honest, I'm not going to rake through 750 lines of un-indented code to make sure all your tags are lined up, nor do I really know anybody else that would, either.  Indent your code.  Get an editor that highlights tags.  It will make your life a million times easier.

Link to comment
Share on other sites

I have the trs and tds in the include file. I didn't choose to post my entire code, someone on here asked for it. Its all irrelevant actually, only line 306 is of consequence. Something is wrong with the way I am including it.

Link to comment
Share on other sites

I have the trs and tds in the include file. I didn't choose to post my entire code, someone on here asked for it. Its all irrelevant actually, only line 306 is of consequence. Something is wrong with the way I am including it.

 

You said that including it breaks the format.  That's not a problem with the include, that's a problem with your html.  You shouldn't be splitting up your html like that anyways.  It's messy and confusing and begs for errors just like this to happen.  Did putting the > on the </table not work?

Link to comment
Share on other sites

Nope. I tried with or without the table settings, it should still not break it. If I arbitrarily threw in a tr outside of its element I would have had a skewed page, not a broken page, but still, I tried adding the table beginning and table ending tags around the include which didn't change it at all. I have also tried no table tags and including a simple text file that has just one word of text contained in it, it still breaks.

 

Trust me also, I would LOVE to have time to code properly, but I am one person handling 4 sites here, each with between 5k and 8k items on them, and constantly being changed, I don't have time to redo code or write it properly. I even do this from home (you can probably tell some of my post times are at night and in the evening) its ridiculous, for sure, but I have to work with what I have. Sorry about that.

Link to comment
Share on other sites

do you have <?php .. ?> tags inside your included file?  Because you already have them wrapped around the include. 

That shouldn't matter, there isn't really a way to include without wrapping the include statement in php tags.

 

Can you show the generated source where it isn't working, or a link to that page?

Link to comment
Share on other sites

No, the php tag is not in the included file.

 

 

http://globalrestaurantequip.com/product.php?restaurant_equipment=GDM-3 is a link to the page that works

 

a duplicate page with the exact code including the include statement is at

 

http://globalrestaurantequip.com/product2.php?restaurant_equipment=GDM-3

 

I also echoed the $restaurant_equipment on that page just above it.

Link to comment
Share on other sites

I *MIGHT* be getting somewhere. I did a print also, using the same full string as in the include and received an odd result back. That page is http://globalrestaurantequip.com/product3.php?restaurant_equipment=GDM-3

Now that prints out the url, but it also added a numeral 1 on the end?? What the heck is that about?? Probably the source of the problem, maybe?

 

<?= print "http://globalrestaurantequip.com/specs/".$restaurant_equipment.".php";?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.