Jump to content

Anyone Used Source Viewer Before? Need Help!


djcochran

Recommended Posts

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

 

 

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.