FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


consistently get different script errors when logged in





boinsterman
I consistently get different script errors when logged in, especially for php scripts.
For example, http://worldthinker.frihost.org/phptest.php is just a phpinfo() page (with 755 permissions), but I get a blank page when I click on the link for that page from within File Manager. Other examples are much more complicated. Is this only for PHP or for all server-side scripting? Is there a way to change the url of the page links so we would see the same thing a user sees?
badai
your phpinfo look fine to me.
Peterssidan
If you open a file from the file manager in the control panel it will display the file without running the PHP code. Look at the source code (Ctrl+U in most browsers) and you will see that the PHP tags are still there.
boinsterman
I had noticed that the php code does sometimes get included in the final document, but I thought that was a separate issue. I do not find it a useful feature, especially as I spent a lot of time on the apparent errors.

Can we change the php or file manager settings for this? I would like the php code to work, or have a direct link in the file's row to the document as a user sees it. Otherwise, I have to delete the extra info from the logged-in url after I call up the document, and this is kind of a time-wasting pain in the neck.
Peterssidan
I don't think you can make it link to the public URL. The file manager doesn't really know what paths can be used to access the document. It might be several possible paths or none at all.

I don't understand when you say you have to delete the extra info from the logged-in url. The file manager is a way to handle your files. It's not meant as a way to view your site. Visitors will never see the logged-in url. If you want to view your site, simply us the public URL.
boinsterman
By "logged-in url", I mean
http://worldthinker.frihost.org:2222/CMD_FILE_MANAGER/domains/worldthinker.frihost.org/public_html/codeexamples/asqltest.php.

By "what the user sees", I mean
http://worldthinker.frihost.org/codeexamples/asqltest.php. This is apparently what you mean by "public url".

To turn the first into the second, I delete ":2222/CMD_FILE_MANAGER/domains/worldthinker.frihost.org/public_html" from the url. My point is that it is time-consuming (to an extent) if I must do so at all, such as when it is the only file I am working in and is easier to access from File Manager.
Peterssidan
Do you actually edit your files in the DirectAdmin File Manager? It's not really a pleasant text editor to use.

Anyhow, I created a greasemonkey/user script that you can install if you want.
Code:
// ==UserScript==
// @name        Improved File Manager Links
// @include     http://worldthinker.frihost.org:2222/CMD_FILE_MANAGER/domains/worldthinker.frihost.org/public_html*
// ==/UserScript==

var rows = document.getElementsByTagName("tr");

for (var i = 0; i < rows.length; ++i)
{
   var cells = rows[i].getElementsByTagName('td');
   if (cells.length >= 2)
   {
      var links = cells[1].getElementsByTagName('a');
      if (links.length > 0)
      {
         links[0].href = links[0].href.replace(/.*public_html/i, 'http://worldthinker.frihost.org');
      }
   }
}


I can't promise it works perfect and I don't know if there are any version incompatibilities between the servers. You can still use the old links by pressing the icons, which you will have to do to change directory.
boinsterman
Thanks, Peterssidan. I might try putting it in a javascript code library.

Yes, I do use that editor for small files, or sometimes HTML if I don't have trouble finding an error. I find it convenient. But if for larger ones, I use a line editor which shows line numbers like the XML editor "editx". Copying and pasting them into the DirectAdmin editor is another pain in the butt. But I haven't tried ftp for several years.
Peterssidan
Instead of copy pasting you can use the button at the bottom that says "Upload files to current directory". After you have uploaded the file(s) you can simply refresh that page if you want to upload the same file(s) again. Very convenient if you want to make changes and test it multiple times before you getting it right.
boinsterman
I tried it. It worked ok, but still requires several steps. (1-->Save the file from the editor to my computer,2-->Click on the "Upload files to current directory",3-->Click on the "Choose..." button and choose the file to upload,4-->Click on the "Upload files" button, 5-->Click on the "here" link in "Click here to go back" to get back to the directory in File Manager I started from.)

What I like about about DirectAdmin is that to save the files from the editor requires only a single click.

I'll probably do some time studies where I copy and paste from the editor on my computer to the editor in File Manager and saving from there. From my experience so far, it looks like they will take about the same amount of time.

I already refresh the public url once I have the page open in a tab the way I want it.

I'm also working on an online editor like the one in DirectAdmin but which displays the line numbers. Yes, I know that a lot of others are doing the same, and I still have a few bugs to work out. Also, I haven't even started to tackle displaying text in different styles according to function. (I'm not even sure if it's possible in a textarea.) But it seems like it would be a good idea to improve the DirectAdmin editor so it works like a typical line editor.

Another issue is that I often have about 20 tabs open at a time. Using the editor on my computer could work well in the way you suggest for the purpose, providing I can keep track of the corresponding pages in both my editor and the browser. I think it will likely take some practice, but at least the tabs will be wider and show more of the text. The copy and paste method would not work well, because it would require a third page open (for the DirectAdmin editor in the browser) for each file, and would need a lot more memory. (The computer I am on now is pretty old and does not have a lot of memory. I'm shopping around for another.)
Related topics
Interner Explorer Aborts!!
Community builder help!
Which messenger do you use?
How to stop "Script Debugger" Error Message in IE
Sorry to break a forum rule. A new language thread.
check out my website pls
Could this be installed ?
Question About Drop-Down search buttons
403 Forbidden
Can I have some help with scripts for postmysite.frih.net
File upload class problem.
PHP 5.0.0
php 5.x supported?
Tomahawk Design
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.