Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $s = $_SERVER['SERVER_NAME'];
- $a = explode('/', $_SERVER['PHP_SELF'], 3);
- $completeURL = "http://".$s."/".$a[1];
- <img src="<?php echo $completeURL; ?>/images/img.png" alt="">
- <img src="<?php echo $completeURL; ?>/images/img.png" alt="">
- <?php
- define('URL_WEBSITE_COM', 'http://example.com');
- // y otra especialmente para imágenes por ejemplo:
- define('URL_IMAGE', 'http://example.com/images/');
- <img src="<?php echo URL_IMAGE; ?>img.png" alt="">
- <a href="<?php echo URL_WEBSITE_COM; ?>/Foo">Bar</a>
Add Comment
Please, Sign In to add comment