visitor Posted November 21, 2009 Share Posted November 21, 2009 Hi, I've got pictures in a separate folder named photos. I'm trying to link it as follows... slsContents[0] = "<img src=\photos\"ip2803-017.jpg\" width=\"512px\" height=\"384px\">"; unfortunately this doesn't work. Does anybody know how this might work, please? Thanks visitor Link to comment https://forums.phpfreaks.com/topic/182439-pictures-in-separate-folder/ Share on other sites More sharing options...
haku Posted November 22, 2009 Share Posted November 22, 2009 Look at the HTML output of that code, and you will probably see right away. You have some error in your logic. Always remember, it's not the php input that renders, it's the HTML output. Link to comment https://forums.phpfreaks.com/topic/182439-pictures-in-separate-folder/#findComment-962906 Share on other sites More sharing options...
nomadrw Posted November 22, 2009 Share Posted November 22, 2009 Quote Hi, I've got pictures in a separate folder named photos. I'm trying to link it as follows... slsContents[0] = "<img src=\photos\"ip2803-017.jpg\" width=\"512px\" height=\"384px\">"; unfortunately this doesn't work. Does anybody know how this might work, please? Thanks visitor it should like like this slsContents[0] = "<img src=photos\"ip2803-017.jpg" width="512px" height="384px">" damon Link to comment https://forums.phpfreaks.com/topic/182439-pictures-in-separate-folder/#findComment-962908 Share on other sites More sharing options...
haku Posted November 22, 2009 Share Posted November 22, 2009 That's still not right. Link to comment https://forums.phpfreaks.com/topic/182439-pictures-in-separate-folder/#findComment-962910 Share on other sites More sharing options...
visitor Posted November 22, 2009 Author Share Posted November 22, 2009 Hi, Please see below what the developer wrote... //--------------------------------------------------------------------------------------------------------- // CONTENTS //--------------------------------------------------------------------------------------------------------- // Insert your contents here. Example: // // slsContents[0] = "This is the first page."; // slsContents[1] = "This is the second page."; // slsContents[2] = "Here's an image:<br><img src=\"path/to/image\">"; // ... // // - You can use HTML-tags. // - Escape all quotation marks inside your contents with a backslash (\"). // - Use tables or CSS to set a padding where needed. I tried this... but it still doesn't work (so you're right haku) slsContents[0] = "<img src=photos\"ip2803-017.jpg\" width=\"512px\" height=\"384px\">"; visitor Link to comment https://forums.phpfreaks.com/topic/182439-pictures-in-separate-folder/#findComment-963061 Share on other sites More sharing options...
haku Posted November 22, 2009 Share Posted November 22, 2009 I'll repeat myself: Quote Look at the HTML output of that code, and you will probably see right away. You have some error in your logic. Always remember, it's not the php input that renders, it's the HTML output. hint: <img src="path/to/file.jpg" /> Link to comment https://forums.phpfreaks.com/topic/182439-pictures-in-separate-folder/#findComment-963063 Share on other sites More sharing options...
visitor Posted November 22, 2009 Author Share Posted November 22, 2009 Hm, according to the developer it should look like this... so is he wrong? // slsContents[2] = "Here's an image:<br><img src=\"path/to/image\">"; Link to comment https://forums.phpfreaks.com/topic/182439-pictures-in-separate-folder/#findComment-963075 Share on other sites More sharing options...
haku Posted November 22, 2009 Share Posted November 22, 2009 No, he's right. You haven't followed his pattern. Link to comment https://forums.phpfreaks.com/topic/182439-pictures-in-separate-folder/#findComment-963096 Share on other sites More sharing options...
visitor Posted November 22, 2009 Author Share Posted November 22, 2009 Hi haku, Yes, you're absolutely right! Now it works smoothly... slsContents[0] = "<img src=\"photos01/ip2803-017.jpg\" width=\"512px\" height=\"384px\">"; Thanks again for your help visitor Link to comment https://forums.phpfreaks.com/topic/182439-pictures-in-separate-folder/#findComment-963462 Share on other sites More sharing options...
haku Posted November 23, 2009 Share Posted November 23, 2009 There you go mate! For future reference, you should check the html output. When you are looking at the page, choose 'view source', and you can see what is happening. You would have noticed the quotes in the middle of the path right away. Link to comment https://forums.phpfreaks.com/topic/182439-pictures-in-separate-folder/#findComment-963678 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.