Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scalers within <img src...?

Status
Not open for further replies.

ScoobyDood

Programmer
Jun 10, 2002
15
US
Please help. When I try to put a scaler within an <img src...> tag it takes out the scaler! Have a look:

#Script

$imageNumber=$cgiobject->param(&quot;number&quot;);

print &quot;<img src='
#End Script

When I view the source of my page it looks like this:

<img src='
Please help! Computers - Can't live with 'em, can't live without 'em! Check this out:

 
I'd bet that perl is interpreting $imageNumber_image as the name of a variable, not as the value of $imageNumber concatenated with the string &quot;_image&quot;.

Try it as an explicit concatenation:

print &quot;<img src=' ______________________________________________________________________
Don't say thanks. Just award stars.
______________________________________________________________________
 
You can also get around this problem by putting braces around the actual variable name.
Code:
print &quot;<img src='[URL unfurl="true"]http://www.mysite.com/images/main/${imageNumber}_image.gif'>&quot;;[/URL]

jaa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top