php - Simple website won't open image on desktop using __DIR__ -


<!doctype html> <html> <head>     <title>this hello world page</title>  </head> <body>     <h1>hello world</h1>     <img src= "<?php echo __dir__ .'/pic.png' ?>">  </body> </html> 

i can't figure out why code isn't showing image. made sure name file .php extension , put both files in same folder (the desktop).

the eventual goal upload entire folder server. within folder, there index.php file , image. how can point file image?

if pic.png in same directory, work.

<img src="pic.png"> 

also, move img tag body.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -