Solved

How to revise the code of showing image using ASP?

Posted on 2011-09-22
14
199 Views
Last Modified: 2012-05-12
Dear EE experts,

Kindly see the attached screenshots & codes, we would like to ask for tech support on how to revise or something that attached codes. If you'll check the screenshots of Products table, it shows image1, image2, image3, up to image5 actually. That's the path location if a user uploads an image. We tried to upload 2 images at the same time, that's why it goes to image1 & image2, then we tried to view it. It shows only 1 image, the image1, the image2 didn't show up. But if we upload 1 at a time (pls check the Products table again), you can see the seriesID 116, it's on the same column (image1 column), that's why when we tried to view it, the 2 images showed up.

Thank you & hope to hear soon...
:-)
<TOP>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Set connectString = Server.CreateObject("ADODB.Connection")
connectString.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("..\asia\photo\products_asia.mdb") & ";"
connectString.Open

SeriesID = request.QueryString("SeriesID")

Set sqlContent = CreateObject("ADODB.Command")
sqlContent.ActiveConnection=connectString
sqlContent.Prepared = true

sqlContent.commandtext = "SELECT products.ID, products.seriesid, products.product_name, products.image1, products.image2, products.image3, products.image4, products.image5, products.download1, products.download2, products.download3, products.download4, products.download5, products.product_file, products.createby, products.createdate, series.typeid, series.categoryid, series.brandid, series.series_name FROM products INNER JOIN series ON products.seriesid = series.seriesid WHERE products.seriesid=?"

sqlContent.Parameters.Append sqlContent.CreateParameter("@seriesid", 3, 1, , SeriesID)
Set rsProducts = sqlContent.Execute
if not rsProducts.eof then
series_name = rsProducts("series_name")
end if
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

