djcochran Posted May 1, 2009 Share Posted May 1, 2009 I discovered a program online that lets you view HTML and PHP source code, but I'm having a problem with it. I'm supposed to upload the file sourceviewer.php to my server, and then open that file in my browser. It then shows a text box where you enter the url of the page you want to view the source of and it is supposed to show it to you. I'm having a problem with that. It says you need to have sourceviewer.php in the same directory as the pages you want to view (and I do!) but I can't get it to work. For example, the url for it in http://cs-sun2000.uscupstate.edu/~student5/sourceviewer.php and I try to view the file http://cs-sun2000.uscupstate.edu/~student5/index.php, but I get this message "The file to be viewed must be located on the server hosting cs-sun2000.uscupstate.edu. The file /~student5/index.php does not appear to be a valid file on this host." I've also tried modifying the php code in sourceviewer.php to include other directories (I even tried adding /export/home/student5 as it is in the web server), but still nothing. Anyone ever worked with this or know what to do? I would really like to use this program. SourceViewer Website - http://www.softswot.com/sourcehelp.php Quote Link to comment https://forums.phpfreaks.com/topic/156450-anyone-used-source-viewer-before-need-help/ Share on other sites More sharing options...
gnawz Posted May 1, 2009 Share Posted May 1, 2009 Probably your copy is corrupted. Download another one. Make sure all is well too in the server as regards folder placement Quote Link to comment https://forums.phpfreaks.com/topic/156450-anyone-used-source-viewer-before-need-help/#findComment-823768 Share on other sites More sharing options...
djcochran Posted May 1, 2009 Author Share Posted May 1, 2009 Hmm...well everything is in the correct folder (I assume). I've tried moving some files around (like moving index.php up one folder) and accessing it, but it wouldn't let me because the two files were not in the same directory. So I'm pretty sure that's working right... Quote Link to comment https://forums.phpfreaks.com/topic/156450-anyone-used-source-viewer-before-need-help/#findComment-823772 Share on other sites More sharing options...
trq Posted May 1, 2009 Share Posted May 1, 2009 Even there demo (here) does the same. Could just be crap software. Quote Link to comment https://forums.phpfreaks.com/topic/156450-anyone-used-source-viewer-before-need-help/#findComment-823822 Share on other sites More sharing options...
PFMaBiSmAd Posted May 1, 2009 Share Posted May 1, 2009 The http://example.com/~user/ syntax is a URL rewriting thing that maps that URL to the real user directory. The script you are using is stripping off the path part of the URL and assumes that there is a valid file system path by that name starting at the document root folder, which there is not. You would need to give it a URL that contains a path that does match the actual user directory (even if that URL is not actually valid) so that after it strips off the path part it will get the actual file system path that is needed to access that user directory. Since the actual user directories are probably not directly accessible using a file system path, you will probably find that you cannot access other students user directories this way and should give up. Quote Link to comment https://forums.phpfreaks.com/topic/156450-anyone-used-source-viewer-before-need-help/#findComment-823850 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.