Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: How do you change the picture displayed?

by knobunc (Pilgrim)
on Mar 22, 2002 at 15:05 UTC ( #153569=note: print w/ replies, xml ) Need Help??

in reply to How do you change the picture displayed?

first off your page will not include the values from your arrays because it looks like your are relying on string interpolation to get the stuff displayed (e.g. $disc$prod), but your string is in single quotes which forbid interpolation and you don't want to use double quotes since they are in the string. You have a couple of choices here:

# You can change the quote character using the # qq operator (there is an equivalent q operator # for use when you want to replace single quotes print qq'<html><head></head><body bgcolor="#C0C0C0"> ... '; # You can use any character after qq and things # that logically pair like () or {} can be used: print qq{<html><head></head><body bgcolor="#C0C0C0"> ... }; # Or you can use a here document to include a chunk # of stuff. The double quotes tell it to allow # interpolation. Note you can replace EOF with # anything you want, but it must appear at the # start of a line and there must be nothing # following it on the line. print <<"EOF"; <html><head></head><body bgcolor="#C0C0C0"> ... EOF

With regards to your question about images, you probably just want to store the URL of the image (or a fragment of it) and use that in an <img> tag:

# Up at the top my @image = ('HSDIT001.jpg', 'HSDIT002.jpg', 'HSDIT003.jpg', ...); # Then down in your page body in the table cell you # wanted the image in: <img src='images/$image[$prod]'>


Comment on Re: How do you change the picture displayed?
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://153569]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2016-05-01 00:15 GMT
Find Nodes?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW

    Results (441 votes). Check out past polls.