---------------------------------------------
<SHOW IMAGE PART>
    	<table width="78%" border="0" cellspacing="3" cellpadding="1">
  			<tr> 
				<% 
				dim i
			    i=0
				Do Until rsProducts.EOF 
				if not rsProducts.eof then
				image1 = rsProducts("image1")
				 product_name = rsProducts("product_name")
				 download1 = rsProducts("download1")
				end if
			   	%>
		    	<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">
					<img src="photo/<%=image1%>" alt="<%=product_name%>"/>
	        <br/>
					<center><font face="Tahoma, Geneva, sans-serif" size="1"><%=product_name%>&nbsp;&nbsp;
   				    <%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & download1 & """>DOWNLOAD</a>"
						
						End If
    					%>
        				
        			</center>
			  </td>
			<%
			if i>2 then
			%>
		</tr>
  		<tr>
	
    		<% 
			i=0
				else
			i=i+1
			end if
        	rsProducts.MoveNext 
    		Loop 
			if i<>0 and (4-i)<>0 then
	   		%>
	   			<td colspan="<%=(4-i)%>" bgcolor="#FFFFFF">&nbsp;</td>
	   		<%
			end if
			%>
  		</tr>
  
	</table>

Open in new window

dbTable-Products2.jpg
web-show.jpg
0
Comment
Question by:Stiebel Eltron
  • 8
  • 6
14 Comments
 
LVL 30

Expert Comment

by:Wayne Barron
Comment Utility
Doing it like you are, you can only upload one image at a time.
Then you need your code to look and see what the product has an image1, and then grab image2 slot, then it needs to look and see that image2 exist then image3 and so forth.
That is actually a bad way to do it.

This is what I suggest to do. (Which will include someone coding the page for you, or you learning how to do it yourself)

Create a new Table, name it: Images
Now, upload images to that table and have the products table reference it, like the code that I created for you in the other threads.

This takes a bit of work to make the script, but is easy to accomplish.
You can then set it to
Count = Count up to 5 Records per ID
Remove Upload link once the 5 image limit is met.


This is the way that I have our Image Hosting site setup.
It works with the same concept, except there is no limit pre folder.
Just a limit total for free accounts.

If you are interested in pursuing this, then I have a asp.net Upload script
That you can check out. The only thing it needs is the database connection done, which I have not made a demo for that one yet.

Good Luck
Carrzkiss
0
 

Author Comment

by:Stiebel Eltron
Comment Utility
Hello to you again carrzkiss!
I'm so novice with this ASP! :-(
Actually, our upload page is written in PHP, that's created by my other colleague who knows PHP, but not ASP... lol

Either way will take me time to do it, as we need to finish this asap, and the PHP scripts has already what we need, user upload files, it will save the path to the db, (image link), automatically. Then this ASP page will just pull out data from that db...

However, what is the asp.net uploading script that you have?

Thanks!
0
 
LVL 30

Accepted Solution

by:
Wayne Barron earned 500 total points
Comment Utility
The php script, does it insert the images into the
image1, image2, image3, image4, image4
Columns like it suppose to?

If so, then what exactly are you needing to accomplish?
Are you wanting to display all the images on that page?
Is so, then you will have to write it out as such.

This will display the images that are available, and NOT display broken images that are not available
Basically, if their is a record in the Image1-Image5, then it will show, else not show.

You can use this same concept for the Download links as well.
Use it exactly as I have the images here, and it will work for you.

Good Luck
Carrzkiss

<TOP>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Set connectString = Server.CreateObject("ADODB.Connection")
connectString.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("..\asia\photo\products_asia.mdb") & ";"
connectString.Open

SeriesID = request.QueryString("SeriesID")

Set sqlContent = CreateObject("ADODB.Command")
sqlContent.ActiveConnection=connectString
sqlContent.Prepared = true

sqlContent.commandtext = "SELECT products.ID, products.seriesid, products.product_name, products.image1, products.image2, products.image3, products.image4, products.image5, products.download1, products.download2, products.download3, products.download4, products.download5, products.product_file, products.createby, products.createdate, series.typeid, series.categoryid, series.brandid, series.series_name FROM products INNER JOIN series ON products.seriesid = series.seriesid WHERE products.seriesid=?"

sqlContent.Parameters.Append sqlContent.CreateParameter("@seriesid", 3, 1, , SeriesID)
Set rsProducts = sqlContent.Execute
if not rsProducts.eof then
series_name = rsProducts("series_name")
end if
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

---------------------------------------------
<SHOW IMAGE PART>
    	<table width="78%" border="0" cellspacing="3" cellpadding="1">
  			<tr> 
				<% 
				dim i
			    i=0
				Do Until rsProducts.EOF 
				if not rsProducts.eof then
				image1 = rsProducts("image1")
				image2 = rsProducts("image2")
				image3 = rsProducts("image3")
				image4 = rsProducts("image4")
				image5 = rsProducts("image5")
				 product_name = rsProducts("product_name")
				 download1 = rsProducts("download1")
				end if
			   	%>
		    	<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">
                <%if not Image1="" then%>
					<img src="photo/<%=image1%>" alt="<%=product_name%>"/>
                    <%end if%>
                <%if not Image2="" then%>
					<img src="photo/<%=image2%>" alt="<%=product_name%>"/>
                    <%end if%>    
                <%if not Image3="" then%>
					<img src="photo/<%=imag3%>" alt="<%=product_name%>"/>
                    <%end if%>
                <%if not Image4="" then%>
					<img src="photo/<%=image4%>" alt="<%=product_name%>"/>
                    <%end if%>   
                <%if not Image5="" then%>
					<img src="photo/<%=image5%>" alt="<%=product_name%>"/>
                    <%end if%>                
                    
	        <br/>
					<center><font face="Tahoma, Geneva, sans-serif" size="1"><%=product_name%>&nbsp;&nbsp;
   				    <%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & download1 & """>DOWNLOAD</a>"
						
						End If
    					%>
        				
        			</center>
			  </td>
			<%
			if i>2 then
			%>
		</tr>
  		<tr>
	
    		<% 
			i=0
				else
			i=i+1
			end if
        	rsProducts.MoveNext 
    		Loop 
			if i<>0 and (4-i)<>0 then
	   		%>
	   			<td colspan="<%=(4-i)%>" bgcolor="#FFFFFF">&nbsp;</td>
	   		<%
			end if
			%>
  		</tr>
  
	</table>

Open in new window

0
 

Author Comment

by:Stiebel Eltron
Comment Utility
I'll get back into this on Monday. The files are on my server in the office...
Can't wait to test it ;-)
0
 

Author Comment

by:Stiebel Eltron
Comment Utility
Hi there carrzkiss!

