bennyy Posted November 12, 2007 Share Posted November 12, 2007 I am working on rebuilding a page.this is the page that has the problem.http://bellavista.madtek.com/testgallery.php the new page gallery is not working. here is the working gallery http://bellavista.madtek.com/2005gallery.php?Which=2005all&ID=4 here is the not working gallery php hasnt change there in the same folder on the same server. php just wont run on the new page. I know the page doesnt look right that why i am having to rebuild it Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/ Share on other sites More sharing options...
~n[EO]n~ Posted November 12, 2007 Share Posted November 12, 2007 I think there is some path errors, in the not working one you get Cannot open file /inetpub/lefthemisphere/bellavista/public_html/galleries/.txt! and in the working one you get http://bellavista.madtek.com/gallery2005/thumbs/howelsen-winter-carnival.jpg Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389582 Share on other sites More sharing options...
bennyy Posted November 12, 2007 Author Share Posted November 12, 2007 where are you seeing that. heres the code from each page <?php $Limit = 4; $LimitA = $Limit-1; $Gallery = "/inetpub/lefthemisphere/bellavista/public_html/galleries/".$Which.".txt"; $Open = fopen($Gallery, "r") or die("Cannot open file $Gallery!"); if ($Open) { $Images = file($Gallery); $Total = count($Images); $Final = $Total-1; for ($n = 0; $n < count($Images); $n++){ $Image = each ($Images); $Mod = $Image[key] % $Limit; if ( ($Mod == 0) AND ($Image[key] == $Final) ) <?php $Limit = 4; $LimitA = $Limit-1; $Gallery = "/inetpub/lefthemisphere/bellavista/public_html/galleries/".$Which.".txt"; $Open = fopen($Gallery, "r") or die("Cannot open file $Gallery!"); if ($Open) { $Images = file($Gallery); $Total = count($Images); $Final = $Total-1; for ($n = 0; $n < count($Images); $n++){ $Image = each ($Images); $Mod = $Image[key] % $Limit; if ( ($Mod == 0) AND ($Image[key] == $Final) ) these are just the litle snippets from where i am seeing in the view source where the php wont execute Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389586 Share on other sites More sharing options...
~n[EO]n~ Posted November 12, 2007 Share Posted November 12, 2007 This line is producing $Gallery = "/inetpub/lefthemisphere/bellavista/public_html/galleries/".$Which.".txt"; this Cannot open file /inetpub/lefthemisphere/bellavista/public_html/galleries/.txt! error Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389587 Share on other sites More sharing options...
centerwork Posted November 12, 2007 Share Posted November 12, 2007 Where is the "$Which variable being loaded? Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389588 Share on other sites More sharing options...
~n[EO]n~ Posted November 12, 2007 Share Posted November 12, 2007 I think you are fetching the picture path from a text file. Here the problem is that your text file is not found. Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389592 Share on other sites More sharing options...
bennyy Posted November 12, 2007 Author Share Posted November 12, 2007 here is the working page <?php $Which = urlencode($Which); $ID = urlencode($ID); ?> <html> <head> <title> Bella Vista Steamboat | Private Luxury Lodging Steamboat Springs, Colorado </title> <LINK REL="StyleSheet" HREF="includes/styles.css"> <?php include "includes/2005javascript.php"; ?> <script> function popimage(imagesrc,winwidth,winheight){ var look='width='+winwidth+',height='+winheight+',' popwin=window.open("","",look) popwin.document.open() popwin.document.write('<title>Click to close</title><body topmargin=0 rightmargin=0 leftmargin=0 marginheight=0 marginwidth=0><table cellpadding=0 cellspacing=0 border=0 width=100% height=100%><tr><td align=center><A HREF=javascript:window.close()><img src="'+imagesrc+'" border=0 alt=\"Click to close\" width="'+winwidth+'" height="'+winheight+'"></a></td></tr></table></body>') popwin.document.close() } </script> <style type="text/css"> <!-- --> </style> </head> <?php if ($Which == '2005weddings') { $head = "<img src=\"images/ttl-specialevents2.gif\" alt=\"Weddings and Special Events\" width=\"523\" height=\"63\">"; } if ($Which == '2005all') { $head = "<img src=\"images/ttl-gallery.gif\" alt=\"Bella Vista Photo Gallery\" width=\"523\" height=\"63\">"; } ?> <?php include "includes/nav2.php"; ?> <!--START table A--> <table cellpadding=0 cellspacing=0 border=0 align=center width=800> <tr> <td><a href="index.php"><img src="images/tableA-1.gif" width="365" height="109" border="0" alt="Bella Vista Steamboat"></a></td> </tr> </table></center> <!--END table A--> <!--START table B--> <table cellpadding=0 cellspacing=0 border=0 align=center width=800> <tr> <td><a href="specials.php" onMouseOver = "if (br == 'n3') document.spec.src = specb.src" onmouseout = "if (br == 'n3') document.spec.src = speca.src;"><img src="images/specials-a.gif" width="211" height="32" border="0" alt="Seasonal Specials" name=spec></a></td> <td><img src="images/tableB-2.gif" width="564" height="32" border="0" alt=""></td> </tr> </table> <!--END table B--> <table cellpadding=0 cellspacing=0 border=0 align=center width=800> <tr> <td valign=top width=211><img src="images/2005tableB-3.jpg" width="211" height="248"></td> <td width=523> <table border=0 cellpadding=0 cellspacing=24 align=center width=523> <?php $Limit = 4; $LimitA = $Limit-1; $Gallery = "/inetpub/lefthemisphere/bellavista/public_html/galleries/".$Which.".txt"; $Open = fopen($Gallery, "r") or die("Cannot open file $Gallery!"); if ($Open) { $Images = file($Gallery); $Total = count($Images); $Final = $Total-1; for ($n = 0; $n < count($Images); $n++){ $Image = each ($Images); $Mod = $Image[key] % $Limit; if ( ($Mod == 0) AND ($Image[key] == $Final) ) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<tr><td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td><td></td><td></td><td></td></tr>"); } elseif ( ($Mod == 1) AND ($Image[key] == $Final) ) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td><td></td><td></td></tr>"); } elseif ( ($Mod == 2) AND ($Image[key] == $Final) ) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td><td></td></tr>"); } elseif ( ($Mod == 3) AND ($Image[key] == $Final) ) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td></tr>"); } elseif ($Mod == 0) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<tr><td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td>"); } elseif ( ($Mod == $LimitA) || ($Image[key] == $Final) ) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td></tr>"); } else { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td>"); } } } ?> </table><br> <img src="images/spacer.gif" width="41" height="1" border="0" alt=""></td> <td> </td> </tr> </table> <?php include "includes/2005footer.php"; ?> Here iss the not working page <?php $Which = urlencode($Which); $ID = urlencode($ID); ?> <html> <head> <title> Bella Vista Steamboat | Private Luxury Lodging Steamboat Springs, Colorado </title> <script> function popimage(imagesrc,winwidth,winheight){ var look='width='+winwidth+',height='+winheight+',' popwin=window.open("","",look) popwin.document.open() popwin.document.write('<title>Click to close</title><body topmargin=0 rightmargin=0 leftmargin=0 marginheight=0 marginwidth=0><table cellpadding=0 cellspacing=0 border=0 width=100% height=100%><tr><td align=center><A HREF=javascript:window.close()><img src="'+imagesrc+'" border=0 alt=\"Click to close\" width="'+winwidth+'" height="'+winheight+'"></a></td></tr></table></body>') popwin.document.close() } </script> <style type="text/css"> <!-- body { background: #002340; background-image: url("../images/back.gif"); background-repeat: repeat-x; margin: 0px; } #navigation { margin-left: -450px; position: absolute; top: 195px; left: 50%; width: 283px; display: block; z-index: 2; } #gallerytitle{ margin-top: -1px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; } #pleaseWait { margin-left: -387px; position: absolute; top: 141; left: 50%; width:775; height:311; display: block; background-color:#002340; z-index: 1000; } .testimonials { padding-left: 20px; padding-right: 10px; padding-top: 10px; font-family: georgia; font-weight: bold; font-style: italic; font-size: 12px; line-height: 15px; color: #EEEEEE; } .caption { padding-left: 20px; padding-right: 10px; padding-top: 0px; font-family: "trebuchet ms",verdana; font-size: 11px; line-height: 15px; color: #EEEEEE; } .bodybox { padding-left: 20px; padding-right: 10px; padding-top: 0px; font-family: "trebuchet ms",verdana; font-size: 11px; line-height: 15px; text-align: justify; color: #EEEEEE; } .clearFloat { clear: both; } .bodybox2 { padding-left: 20px; padding-right: 10px; padding-top: 0px; font-family: "trebuchet ms",verdana; font-size: 11px; line-height: 15px; color: #EEEEEE; } .body { font-family: "trebuchet ms",verdana; font-size: 11px; line-height: 15px; color: #EEEEEE; text-decoration: none; } A.bodylink { font-family: "trebuchet ms",verdana; font-size: 11px; line-height: 15px; font-weight:bold; color: #BB935A; text-decoration: none; } A.bodylink:hover { font-weight:bold; color: #B2B2B0; text-decoration: underline; } .copyright { padding-left: 15px; font-family: "trebuchet ms",verdana; font-size: 9px; line-height: 13px; color: #B2B2B0; } A.copyrightlink { font-family: "trebuchet ms",verdana; font-size: 9px; line-height: 13px; color: #B2B2B0; text-decoration: none; } A.copyrightlink:hover { font-family: "trebuchet ms",verdana; font-size: 9px; line-height: 13px; color: #BB935A; text-decoration: underline; } .form { font-family: "trebuchet ms",verdana; font-size: 10px; color: #BB935A; background-color:#002340; } .form2 { font-family: "trebuchet ms",verdana; font-size: 10px; line-height: 14px; color: #002340; } .close { font-family: "trebuchet ms",verdana; font-size: 12px; font-weight: bold; line-height: 16px; color: #002340; } A.close { font-weight: bold; color: #002340; text-decoration: underline; } A.close:hover { font-weight: bold; color: #B2B2B0; text-decoration: underline; } .contact { font-family: "trebuchet ms",verdana; font-size: 11px; line-height: 15px; color: #EEEEEE; } A.contact { color: #BB935A; text-decoration: none; } A.contact:hover { color: #B2B2B0; text-decoration: underline; } .bottomlinks { font-family: "trebuchet ms",verdana; font-size: 9px; line-height: 13px; color: #B2B2B0; } A.bottomlinks { font-family: "trebuchet ms",verdana; font-size: 9px; line-height: 13px; color: #B2B2B0; text-decoration: none; } A.bottomlinks:hover { font-family: "trebuchet ms",verdana; font-size: 9px; line-height: 13px; color: #BB935A; text-decoration: underline; } .SpHead { font-family: Georgia; font-weight:bold; font-size: 14px; line-height: 18px; color: #002340; } .SpBody { font-family: "trebuchet ms",verdana; font-size: 11px; line-height: 13px; color: #002340; } .SpRes { font-family: "trebuchet ms",verdana; font-size: 9px; line-height: 13px; color: #B2B2B0; } .rates { font-family: "trebuchet ms",verdana; font-size: 10px; line-height: 14px; color: #EEEEEE ; } .header { font-family: verdana; font-size: 11px; font-weight: bold; line-height: 14px; color: #002340; } .header2 { font-family: verdana; font-size: 11px; font-weight: bold; line-height: 14px; color: #cc0000; } .ratesHead1 { font-family: "trebuchet ms",verdana; font-size: 14px; font-weight: bold; color: #B7905A ; } .ratesHead2 { font-family: "trebuchet ms",verdana; font-size: 10px; font-weight: bold; color: #002340 ; } .rates2005 { font-family: "trebuchet ms",verdana; font-size: 11px; color: #002340 ; } .tableFeatures { width: 494px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; } .tableFeatures th { font-family: verdana; font-size: 12px; font-weight: bold; color: #FFFFFF; background-color: #b2b2b0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; } .tableFeatures td { font-family: verdana; font-size: 10px; color: #FFFFFF; vertical-align: top; padding-right: 8px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; } .tableFeatures td ul { list-style-type: disc; list-style-position: outside; margin: 0px; padding: 0px; } .tableFeatures td ul li { margin-left: 12px; padding-bottom: 5px; } .subPhotos { float: right; border: 0px solid #000000; position: relative; right: -51px; margin-top: 5px; margin-right: 0px; margin-bottom: 0px; margin-left: -20px; } .floorPlans { margin-left: 20px; border: 1px solid #b2b2b0; } #bodyButtons { padding: 10px 0px; } #bodyButtons ul { margin:0; padding:0; font: bold 9px Verdana, Arial, Helvetica, sans-serif; text-transform: uppercase; } #bodyButtons li { float: left; list-style-type: none; margin-right: 4px; padding-top: 1px; padding-bottom: 1px; background: #bb925a; border-top: 1px solid #cccccc; border-right: 1px solid #666666; border-bottom: 1px solid #666666; border-left: 1px solid #cccccc; } #bodyButtons a { text-decoration: none; color: #002340; padding-top: 1px; padding-right: 10px; padding-bottom: 1px; padding-left: 10px; } #bodyButtons a:hover { color: #FFFFFF; } #bodyButtons li:hover { border-top: 1px solid #666666; border-right: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #666666; } #bodyButtons li:active { border-top: 1px solid #666666; border-right: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #666666; } .specialHead { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; text-transform: uppercase; color: #002340; background-image: url(../images/special-back.jpg); background-repeat: repeat-y; padding: 4px 4px 4px 8px; width: 100%; border-top-width: 1px; border-top-style: solid; border-top-color: #b2b2b0; border-right-color: #b2b2b0; border-bottom-color: #b2b2b0; border-left-color: #b2b2b0; margin-bottom: 10px; margin-top: 15px; } a:link { color: #FFFFFF; } a:visited { color: #FFFFFF; } a:active { color: #FFFFFF; } .content{ height: 100%; width: 775px; } .left{ height: 100%; width: 211px; background: url(/images/2005tableB-3.jpg) no-repeat; } .gallery{ padding-left: 211px; height: 100%; width: 523px; float: right; } #nav a { text-decoration:none; } #nav ul { margin: 0; list-style-type: none; list-style-image: none; letter-spacing: 2px; padding-top: 52px; padding-right: 0; padding-bottom: 0; padding-left: 0; background: url(images/2005tableB-3.jpg) no-repeat; float: left; } #nav ul a:link { text-decoration: none; color: #BB925A; font-weight: bolder; font-family: "Trebuchet MS"; letter-spacing: 2px; } #nav a:hover { text-decoration: none; color: #ffffff; font-family: "Trebuchet MS"; letter-spacing: 2px; } #nav a:visited:hover{ text-decoration: none; color: #ffffff; font-family: "Trebuchet MS"; letter-spacing: 2px; } #nav { font-family: "Trebuchet MS"; font-size: 10px; font-weight: bolder; text-transform: capitalize; text-decoration: none; text-align: right; color: #bb925a; float: left; width: 211px; line-height: 11px; letter-spacing: 5px; height: 248px; background: #002340 no-repeat; padding-left: 12.5px; } #nav a:hover { font-family: "Trebuchet MS"; color: #ffffff; text-decoration: none; } #nav li { font-family: "Trebuchet MS"; color: #bb925a; text-decoration: none; } #nav li { text-decoration: none; color: #BB925A; } #nav a:visited{ text-decoration: none; color: #BB925A; } #mainbody{ width: 800px; z-index: 100; } --> </style> </head> <?php if ($Which == '2005weddings') { $head = "<img src=\"images/ttl-specialevents2.gif\" alt=\"Weddings and Special Events\" width=\"523\" height=\"63\">"; } if ($Which == '2005all') { $head = "<img src=\"images/ttl-gallery.gif\" alt=\"Bella Vista Photo Gallery\" width=\"523\" height=\"63\">"; } ?> <!--START table A--> <table cellpadding=0 cellspacing=0 border=0 align=center width=775> <tr> <td><a href="index.php"><img src="images/tableA-1.gif" width="365" height="109" border="0" alt="Bella Vista Steamboat"></a></td> </tr> </table> <!--END table A--> <!--START table B--> <table cellpadding=0 cellspacing=0 border=0 align=center width=775> <tr> <td><a href="specials.php" onMouseOver = "if (br == 'n3') document.spec.src = specb.src" onmouseout = "if (br == 'n3') document.spec.src = speca.src;"><img src="images/specials-a.gif" width="211" height="32" border="0" alt="Seasonal Specials" name=spec></a></td> <td><img src="images/tableB-2.gif" width="564" height="32" border="0" alt=""></td> </tr> </table> <!--END table B--><center><div id="mainbody"> <div id="nav"><ul id="nav"> <li><a href="2005location.php?ID=3">LOCATION</a><img src="images/bullet.gif" /> </li> <li><a href="/2005accommodations.php">ACCOMMODATIONS</a><img src="images/bullet.gif" /> </li> <li><a href="2005gallery.php?Which=2005all&ID=4">IMAGE GALLERY</a><img src="images/bullet.gif" /> </li> <li><a href="2005summeractivities.php">SUMMER ACTIVITIES</a><img src="images/bullet.gif" /> </li> <li><a href="/2005skiseason.php?ID=14">SKI SEASON</a><img src="images/bullet.gif" /> </li> <li><a href="2005specialevents.php?ID=14">FAMILY GATHERINGS</a><img src="images/bullet.gif" /> </li> <li><a href="2005corporateretreats.php?ID=12">COPORATE EVENTS</a><img src="images/bullet.gif" /> </li> <li><a href="2005weddings.php?ID=5">WEDDINGS</a><img src="images/bullet.gif" /> </li> <li><a href="2005reservations.php?ID=7">RATES</a><img src="images/bullet.gif" /> </li> <li><a href="2005specials.php?ID=8">SPECIALS</a><img src="images/bullet.gif" /> </li> <li><a href="2005testimonials.php?ID=6">TESTIMONIALS</a><img src="images/bullet.gif" /> </li> <li><a href="2005contact.php?ID=11">RESERVATIONS</a><img src="images/bullet.gif" /> </li> </ul> </div> <table border=0 cellpadding=0 cellspacing=24 align=center width=523> <?php $Limit = 4; $LimitA = $Limit-1; $Gallery = "/inetpub/lefthemisphere/bellavista/public_html/galleries/".$Which.".txt"; $Open = fopen($Gallery, "r") or die("Cannot open file $Gallery!"); if ($Open) { $Images = file($Gallery); $Total = count($Images); $Final = $Total-1; for ($n = 0; $n < count($Images); $n++){ $Image = each ($Images); $Mod = $Image[key] % $Limit; if ( ($Mod == 0) AND ($Image[key] == $Final) ) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<tr><td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td><td></td><td></td><td></td></tr>"); } elseif ( ($Mod == 1) AND ($Image[key] == $Final) ) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td><td></td><td></td></tr>"); } elseif ( ($Mod == 2) AND ($Image[key] == $Final) ) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td><td></td></tr>"); } elseif ( ($Mod == 3) AND ($Image[key] == $Final) ) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td></tr>"); } elseif ($Mod == 0) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<tr><td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td>"); } elseif ( ($Mod == $LimitA) || ($Image[key] == $Final) ) { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td></tr>"); } else { $ph = $Image[value]; $ph = trim($ph); $photo = "/inetpub/lefthemisphere/bellavista/public_html/gallery2005/".$ph.".jpg"; if (file_exists($photo)) { $photoSize = getimagesize($photo); } print ("<td align=center><a href=\"gallery2005/$ph.jpg\" onClick=\"popimage('gallery2005/$ph.jpg',$photoSize[0],$photoSize[1]);return false\"><img border=1 src=\"gallery2005/thumbs/$ph.jpg\" height=\"88\" width=\"88\"></a><img src=\"images/side-ph.gif\" width=\"10\" height=\"87\" border=\"0\" alt=side><br><img src=\"images/bottom-ph.gif\" width=\"98\" height=\"10\" border=\"0\" alt=bottom></td>"); } } } ?> </table> </div> <?php include "includes/2005footer.php"; ?> Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389593 Share on other sites More sharing options...
phpQuestioner Posted November 12, 2007 Share Posted November 12, 2007 Should it not be like this: <?php $Limit = 4; $LimitA = $Limit-1; $Gallery = "/inetpub/lefthemisphere/bellavista/public_html/galleries".$Which."./".$TextFileVariableHere.".txt"; $Open = fopen($Gallery, "r") or die("Cannot open file $Gallery!"); if ($Open) { $Images = file($Gallery); $Total = count($Images); $Final = $Total-1; for ($n = 0; $n < count($Images); $n++){ $Image = each ($Images); $Mod = $Image[key] % $Limit; if ( ($Mod == 0) AND ($Image[key] == $Final) ) The IMG SRC for your first image (on your working page) is: http://bellavista.madtek.com/gallery2005/thumbs/howelsen-winter-carnival.jpg if you do this: $Gallery = "/inetpub/lefthemisphere/bellavista/public_html/galleries".$Which."./".$idVariableHere.".txt"; I think will correct your path issue. This is what your have: /inetpub/lefthemisphere/bellavista/public_html/galleries./.txt This is what you should have: /inetpub/lefthemisphere/bellavista/public_html/galleries2005/images.txt Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389594 Share on other sites More sharing options...
bennyy Posted November 12, 2007 Author Share Posted November 12, 2007 n~ link=topic=167289.msg737129#msg737129 date=1194841896] I think you are fetching the picture path from a text file. Here the problem is that your text file is not found. Those files are in the same location and the working file is finding that folder and file this is why its confusing me Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389597 Share on other sites More sharing options...
centerwork Posted November 12, 2007 Share Posted November 12, 2007 Correct me if I am wrong but it seems to me that your old page is receiving the variable from another page. But when you test your new page you are just running the direct link which does not contain the needed variable for $which. Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389601 Share on other sites More sharing options...
~n[EO]n~ Posted November 12, 2007 Share Posted November 12, 2007 I think centerwork is right In the old page Which=2005all ID=4 and in the new page there is no value for Which and ID Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389605 Share on other sites More sharing options...
bennyy Posted November 12, 2007 Author Share Posted November 12, 2007 Should it not be like this: <?php $Limit = 4; $LimitA = $Limit-1; $Gallery = "/inetpub/lefthemisphere/bellavista/public_html/galleries".$Which."./".$idVariableHere.".txt"; $Open = fopen($Gallery, "r") or die("Cannot open file $Gallery!"); if ($Open) { $Images = file($Gallery); $Total = count($Images); $Final = $Total-1; for ($n = 0; $n < count($Images); $n++){ $Image = each ($Images); $Mod = $Image[key] % $Limit; if ( ($Mod == 0) AND ($Image[key] == $Final) ) The IMG SRC for your first image should (on your working page) is: http://bellavista.madtek.com/gallery2005/thumbs/howelsen-winter-carnival.jpg if you do this: $Gallery = "/inetpub/lefthemisphere/bellavista/public_html/galleries".$Which."./".$idVariableHere.".txt"; I think will correct your path issue. I tryed it and it didnt work http://bellavista.madtek.com/testgallery.php Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389606 Share on other sites More sharing options...
bennyy Posted November 12, 2007 Author Share Posted November 12, 2007 Correct me if I am wrong but it seems to me that your old page is receiving the variable from another page. But when you test your new page you are just running the direct link which does not contain the needed variable for $which. Are you talking about the first 4 lines Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389609 Share on other sites More sharing options...
bennyy Posted November 12, 2007 Author Share Posted November 12, 2007 when you put this in it still doesnt work http://bellavista.madtek.com/testgallery.php?Which=2005all&ID=4 Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389611 Share on other sites More sharing options...
phpQuestioner Posted November 12, 2007 Share Posted November 12, 2007 your "Which" variable identifies your gallery - right - like gallery". $Which ." ? now you need to define a variable for your text files name your text file name needs to be identified with your "ID" variable through PHP & MySQL to make/define a variable for your text file. Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389612 Share on other sites More sharing options...
centerwork Posted November 12, 2007 Share Posted November 12, 2007 New Test page http://bellavista.madtek.com/testgallery.php Current page http://bellavista.madtek.com/2005gallery.php?Which=2005all&ID=4 You are missing this on your testgalary.php ?Which=2005all&ID=4 Also, you may also have to add this to you top code. $Which = $_GET[Which]; $ID= $_GET[id]; $Which = urlencode($Which); $ID = urlencode($ID); Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389616 Share on other sites More sharing options...
bennyy Posted November 12, 2007 Author Share Posted November 12, 2007 New Test page http://bellavista.madtek.com/testgallery.php Current page http://bellavista.madtek.com/2005gallery.php?Which=2005all&ID=4 You are missing this on your testgalary.php ?Which=2005all&ID=4 Also, you may also have to add this to you top code. $Which = $_GET[Which]; $ID= $_GET[id]; $Which = urlencode($Which); $ID = urlencode($ID); It still doesnt work though Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389619 Share on other sites More sharing options...
phpQuestioner Posted November 12, 2007 Share Posted November 12, 2007 what is the absolute url supposed to be for the text file variable $Gallery ? Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389620 Share on other sites More sharing options...
bennyy Posted November 12, 2007 Author Share Posted November 12, 2007 centerwork you are a god Thank you!!!!!!!!!!!!!!!!!!!!!!!!! ;D Link to comment https://forums.phpfreaks.com/topic/76944-solved-help-with-an-error/#findComment-389621 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.