seasexsun Posted November 28, 2007 Share Posted November 28, 2007 If I had a website structured like this ---> http://www.domain.com and the directory was "image-gallery" and I wanted to have the images save to the folder on my domain under the directory "image-gallery", how would I change the webroot as shown in this script below, and would I add ../ to the script or just ./? Thanks if anyone can help me. I'm new at this, and this is from a tutorial... <?php session_start(); // db properties $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $dbname = 'gallery'; // an album can have an image used as thumbnail // we save the album image here define('ALBUM_IMG_DIR', 'C:/webroot/gallery/images/album/'); // all images inside an album are stored here define('GALLERY_IMG_DIR', 'C:/webroot/gallery/images/gallery/'); // When we upload an image the thumbnail is created on the fly // here we set the thumbnail width in pixel. The height will // be adjusted proportionally define('THUMBNAIL_WIDTH', 100); // make a connection to mysql here $conn = mysql_connect ($dbhost, $dbuser, $dbpass) or die ("I cannot connect to the database because: " . mysql_error()); mysql_select_db ($dbname) or die ("I cannot select the database '$dbname' because: " . mysql_error()); ?> Link to comment https://forums.phpfreaks.com/topic/79183-webroot-and-directory-problem-in-php/ Share on other sites More sharing options...
deadimp Posted November 28, 2007 Share Posted November 28, 2007 What do you mean by adding . or .. to the script? If you're talking about directory listing, I don't see any code that does that. And a tip: Try to keep your directories relative, to make it easier for cross-platforming. If not that, then at least use standard directory conventions (posix/unix/whatever-style). Link to comment https://forums.phpfreaks.com/topic/79183-webroot-and-directory-problem-in-php/#findComment-400846 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.