php - Can't get to link so image using constants -


why can find image when use ?

defined("prod_images") ? null :  define("prod_images", realpath(dirname(__dir__) .  "/public/images/")); $product_image = prod_images . $image;    <img src="<?php echo prod_images; ?>" alt=""> 

please try:

absolute path:

 <img src="http://www.yourdomain.com/images/<?php echo $image; ?>" alt=""> 

or relative website root:

 <img src="/images/<?php echo $image; ?>" alt=""> 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -