Results 1 to 4 of 4
September 11th, 2006, 01:16 PM #1Can figure out why image is not showing
A friend gave me a php script which pulls random products from my db table on my domain and displays them. Everything seems to be working, except this code:
echo "<td width=\"100%\"><a href=\"".$Link."\" target=\"_new\"><img src=\"$BigImage\" align=\"left\" width=\"150\" height=\"150\" border=\"0\" alt=\"$Name\"></a></p><br>\n";
That's just part of the code to display the image and use it as part of a link to the merchant's site. When it displays in the browser, it shows the "place holder" box with a blank outline and the little red "x" where the image should be. When I use "View Source" in my browser, this is what's showing up for that code:
<a href="http://www.shareasale.com/m-pr.cfm?merchantID=XXXX&userID=XXXX&productID=XXXX" target="_new"><img src="" align="left" width="150" height="150" border="0" alt="Name of Product"></a></p><br>
(NOTE: I have "Xed" out the merchant ID, product ID, and substituted "Name of Product" in the alt tag for privacy purposes.)
I'm ridiculously frustrated by my lack of knowledge regarding HTML, XHTML, MySQL, and PHP, or I would probably be able to figure out why the source says <img src="" instead of showing a link to the image. (But I'm studying and learning!)
I've checked my database table and the "BigImage" field is there, is populated. If I copy and paste the URL under "BigImage" field into my browser, they go perfectly to the image at the merchant's site every time.
Heck, if I click on the blank image/placeholder in my browser, the link goes to the merchant AND shows the image on the merchant's site just fine.
Probably a simple answer.
Thanks in advance to anyone who can help!
BIG OOPS FOR ME!
I went back to the instructions my friend sent along with the script, and by golly if I didn't find a line earlier in the script which needed to be uncommented.
Works fine now. sorry about that!!
EDITED TO ADD BIG OOPS FOR ME!
Last edited by writerguy; September 11th, 2006 at 01:27 PM.
September 11th, 2006, 01:27 PM #2
you left out the . before and after the $BigImage var.
September 11th, 2006, 01:40 PM #3
September 11th, 2006, 01:55 PM #4
Uh, Okay, now it's working. But if I put the . in before and after $BigImage, it breaks again.
Don't understand why, but it works just fine for me WITHOUT the . so it'll have to go without.
Gary (feeling a bit like a big dummy for not being able to read and follow directions to start with!!)
By mayfly in forum WebMerge (Fourthworld.com)Replies: 7Last Post: March 16th, 2007, 04:50 PM
By ~Michelle in forum Midnight Cafe'Replies: 2Last Post: February 26th, 2004, 12:20 PM
By ahugedeal in forum Programming / Datafeeds / ToolsReplies: 9Last Post: September 24th, 2003, 06:29 AM