Re: strange link problem to a database item
| From: | Steven Cayford | Date: | Sat, 19 Jan 2002 04:09:13 +0000 |
| Subject: | Re: strange link problem to a database item | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-15983@lists.php.net to get a copy of this message | ||
Hello again. On 2002.01.18 18:48:36 -0600 chip wrote:
In my code I have the following line: printf("<td align=\"center\"><a href=\"%s\"> <img src=\".xvpics/%s\"></a></td>\n", $row["name"], $row["name"]);Ok. So the "name" field in your table holds the filename of the image and you have a thumbnail image by the same name in the .xvpics folder? What does the html source look like in your browser? If you type the url for the image into the browser address bar directly do you get the image? -Steve
When I view this web page I get I get, in- konqueror - all thumb images are fine netscape 6 - no thumb images, just a narrow verticle bar opera 6 - a rectangle with the word image in it I tried from work on an nt machine and got broken image icons. I have verified all browsers are set to show all images. When I right-click and hit show image, so I would view the thumb itself, I don't get the image, instead I get the text url to the image. I've included the full code below. Any ideas what the cause might be? -- Chip W <+><+><+><+><+><+><+><+> Windows 95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 bit of competition. <+><+><+><+><+><+><+><+> ========================================================= <html> <head> <title>Chips Pics</title> </head> <body><table summary="" border="0" align="center" cellpadding="5"cellspacing="5"> <tr> <? $pic = (int) $pic;if(! isset($pic)) { $pic = 0; } $new_pic=$pic+24; $conn=mysql_connect("localhost", "chip","carvin") or die ("Could notget the databse");mysql_select_db("images", $conn) or die ("Could not select thedatabase");$num = mysql_query("select count(*) from misc") ordie(mysql_error());$sql="select * from misc limit $pic,24"; $result=mysql_query($sql) or die ("The query didn't work, oops"); if (mysql_num_rows($result) == 0) { echo "<tr>\n<td colspan=\"6\" align=\"center\">\n<fontsize=\"+2\">Oops, you've reached the end of the line.\n<br>\n<a href=\"../index.html\">Home</a></font>";} else { while ($row=mysql_fetch_array($result)) { printf("<td align=\"center\"><a href=\"%s\"><imgsrc=\"thumbs/%s\"></a></td>\n", $row["name"], $row["name"]);$i++; if($i %6==0) { echo "</tr>\n"; } } echo "<tr>\n<td colspan=\"6\" align=\"center\">\n<ahref=\"../index.html\">Home</a> \n<a href=\"index.php?pic=$new_pic\">Next</a>\n</td>\n</tr>\n";echo "<tr>\n<td colspan=\"6\" align=\"center\">\nThere are ".mysql_result($num,0,0). " pics in the database</td>\n</tr>\n";}?> </table> </body> </html> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net