0

My friend is storing HTML code in mysql as follows:

Record1:

"<p><img alt="""" src=
""//d2vlcm61l7u1fs.cloudfront.net/media%2F60d%2F60d9494b-6bb4-469a-95ab-e63f26178a30%2FphpYB17Ai.png""
style=""height:720px;"" /></p>
"

Record2:

"<p><img alt="""" src=
""//d2vlcm61l7u1fs.cloudfront.net/media%2F930%2F9300b2a0-772f-43fb-8e0d-2a4faa1145b7%2FphpiOcEAN.png""
style=""height:720px;"" /></p>
"

Record3:

 "<p><img alt="""" src=
""//d2vlcm61l7u1fs.cloudfront.net/media%2Ffd0%2Ffd0ac431-1c24-4b25-a481-b70550546be7%2Fphp8HyrtS.png""
style=""height:720px;"" /></p>
"

I am trying to view the above pics in single HTML page, but I copied the above into html file and see, it is showing as blank or only double quotes. I tried to replace the double time double quotes with single time double quotes, even then not able to see.

surpavan
  • 1,372
  • 7
  • 34
  • 66
  • 1
    This is because you trying to view them from a local file. See my answer here: http://stackoverflow.com/questions/33307282/connecting-to-external-server-for-html5-app/33310468#33310468 – Anton F Oct 24 '15 at 06:07
  • 1
    Also check out [this](http://stackoverflow.com/a/7818464) answer too. Basically it's what Anton has already linked too, you can't exclude http or https if you plan on viewing the content locally. – Dave Chen Oct 24 '15 at 06:14

2 Answers2

1

Put them in the full html code and save it to a .Html file.

<html>
<body>
<!-- paste code snippets below here with single instance double quotes -->
<p><img alt="" src="http://d2vlcm61l7u1fs.cloudfront.net/media/60d/60d9494b-6bb4-469a-95ab-e63f26178a30/phpYB17Ai.png" style="height:720px;" /></p>
</body>
</html>

You may also want to put the urls through a url decoder. You can find one online. In your case you have %2f which is a forward slash. So replace %2f with forward slash (/). My updated code works now.

Also as @antonF said you need to add http: if you are accessing as a file.

ajon
  • 7,868
  • 11
  • 48
  • 86
0

There are multiple problems in those html snippets.

  1. The double quotes are over used.

src=""http://www.google.com/favicon.ico"" this will never work

src="http://www.google.com/favicon.ico" but this will

  1. You are giving the image with a wrong url format // for a local file. Please prefix it with http: if you want it to work anywhere.

Try this anywhere now

<p><img alt="" src=
"http://d2vlcm61l7u1fs.cloudfront.net/media%2F60d%2F60d9494b-6bb4-469a-95ab-e63f26178a30%2FphpYB17Ai.png"
style=""height:720px;"" /></p>
Charlie
  • 22,886
  • 11
  • 59
  • 90