Forums

ASP

This topic is locked

Problem In Displaying Image in .asp

Posted 27 Mar 2007 13:59:09
1
has voted
27 Mar 2007 13:59:09 clarence dmello posted:
Hello Everyone , my project is on ecards and here is where i have got stuck in the project

This is1.asp

<pre id=code><font face=courier size=2 id=code>&lt;html&gt;
&lt;%
dim cards
cards=Request.Form("cards"
%&gt;
&lt;body&gt;
&lt;form action="2.asp" method="post"&gt;
&lt;p&gt;Please select your favorite card:&lt;/p&gt;


&lt;table align="center" bgcolor="#ffffff" border="0" cellpadding="5"&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;
&lt;a href="anniversary_files/anniversary1_.jpg"&gt;&lt;img src="anniversary_files/anniversary1_.jpg" alt="anniversary1_.jpg - 4928 Bytes" border="0" height="92" width="150"&gt;&lt;br&gt;
&lt;/a&gt;

&lt;input name="cards"

&lt;%if cards="anniversary_files/anniversary1_.jpg" then Response.Write("checked"%&gt;

value="1.asp" type="radio"&gt; &lt;a href="anniversary_files/anniversary1_.jpg"&gt;Anniversary 1&lt;/a&gt; &lt;/td&gt;


&lt;td&gt; &lt;a href="anniversary_files/anniversary2_.jpg"&gt;&lt;img src="anniversary_files/anniversary2_.jpg" alt="anniversary2_.jpg - 4928 Bytes" border="0" height="92" width="150"&gt;&lt;br&gt;
&lt;/a&gt;
&lt;input name="cards"

&lt;%if cards="anniversary_files/anniversary2_.jpg" then Response.Write("checked"%&gt;

value="anniversary2_.jpg" type="radio"&gt; &lt;a href="anniversary_files/anniversary2_.jpg"&gt;Anniversary 2&lt;/a&gt;&lt;/td&gt;




&lt;br /&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;input type="submit" value="Submit" /&gt;
&lt;/form&gt;
&lt;%
if cars&lt;&gt;"" then
Response.Write("&lt;p&gt;Your favorite car is: " & cars & "&lt;/p&gt;"
end if
%&gt;
&lt;/body&gt;
&lt;/html&gt;</font id=code></pre id=code>

and this is 2.asp

&lt;html&gt;
&lt;%
dim cards
cards=Request.Form("cards"
%&gt;
&lt;body&gt;

<pre id=code><font face=courier size=2 id=code>&lt;/form&gt;
&lt;%
if cards&lt;&gt;"" then
Response.Write("&lt;p&gt;Your favorite card is: " & cards & "&lt;/p&gt;"
end if
%&gt;
&lt;/body&gt;
&lt;/html&gt;</font id=code></pre id=code>

the problem is that whenever i click on radio button of Anniversary 1 , on the next page ie after clicking on submit button : i dont get the image of aniversary1

Can Anyone help me out with this prob:

Here is the Project with code and images

rapidshare.com/files/23018049/Proj.rar

thxs in advance.








Replies

Replied 27 Mar 2007 15:21:49
27 Mar 2007 15:21:49 Lee Diggins replied:
Hi Clarence

The value of your first radio button is 1.asp, not what you'd want me thinks, you probably want anniversary1_.jpg.

Clarence, don't email me again unless invited. You've 1 posting in this forum and no history here, you post one thread and email me within minutes, this equals rude. <img src=../images/dmxzone/forum/icon_smile_dissapprove.gif border=0 align=middle> Myself and others are not here to help when anyone demands it, the responses and help provided by contributors on this forum are voluntary.

Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
Replied 27 Mar 2007 16:55:11
27 Mar 2007 16:55:11 clarence dmello replied:
sorry for mailing u but i ned to complete my project within this week so a little tensed.now moving on with the problem

when i insert anniversary1_.jpg the output is as folows

Your favorite card is: anniversary1_.jpg

i need to display the image on the screen not its name.

so plz try and configure it out.
Replied 27 Mar 2007 17:32:20
27 Mar 2007 17:32:20 Lee Diggins replied:
Hi Clarence

All you're doing is writing the value passed by the form, you need to add the img tag:

&lt;% If cards &lt;&gt; "" Then
&lt;p&gt;Your favorite card is: &lt;img src="anniversary_files/&lt;%= cards %&gt;" &gt;&lt;/p&gt;
&lt;% End if%&gt;



Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
Replied 27 Mar 2007 18:41:36
27 Mar 2007 18:41:36 clarence dmello replied:
yes Lee Diggins , i got it , i was writing the value passed by the form.

i have added a image tag and now it works .

thxs Lee Diggins for your help

dmxzone rocks.

thxs again.

Reply to this topic