Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 7th, 2003, 04:26 AM
Registered User
 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pictures in HTML

Hi,
I am trying to create a link between two pages passing the name of the picture. The linked page will then display the picture. The first page has the following code:
<A HREF="picture1.html?pic=party001.jpeg"><IMG HSPACE=20 SRC="partypictures/Party001tn.JPG"> </A>

and the linked page has the following code:

<center>
<% DIM Picture As String
   DIM PicSrce1 As String = "partypictures/"
   DIM PicSrce2 As String
   Picture = Request.QueryString("pic")
   PicSrce2 = PicSrce1 & Picture
%>
<H1>Harp, Sarah and Reuben's Party</H1>


<IMG SRC=PicSrce2> <BR />


<A HREF="party.html">Back</A> <A HREF="index.html">Home</A>

</center>

But I cannot get it to work. Any suggestions.

Thanks for the help.

Harp
 
Old October 7th, 2003, 05:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
Try:
<img src="<% =PicSrce2 %>" /> <br />

(BTW, note use of lowercase elements and attributes, double quoting of attribute values and " />" delimitert on img tag - I don't mean to sound smart, or anything, but might as well, since you use XHTML-style markup on the <br /> tag to denote "no content".)

(BTW, also, this is an ASP question ;)

HTH
Dan
 
Old October 7th, 2003, 05:15 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

I would guess that your problem is here:
<IMG SRC=PicSrce2>
It looks from what you posted that this will be literally written to the browser (have you looked at the source in the browser?) - but you want the value that is stored in the ASP variable PicSrce2 to be writen to the browser. So you need <IMG SRC="<%=PicSrce2%>">.

One other thing, the link <A HREF="picture1.html?pic=party001.jpeg"> is to an HTML page - do you have the server set up so that the ASP engine processes html files too? If not, you will need to link to a file with an .asp extension.

If you are still stuck, view the source of the page in the browser and post that here. Also try to elaborate a bit on the symptoms - just saying "I cannot get it to work" isn't very helpful.

rgds
Phil





Similar Threads
Thread Thread Starter Forum Replies Last Post
Display many pictures NBM Java GUI 0 September 3rd, 2006 06:54 AM
Displaying pictures louie001 ASP.NET 1.0 and 1.1 Basics 2 November 24th, 2005 04:11 PM
Pictures mani_he Pro PHP 5 October 28th, 2004 09:03 PM
imbedding pictures into HTML c_bananas HTML Code Clinic 2 September 18th, 2003 01:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.