noober Posted January 27, 2008 Share Posted January 27, 2008 I have this line in my php file, and it should point to the server path of the file. I'm using the basic package at register.com for hosting, and believe it is not virtual hosting. But, I can't seem to find the correct path. Is there php I can implement to return a path to me so I don't have to go on guessing what it is, then having it not work? Or could there be other problems? I'm keeping this in a password protected .htaccess folder which I can't configure the path for either. I'm stumped. Help would be greatly appreciated. The php file should refer to the sell.txt file which is located in the primary directory "public" folder, where index.html....files that can be viewed by everyone is kept. <?php $file = 'user/local/public/sell.txt'; Link to comment https://forums.phpfreaks.com/topic/88051-solved-server-location-for-php-filehtaccess-wont-link-up-either/ Share on other sites More sharing options...
Bauer418 Posted January 27, 2008 Share Posted January 27, 2008 $_SERVER['DOCUMENT_ROOT'] should get you to the public_html directory of your site. Link to comment https://forums.phpfreaks.com/topic/88051-solved-server-location-for-php-filehtaccess-wont-link-up-either/#findComment-450477 Share on other sites More sharing options...
noober Posted January 27, 2008 Author Share Posted January 27, 2008 <?php $_SERVER['DOCUMENT_ROOT'] ?> I used this code. I tried it on another server that's virtual....1and1, and it returns a error telling me the directory. For register.com it doesn't return anything but a blank page. Any ideas? Link to comment https://forums.phpfreaks.com/topic/88051-solved-server-location-for-php-filehtaccess-wont-link-up-either/#findComment-450485 Share on other sites More sharing options...
Bauer418 Posted January 27, 2008 Share Posted January 27, 2008 You need to echo $_SERVER['DOCUMENT_ROOT'] to see if that's where your files are stored, then you can use it in your scripts (assuming it's correct). Link to comment https://forums.phpfreaks.com/topic/88051-solved-server-location-for-php-filehtaccess-wont-link-up-either/#findComment-450488 Share on other sites More sharing options...
noober Posted January 27, 2008 Author Share Posted January 27, 2008 I was wondering if I implemented that wrong. I've been trying day and night searching for a solution. Everything works great now. Thank you so much! Link to comment https://forums.phpfreaks.com/topic/88051-solved-server-location-for-php-filehtaccess-wont-link-up-either/#findComment-450508 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.