@FreeJoy
Most of the problems I had when developing locally and then uploading was paths and passwords, etc. To prevent having separate files with the same name for localhost and online I came across this neat solution:
PHP Code:
<?php
defined('LOCALHOST') ?: define('LOCALHOST', 'localhost' === $_SERVER['SERVER_NAME']);
if( LOCALHOST )
{
// Necessary to remove DRIVE letter
define('PATH_INDEX', substr(getcwd(),2)) .'/';
define('PATH_ASSETS', '.assets/');
define('PATH_IMAGES', '/xamp-lite/xampp/htdocs/afiles/images/');
define('PATH_THUMBS', "/subdomain/thumb/");
}
else
{
define('PATH_ASSETS', '/home/content/77/123456/html/assets/');
define('PATH_IMAGES', '/home/content/77/123456/html/xy_john/afiles/images/');
define('PATH_THUMBS', '/home/content/77/123456/html/subdomain/thumb/');
}
?>
<!-- common links can be used on same file for both localhost and online -->
<a href='/file-with-image-123.jpg'>
<img
src = '<?php echo PATH_THUMBS;?>thumb-123.jpg'
style = 'width:88%; max-width:123px'
alt='#'
/>
</a>
Bookmarks