Click to See Complete Forum and Search --> : Problem with a print statement in a cgi script


TheIceman5
August 18th, 2002, 07:40 AM
ive written up a cgi script that will print a few lines of html on a page and suppose to show an image. what it does is change the html around and im ****ed if i know why.

This is what the html is suppose to look like on the page.

<a href="popup.cgi?image=2&id=test" onMouseOver="MM_displayStatusMsg('Click to Enlarge Photo');return document.MM_returnValue"><img src="../adimages/test_2_tn.jpg" width=175 height=106 border=0></a><br>

what it looks like after the cgi script has printed it on a page is

<a href="popup.cgi?image=2&id=test" onMouseOver="MM_displayStatusMsg('Click to Enlarge Photo');return document.MM_returnValue"><!-- src="../adimages/test_2_tn.jpg" width=175 height=106 border--></a><br>

Note the <img src= tag, the img part is replaced with !-- for some **** knows reason. also at the closing tag there is now a -- added there and the =0 at the end of 'border' is missing.
So when its on a page it doesnt display any image of any sort.
Anyone know how to fix this cause ivce played with it for hours and gotten no where.

also in the cgi script im using the print q~ ~; to print the html so it reads

print q~<a href="popup.cgi?image=2&id=test" onMouseOver="MM_displayStatusMsg('Click to Enlarge Photo');return document.MM_returnValue"><img src="../adimages/test_2_tn.jpg" width=175 height=106 border=0></a><br>~;

TheIceman5
August 18th, 2002, 08:50 AM
now this is absolute Bull and does not make a single bit of sense to me. This is how i fixed it and it worked, i noticed i had an image displaying on the page that was located in a different folder at the same level as the folder that wont display the images.
if you look above you will see i have the images in a folder "../adimages" and they do not work, ive checked the capitalisation, ive copied and pasted the foldername from the server to the script and still no go, i rename the folder to "../images" and it works fine, the images display and the link when you click on image works.

Will someone explain this absolute piece of crap to me as why it didnt work when i had the images in the 'adimages' folder and started working when i renamed it to 'images' ??

****ing load of crap if you ask me and makes no sense what so ever. I changed nothing else except the path in the script and renamed the folder.

TheIceman5
August 20th, 2002, 02:28 AM
come on, someone must have an answer.