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 - Autoloader issue not returning Class -

java - How to put two numbers separated by a space into two different arrays -

python - matplotlib equivalent for Ubuntu servers with no GUI? -