You have said that I can use the same concept for my download links, so for this:
<%
dim i
   i=0
Do Until rsProducts.EOF
if not rsProducts.eof then
image1 = rsProducts("image1")
image2 = rsProducts("image2")
image3 = rsProducts("image3")
image4 = rsProducts("image4")
image5 = rsProducts("image5")
 product_name = rsProducts("product_name")
 download1 = rsProducts("download1")
end if
%>

I'll just use the download1, download2, download3, and so on... replace the word image1, 2, 3, and so on... But how about for the download1 = rsProducts("download1")?

As well as for this, right?
<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">
                <%if not Image1="" then%>
                              <img src="photo/<%=image1%>" alt="<%=product_name%>"/>
                    <%end if%>
                <%if not Image2="" then%>
                              <img src="photo/<%=image2%>" alt="<%=product_name%>"/>
                    <%end if%>    
                <%if not Image3="" then%>
                              <img src="photo/<%=imag3%>" alt="<%=product_name%>"/>
                    <%end if%>
                <%if not Image4="" then%>
                              <img src="photo/<%=image4%>" alt="<%=product_name%>"/>
                    <%end if%>  
                <%if not Image5="" then%>
                              <img src="photo/<%=image5%>" alt="<%=product_name%>"/>
                    <%end if%>
0
 

Author Comment

by:Stiebel Eltron
Comment Utility
Kindly advise if I did it correct or wrong, please see the attached codes, based from the code that you gave...
If I don't include the
   <%if not Image3="" then%>
                              <img src="photo/<%=imag3%>" alt="<%=product_name%>"/>
                    <%end if%>
                <%if not Image4="" then%>
                              <img src="photo/<%=image4%>" alt="<%=product_name%>"/>
                    <%end if%>  
                <%if not Image5="" then%>
                              <img src="photo/<%=image5%>" alt="<%=product_name%>"/>
                    <%end if%>
