EMERGENCY: My code crashed - please help
Posted: Fri Jan 23, 2004 2:28 am
Let me start off by saying thanks in advance. I have no programming experience and made a HUGE mistake. We have a website that is run off of MySql and PHP. I went into a file on the server using an ASCII editor and changed 1 word of a text phrase. I saved and uploaded to the server and all hell broke loose. Now my product images are not showing up.
I am hoping somebody here can look at the following code and tell me what I need to do. Remember, I am a novice here. I can modify and upload, but beyond that. I need this done asap as my boss will kill me if he knew I downed his website. The code is as follows:
<?
$rs = $db->query("select * from $config[products_table] where pid='$pid'");if ($rs->RecordCount() > 0) {
?>
<table width="100%">
<tr>
<td colspan="2" align="center" style="padding-bottom:20px;">
<!-- Product Name and description -->
<span style="font-size:26px;">
<?echo $rs->fields[name]
?>
</span> <br> <span style="font-size:20px;">
<?echo $rs->fields[description]
?>
</span> <!-- End Product Name and description -->
</td></tr><tr> <td>
<!-- Product images -->
<?$largeImgDir="".$config[root_dir]."/".$config[prod_img_dir]."/";$d = dir($largeImgDir);while($entry = $d->read()) {//here it is excluded backup dir, preventing a loop $explodedEntry = explode(".", $entry); if ($explodedEntry[0] == $rs->fields[pid]) { $largeImgList[] = $entry;}}for ($i = 0 ; $i < sizeof($largeImgList) ; $i++) {?>
<img src="<?echo $config[prod_img_dir];echo "/";echo $largeImgList[$i]?>" border="0"><br><?}?>
<!-- End product images -->
</td><td valign="top" style="font-size:12px;"> <!-- Product details -->
<?echo $rs->fields[details]?> <br> <br> <!-- EXTRA INFO --><?if ($rs->fields[capacity]) {?>Capacity : <?echo $rs->fields[capacity]?><br><?}?><?if ($rs->fields[inside_dim]) {?>Inside Dimensions : <?echo $rs->fields[inside_dim]?><br><?}?><?if ($rs->fields[outside_dim]) {?>Outside Dimensions : <?echo $rs->fields[outside_dim]?><br><?}?><?if ($rs->fields[qty_per_case]) {?>Quantity per case : <?echo $rs->fields[qty_per_case]?><br><?}?><?if ($rs->fields[case_dim]) {?>Case Dimensions : <?echo $rs->fields[case_dim]?><br><?}?><?if ($rs->fields[case_weight]) {?>Case Weight : <?echo $rs->fields[case_weight]?><br><?}?><?if ($rs->fields[piece_weight]) {?>Piece Weight : <?echo $rs->fields[piece_weight]?><br><?}?><!-- END EXTRA INFO --> <div align="center"> <br> <strong> Item #<?echo $rs->fields[nr]?> <br> <a name="stock"> <?if ($submitAuth && $isLogged) {?> <script>document.location.href='#stock'</script> <span style="background-color:yellow;"><?}?> Availability: <?if ($submitAuth && $isLogged) {?> </span><?}?> </a> <?if (!$isLogged) {?> Wholesale Inquiries Only <?} else {?> <?echo $rs->fields[instock]?> <?}?> </strong> </div> <!-- End Product details --> </td> </tr><?if ($users[info][session][level] > 70){?><tr colspan="2" align="center"> <td><a href="?file=1&go=admproducts&sub=edit&pid=<?echo $rs->fields[pid]?>">[edit product]</a> - <a href="?file=1&go=admproducts&act=delete&pid=<?echo $rs->fields[pid]?>">[delete product]</a> </td></tr><?}?></table><?} else {?>Please specify a product to display.<?}
?>
You can see that everything works fine, but the images are not showing up. Here is the URL for a sample page:
http://www.qualityimporters.com/?go=pro ... ils&pid=27
Please email me at dave@qualityimporters.com if you know how to fix this.
God Bless.
I am hoping somebody here can look at the following code and tell me what I need to do. Remember, I am a novice here. I can modify and upload, but beyond that. I need this done asap as my boss will kill me if he knew I downed his website. The code is as follows:
<?
$rs = $db->query("select * from $config[products_table] where pid='$pid'");if ($rs->RecordCount() > 0) {
?>
<table width="100%">
<tr>
<td colspan="2" align="center" style="padding-bottom:20px;">
<!-- Product Name and description -->
<span style="font-size:26px;">
<?echo $rs->fields[name]
?>
</span> <br> <span style="font-size:20px;">
<?echo $rs->fields[description]
?>
</span> <!-- End Product Name and description -->
</td></tr><tr> <td>
<!-- Product images -->
<?$largeImgDir="".$config[root_dir]."/".$config[prod_img_dir]."/";$d = dir($largeImgDir);while($entry = $d->read()) {//here it is excluded backup dir, preventing a loop $explodedEntry = explode(".", $entry); if ($explodedEntry[0] == $rs->fields[pid]) { $largeImgList[] = $entry;}}for ($i = 0 ; $i < sizeof($largeImgList) ; $i++) {?>
<img src="<?echo $config[prod_img_dir];echo "/";echo $largeImgList[$i]?>" border="0"><br><?}?>
<!-- End product images -->
</td><td valign="top" style="font-size:12px;"> <!-- Product details -->
<?echo $rs->fields[details]?> <br> <br> <!-- EXTRA INFO --><?if ($rs->fields[capacity]) {?>Capacity : <?echo $rs->fields[capacity]?><br><?}?><?if ($rs->fields[inside_dim]) {?>Inside Dimensions : <?echo $rs->fields[inside_dim]?><br><?}?><?if ($rs->fields[outside_dim]) {?>Outside Dimensions : <?echo $rs->fields[outside_dim]?><br><?}?><?if ($rs->fields[qty_per_case]) {?>Quantity per case : <?echo $rs->fields[qty_per_case]?><br><?}?><?if ($rs->fields[case_dim]) {?>Case Dimensions : <?echo $rs->fields[case_dim]?><br><?}?><?if ($rs->fields[case_weight]) {?>Case Weight : <?echo $rs->fields[case_weight]?><br><?}?><?if ($rs->fields[piece_weight]) {?>Piece Weight : <?echo $rs->fields[piece_weight]?><br><?}?><!-- END EXTRA INFO --> <div align="center"> <br> <strong> Item #<?echo $rs->fields[nr]?> <br> <a name="stock"> <?if ($submitAuth && $isLogged) {?> <script>document.location.href='#stock'</script> <span style="background-color:yellow;"><?}?> Availability: <?if ($submitAuth && $isLogged) {?> </span><?}?> </a> <?if (!$isLogged) {?> Wholesale Inquiries Only <?} else {?> <?echo $rs->fields[instock]?> <?}?> </strong> </div> <!-- End Product details --> </td> </tr><?if ($users[info][session][level] > 70){?><tr colspan="2" align="center"> <td><a href="?file=1&go=admproducts&sub=edit&pid=<?echo $rs->fields[pid]?>">[edit product]</a> - <a href="?file=1&go=admproducts&act=delete&pid=<?echo $rs->fields[pid]?>">[delete product]</a> </td></tr><?}?></table><?} else {?>Please specify a product to display.<?}
?>
You can see that everything works fine, but the images are not showing up. Here is the URL for a sample page:
http://www.qualityimporters.com/?go=pro ... ils&pid=27
Please email me at dave@qualityimporters.com if you know how to fix this.
God Bless.