0

Hi I'm new in PHP and for now, I'm working on a website for myself (using: HTML, CSS, bootstrap, PHP)

but when I'm testing the website in the tools.pingdom.com this is the image of the warning says:

"Serve the following static resources from a domain that doesn't set cookies"

and because of this gave me a bad grade, you can see the code in the button, it's a very simple code

<img src="source/<?php echo img; ?>" alt="1.jpg" class="img-thumbnail">

what should I do to solve this problem, and how should I serve dynamic data

THANK YOU

obeidarash.ir

  • Possible duplicate of [How to solve \[Serve the following static resources from a domain that doesn't set cookies\]](http://stackoverflow.com/questions/37759077/how-to-solve-serve-the-following-static-resources-from-a-domain-that-doesnt-se) – mehulmpt May 05 '17 at 18:38
  • 1
    I think you missing to add $ sign to img. Could you please try to that code :1.jpg – rowmoin May 05 '17 at 18:42

1 Answers1

0

Could you please try that code :

<img src="source/<?php echo $img; ?>" alt="1.jpg" class="img-thumbnail">

And one more important thinks that message is suggesting that if your website is www.test.com, then you should load static content from www.companycdn.com. And that new site (www.testcdn.com) is a simple static website that does not serve cookies. To do this, you need to upload your static resource (e.g. images) to the second domain. And then update the paths of images to the new domain. For example, instead of this: <img src="logo.jpg"/>, you should change it to this <img src="http://www.companycdn.com/logo.jpg"/>

rowmoin
  • 698
  • 2
  • 8
  • 17
  • I forgot the $ sign in here but in my code I have it –  May 05 '17 at 18:45
  • And there are also missing PHP ending tag properly it will be ?> – rowmoin May 05 '17 at 18:46
  • the images are working correctly my problem is how should I serve dynamic data –  May 05 '17 at 18:51
  • That message is suggesting that if your website is www.company.com, then you should load static content from www.companycdn.com. And that new site (www.companycdn.com) is a simple static website that does not serve cookies. To do this, you need to upload your static resource (e.g. images) to the second domain. And then update the paths of images to the new domain. For example, instead of this: , you should change it to this – rowmoin May 05 '17 at 19:01
  • well how should I upload data from this domain to another domain, please can you write the code for me? –  May 06 '17 at 09:42