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()); ?> Quote Link to comment 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). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.