there's no error result below the image, but if I include those items, please see the attached screenshot for the error result.
<table width="78%" border="1" cellspacing="3" cellpadding="1">
  			<tr> 
				<% 
				dim i
			    i=0
				Do Until rsProducts.EOF 
				if not rsProducts.eof then
				image1 = rsProducts("image1")
				image2 = rsProducts("image2")
				image3 = rsProducts("image3")
				image4 = rsProducts("image4")
				image5 = rsProducts("image5")
				 product_name = rsProducts("product_name")
				 download1 = rsProducts("download1")
				 download2 = rsProducts("download2")
 				 download3 = rsProducts("download3")
				 download4 = rsProducts("download4")				 
				 download5 = rsProducts("download5")				 
				end if
			   	%>
		    	<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">
                <%if not Image1="" then%>
					<img src="photo/<%=image1%>" alt="<%=product_name%>"/>
                    <%end if%>
                <%if not Image2="" then%>
					<img src="photo/<%=image2%>" alt="<%=product_name%>"/>
                    <%end if%>    
                <%if not Image3="" then%>
					<img src="photo/<%=image3%>" alt="<%=product_name%>"/>
                    <%end if%>
                <%if not Image4="" then%>
					<img src="photo/<%=image4%>" alt="<%=product_name%>"/>
                    <%end if%>   
                <%if not Image5="" then%>
					<img src="photo/<%=image5%>" alt="<%=product_name%>"/>
                    <%end if%>                
                    
	        <br/>
					<font face="Tahoma, Geneva, sans-serif" size="1"><%=product_name%>
   				    <%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & Replace(download1, "DOWNLOAD", "photo/download") & """>DOWNLOAD</a>"
						
						End If
    				%>
   				    <%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & Replace(download2, "DOWNLOAD", "photo/download") & """>DOWNLOAD</a>"
						
						End If
   					%>
   				    <%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & Replace(download3, "DOWNLOAD", "photo/download") & """>DOWNLOAD</a>"
						
						End If
    				%>
   				    <%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & Replace(download4, "DOWNLOAD", "photo/download") & """>DOWNLOAD</a>"
						
						End If
    				%>
   				    <%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & Replace(download5, "DOWNLOAD", "photo/download") & """>DOWNLOAD</a>"
						
						End If
    				%>

      			
        			
			  </td>
			<%
			if i>2 then
			%>
		</tr>
  		<tr>
	
    		<% 
			i=0
				else
			i=i+1
			end if
        	rsProducts.MoveNext 
    		Loop 
			if i<>0 and (4-i)<>0 then
	   		%>
	   			<td colspan="<%=(4-i)%>" bgcolor="#FFFFFF">&nbsp;</td>
	   		<%
			end if
			%>
  		</tr>

Open in new window

carrzkiss-01.jpg
0
 

Author Comment

by:Stiebel Eltron
Comment Utility
Hello to you carrzkiss :-)

Please the new arrangement of my codes, i just put it inside the tables, but still similar to the previous query...

Please advise on how to resolve it...
<table width="78%" border="0" cellspacing="3" cellpadding="1">
  			<tr> 
				<% 
				dim i
			    i=0
				Do Until rsProducts.EOF 
				if not rsProducts.eof then
				image1 = rsProducts("image1")
				image2 = rsProducts("image2")
				image3 = rsProducts("image3")
				image4 = rsProducts("image4")
				image5 = rsProducts("image5")
				 product_name = rsProducts("product_name")
				 download1 = rsProducts("download1")
				 download2 = rsProducts("download2")
 				 download3 = rsProducts("download3")
				 download4 = rsProducts("download4")				 
				 download5 = rsProducts("download5")				 
				end if
			   	%>
		    	<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">
                <%if not Image1="" then%>
					<img src="photo/<%=image1%>" alt="<%=product_name%>"/>
                <%end if%>
                </td>
		    	<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">                
                <%if not Image2="" then%>
					<img src="photo/<%=image2%>" alt="<%=product_name%>"/>
                <%end if%>
                </td>
		    	<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">
                <%if not Image3="" then%>
                	<img src="photo/<%=image3%>" alt="<%=product_name%>"/>
				<%end if%>
                </td>
		    	<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">                
				<%if not Image4="" then%>
					<img src="photo/<%=image4%>" alt="<%=product_name%>"/>
                <%end if%>
                </td>
		    	<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">                
                <%if not Image5="" then%>
					<img src="photo/<%=image5%>" alt="<%=product_name%>"/>
                <%end if%>
                </td>    
			</tr>
					<font face="Tahoma, Geneva, sans-serif" size="1"><%=product_name%>
            <tr>
		    	<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">                
   				    <%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & Replace(download1, "DOWNLOAD", "photo/download") & """>DOWNLOAD</a>"
						
						End If
    				%>
                 </td>
	             <td align="center" bordercolor="#999999" bgcolor="#FFFFFF">                
   				    <%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & Replace(download2, "DOWNLOAD", "photo/download") & """>DOWNLOAD</a>"
						
						End If
    				%>
                 </td>
		  
			<%
			if i>2 then
			%>
		</tr>
  		<tr>
	
    		<% 
			i=0
				else
			i=i+1
			end if
        	rsProducts.MoveNext 
    		Loop 
			if i<>0 and (4-i)<>0 then
	   		%>
	   			<td colspan="<%=(4-i)%>" bgcolor="#FFFFFF">&nbsp;</td>
	   		<%
			end if
			%>
  		</tr>
</table>

Open in new window

0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 30

Expert Comment

by:Wayne Barron
Comment Utility
OK, I am not getting the error for the Replace, like you are receiving.
I need more details, is there something different in your code from this?

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Set connectString = Server.CreateObject("ADODB.Connection")
connectString.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("products.mdb") & ";"
connectString.Open

SeriesID = request.QueryString("SeriesID")

Set sqlContent = CreateObject("ADODB.Command")
sqlContent.ActiveConnection=connectString
sqlContent.Prepared = true

sqlContent.commandtext = "SELECT products.ID, products.seriesid, products.product_name, products.image1, products.image2, products.image3, products.image4, products.image5, products.download1, products.download2, products.download3, products.download4, products.download5, products.product_file, products.createby, products.createdate, series.typeid, series.categoryid, series.brandid, series.series_name FROM products INNER JOIN series ON products.seriesid = series.seriesid WHERE products.seriesid=?"

sqlContent.Parameters.Append sqlContent.CreateParameter("@seriesid", 3, 1, , SeriesID)
Set rsProducts = sqlContent.Execute
if not rsProducts.eof then
series_name = rsProducts("series_name")
end if
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta name="Author" content="IT" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />

<meta name="GENERATOR" content="Mozilla/4.7 [en] (Win98; I) [Netscape]" />

<title>..:: Stiebel Eltron's iPhoto Stock Gallery - Powered by STE IT Dept. ::..</title>
<style type="text/css">
<!--
	a
 	{
  		color:#000080;
		font-family:verdana;
		text-decoration:none;
		font-size:12px
	}
	
	
	a:active
 	{
  		color:red;

	}

	a:hover
 	{
  		color:#FF0000;
		text-decoration:none;
		cursor:crosshair;
	}
		
	table
	{
		font-family:verdana;
	}
	
	td
	{
		font-family:verdana;
		font-size:10e;
	}

	.b
	{
		font-color:#0A0EB7;
	}		

-->
</style>

<!--date-->
<script type="text/javascript">

<!-- Begin
dayName = new Array("", "¿¿¿¿¿¿", "¿¿¿¿¿¿", "¿¿¿", "¿¿¿¿¿¿¿¿", "¿¿¿¿¿", "¿¿¿¿¿", "¿¿¿¿¿¿¿")
monName = new Array("¿¿¿¿¿¿", "¿¿¿¿¿¿¿¿¿¿", "¿¿¿¿¿¿", "¿¿¿¿¿¿", "¿¿¿¿¿¿¿", "¿¿¿¿¿¿¿¿", "¿¿¿¿¿¿¿", "¿¿¿¿¿¿¿", "¿¿¿¿¿¿¿", "¿¿¿¿¿¿", "¿¿¿¿¿¿¿¿¿", "¿¿¿¿¿¿¿")
now = new Date
//  End -->
</script>

<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

<!--Lytebox-->
<script type="text/javascript" src="lytebox/lytebox.js"></script>
<link rel="stylesheet" href="lytebox/lytebox.css" type="text/css" media="screen" />
<!--END-->

</head>

<body bgproperties="fixed" bgcolor="#000000" onload="javascript:startmenu()">
<table width="760" border="0" cellspacing="3" cellpadding="1">
  <tr>
    <td><img src="IMG/logo_res.jpg" alt="STIEBEL ELTRON" /></td>
    <td valign="top" bgcolor="#666666"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="548" height="197">
      <param name="movie" value="homeintro20.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <embed src="homeintro20.swf" quality="high" wmode="opaque" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="548" height="197"></embed>
    </object></td>
    <td><img src="IMG/white_square.png" alt="STIEBEL ELTRON" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="right" bgcolor="#999999"><font face="Verdana, Geneva, sans-serif" color="#ffffff">
    <%
   '// If user is logged in show name and logout link
   If Session("loggedin") = true Then
      Response.Write "Welcome: " & Session("name")
      Response.Write "<br /><a href=""../iphoto/login2/logout.asp"">Logout</a>"
   Else
      Response.Write "<a href=""ste-iphoto-login.asp"" title=""CLICK TO LOGIN"">REGISTERED USERS</a>"
   End If
	%>&nbsp;
	</td>
    <td bgcolor="#666666" align="center">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    
    <td align="left" bordercolor="#999999" bgcolor="#FFFFFF">
    » <img src="IMG/imgfolder.gif" alt="" />&nbsp;
       <%if rsProducts.eof then
	response.Write"STE Shower Units - Sorry, there is no products for that number"
	else%>
    <a href="javaScript:menu0func()">STE Shower Units - <b><font face="verdana" size="+1"> - 
	<%=series_name%></font></b></a><%end if%>
	</td>
	<td bgcolor="#999999" align="center">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    
<td align="left" bordercolor="#999999" bgcolor="#FFFFFF">
    	<table width="78%" border="0" cellspacing="3" cellpadding="1">
  			<tr> 
				<% 
				dim i
			    i=0
				Do Until rsProducts.EOF 
				if not rsProducts.eof then
				image1 = rsProducts("image1")
				image2 = rsProducts("image2")
				image3 = rsProducts("image3")
				image4 = rsProducts("image4")
				image5 = rsProducts("image5")
				 product_name = rsProducts("product_name")
				 download1 = rsProducts("download1")
				end if
			   	%>
		    	<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">
                <%if not Image1="" then%>
					<img src="photo/<%=image1%>" alt="<%=product_name%>"/>
                    <%end if%>
                <%if not Image2="" then%>
					<img src="photo/<%=image2%>" alt="<%=product_name%>"/>
                    <%end if%>    
                <%if not Image3="" then%>
					<img src="photo/<%=imag3%>" alt="<%=product_name%>"/>
                    <%end if%>
                <%if not Image4="" then%>
					<img src="photo/<%=image4%>" alt="<%=product_name%>"/>
                    <%end if%>   
                <%if not Image5="" then%>
					<img src="photo/<%=image5%>" alt="<%=product_name%>"/>
                    <%end if%> 
	        <br/>
<font face="Tahoma, Geneva, sans-serif" size="1"><%=product_name%>
            <tr>
		    	<td align="center" bordercolor="#999999" bgcolor="#FFFFFF">                
   				    <%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & Replace(download1, "DOWNLOAD", "photo/download") & """>DOWNLOAD</a>"
						
						End If
    				%>
                 </td>
	             <td align="center" bordercolor="#999999" bgcolor="#FFFFFF">                
   				    <%
        				If Session("loggedIn") = true Then
            			Response.Write "<a href=""" & Replace(download2, "DOWNLOAD", "photo/download") & """>DOWNLOAD</a>"
						
						End If
    				%>
			  </td>
			<%
			if i>2 then
			%>
		</tr>
  		<tr>
	
    		<% 
			i=0
				else
			i=i+1
			end if
        	rsProducts.MoveNext 
    		Loop 
			if i<>0 and (4-i)<>0 then
	   		%>
	   			<td colspan="<%=(4-i)%>" bgcolor="#FFFFFF">&nbsp;</td>
	   		<%
			end if
			%>
  		</tr>
  
	</table>
    </td>
	<td bgcolor="#999999" align="center">&nbsp;</td>
  </tr>
  <tr>
  	<td bgcolor="#000000">&nbsp;
    	
    </td>
  	<td bgcolor="#666666" colspan="2" align="left">
    	<a href = "javascript:history.back()"><font size="0.5e">&nbsp;BACK TO TOP</font></a>
    </td>
  </tr>
  <tr>
  	<td bgcolor="#000000">&nbsp;
    	
    </td>
  	<td align="center" bgcolor="#999999" colspan="2">
    	<a href = "http://www.cssasia.info/iphoto/"><font size="0.5e">BACK TO MAIN&nbsp;<img src="IMG/base.gif" alt="BACK TO MAIN PAGE" border="0" /></font></a>
    </td>
  </tr>  
  
</table>
</body>
</html>

Open in new window

0
 

Author Comment

by:Stiebel Eltron
Comment Utility
No more. If you'll view 2 photos, no problem, the photos & link are showing, but if I add download3, 4, 5, the error persists. Unlike in image, if there's no image, there's no error, if there are only 2 images, then only 2 images will be shown, if it's 5, then 5 photos.
I tried it with the download link, i received error...
0
 
LVL 30

Expert Comment

by:Wayne Barron
Comment Utility
OK, if this is completed and the images are working.
Then Accept the post I made above with the working code as Answer
And then you can open another Question, and I will be happy to come in and assist in that one.

Carrzkiss
0
 
LVL 30

Expert Comment

by:Wayne Barron
Comment Utility
Also.
Do not post the link in here to the new Question, once you have this Question completed, I will keep an eye out for a new thread to be open.

Just wanted to let you know, that you cannot post the link to the new Question in here.
That shows favoritism, and is against the Guidelines of EE.

Have a good one.
Carrzkiss
0
 

Author Comment

by:Stiebel Eltron
Comment Utility
Ok, fine with me... I would love to give you points ;-)
Btw, what do u mean by do not post the link in here to the new question? Do u mean opening a new thread but same case?
0
 

Author Closing Comment

by:Stiebel Eltron
Comment Utility
Great Always! ;-)
0
 
LVL 30

Expert Comment

by:Wayne Barron
Comment Utility
Yes, if you open a new Question about the issue you are having here
http:Q_27321625.html#a36598168
Do not post the link in here, as it is called favoritism.
Anyway, I will find it when you open another thread, if it has not already been handled.

Take Care
Carrzkiss
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Read about why website design really matters in today's demanding market.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now