markc
Members-
Posts
12 -
Joined
-
Last visited
Everything posted by markc
-
Bruce, I am uploading cgi & php scripts that I want to remain as secure as possible. I also don't want my user name and password to be intercepted. I have FTP applications that can use secure FTP and I have been hoping TCH would purchase/install secure FTP. Mark
-
I would love to have secure FTP. Having to upload files using secure cPanel is a pain. Using an unsecure FTP application can be scary. I hope having "secure FTP" is not related to SSH, which I know TCH had to stop using. More Smilies would be nice! Mark
-
Turtle, I added the suggested line to my .htaccess file and it did get rid of the php parse error. But it then eliminated the login security screen from coming up. The web page is displayed without first making you log into the system using a user name and password. It also caused other problems on the displayed web page. Like my cgi counter (bscounter) did not show up. And some centering of links and buttons (images) done with CSS did not get centered at all. Also some unwanted symbols related to a xml declare line showed up on the web page. But maybe your suggestion is a start on what to modify or test to find a solution. The reason I had to use "index.php" in the protected folder as opposed to "index.html" is because my browser (Netscape) and also while using Internet Explorer did not know what to do with the index.html file. The browser asked me if wanted to save a file instead of serving the web page. It did not recognize a ".html" file. Maybe because of the aMember protection include. Mark
-
I am using the great php script - aMember for password protection of a directory. I am using the Protection Plugin: php_include with auto_prepend. I created a directory called "protected" in my public_html directory. I then created a simple single web page for testing purposes. The web page works very well in my protected directory. Here is the code for the web page: ><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html> <head> <title>Test</title> </head> <body> <p>It worked!</p> <p><a href="../amember/plugins/protect/php_include/logout.php"><b>Logout</b></a></p> </body> </html> But when I added the line: ><?xml version="1.0" encoding="US-ASCII"?> to the top of the html code (because my future web page will include xml code) and try to access the web page I get a php parse error: >Parse error: parse error in /home/../public_html/protected/index3.php on line 1 . Here is what is in my .htaccess file (of the protected directory): >AddType application/x-httpd-php .html AddType application/x-httpd-php .htm php_value auto_prepend_file protect.inc.php I also happen to have a .htaccess file in my public_html directory. Does anyone know why when I add the one xml declare line to the top of my html web page that I get a php parse error? Is my server not setup to allow for using xml in a "protected" directory? Thanks Mark
-
For the Macintosh (us 3% 'ers Thumbs Up ) - I have used Transmit (Panic, Inc.) in the past. But I have recently used Fetch http://fetchsoftworks.com/ which allows for the changing of file permissions. Now my favorite FTP client to use is Captain FTP http://captainftp.com/. It too allows you to change file permissions.
-
John, I too am having problems changing file permissions for folders using the file manager and cPanel. This happened within the last couple of hours for me. I submited a help ticket about a half hour ago. I am on server 36. Mark
-
Alan and anyone else, Success (with one of the scripts)! Thumbs Up The author of BScounter was nice enough to try and fiqure out what was wrong with my script - gd-count.cgi. He said he could not reproduce my problem but he was able to see the counter numbers on his computer system and browser using the gd-count.cgi script on my server. See the file at: http://www.mectjv.com/cgi-bin/bscounter/test.html. When I viewed this test.html file all I got was a broken image. In my server error log it would only say "premature end of script headers". I use a Mac running Mac OS 10.2.6. I also use Netscape 7.1. So I also tried viewing the test.html file with MS Internet Explorer for Mac and I got the same thing. I then tried viewing the test.html file on my wife's IBM notebook running Windows 2000 and Internet Explorer for Windows. I was able to see the blue counter numbers with that system. So I thought it might be Mac or a Netscape problem. I then decided to try working with the SSI version - count.cgi of the Perl script. When I ran this script, on my browser page I got double quotes surrounding non-graphic numbers. Not the pgn image numbers I am suppose to see. I noticed in my server error log that the file name for the digit image number did not exist. Here is an example of the server error log message: File does not exist: /home/mectjvc/public_html/"/images/digits/plain_b/1.png" File does not exist: /home/mectjvc/public_html/"/images/digits/plain_b/0.png" File does not exist: /home/mectjvc/public_html/"/images/digits/plain_b/1.png" File does not exist: /home/mectjvc/public_html/"/images/digits/plain_b/0.png" I noticed the double quote in front of the /images and also at the end of .png. So I looked in my Perl book and it described another way to quote a string (or expression) using interpolation. It said to use qq( ). The Perl interpetor must add quotes when it serves the page back to the browser. Using the qq( ) is the same as using \" (backward slash quote). I made two changes to the Perl count.cgi script and the Perl interpetor liked using qq( ) instead of \". So I checked it on my Mac / Netscape system and my wife's Windows 2000 IE system and it works. To see it in action go to: http://mectjv.com/index.html. This is just a work-in-progress webpage that uses the count.cgi script (It's not done!). In the Perl script count.cgi I changed two lines: 1. Original count.cgi: >my $digits_dir = "/images/digits/"; To my version: (I only took off the "/" found in front of the word: images) >my $digits_dir = "images/digits/"; 2. Original count.cgi: >print "<img src=\"$digits_dir$style/$num.$imgtype\" alt=\"$num\" />"; To my version: (took off the outside double quotes and added: qq( ) ) >print qq(<img src=\"$digits_dir$style/$num.$imgtype\" alt=\"$num\" />); It now works and it creates stats. I did not try making changes to the Perl script - gd-count.cgi, but it might work for that script to use the qq( ). I read in my Perl book that if the quoted string (expression) uses parentheses, then you have to backslash each parentheses. I know this may seem stupid to spend so much time trying to get a counter on a web page. But I wanted to learn what was wrong and in the process learn about Perl, HTML, cgi's, etc. And sometimes you just get determined to not let things beat you. It comes from my old programming days (Fortran, Cobol, CICS, DB2, etc.). Alan - Thanks again for taking the time to try and debug my script problem. Mark
-
Alan, The author of the bscounter is still working on it. Thanks for the confirmation on how to set up the SSI version. You are probably right about the HTTP_REFERER variable being blank. Because I did not come from a linked page I just typed in the URL address. The problem must be something really simple that is being overlooked. Still working on it. Thanks again for your help. Mark
-
Alan, Thanks again for your help. I emailed (is emailed an actual word?) the author of the program and he is looking into it. How did you get it to work as a server side include? Did you just name your "index.html" file as "index.shtml"? I know you had to use the count.cgi version of the counter. Where did you put the images folder? In the bscounter folder or did you use the existing images folder - the one found in your public_html folder? I may have to go the ssi route. I thought that I had tried it and it too did not work. I may re-try it. Mark
-
Alan, I checked my server environment using "env.pl" and "phpinfo.php" php scripts and they said that GD support is enabled. It said it is version 2.0.12 GD compatible. It also said that "png" support was enabled. Thanks for the "GD.pm" link. I downloaded it, but I am wondering if I even need to install it since GD is already installed on the system. One thing I did notice, but I do not know if it matters, is that the server variable "HTTP_REFERER" is blank (empty). I modified a php script called "acevars.php" to display server data for my site. I added the displaying of the server variable "HTTP_REFERER" and it showed nothing. As mentioned before, in the script "gd-count.cgi" there is a check of this server variable against the "@allowed" variable which I changed (found at the top of the script) to list my website. So maybe the "HTTP_REFERER" has to be "turned-on" so that the "gd-count.cgi" script will recognize it and not exit the script right away. I have no idea how to turn this server variable "on" or if it always is blank for security reasons. Mark
-
Hello - schussat, Thanks for responding. The file that I included with the post was a "clean" version of the script. It does not contain any "debug" print statements that I personally added to the script. The two print lines you mentioned have remained untouched in the script. I only changed the three variable lines at the top of the script as mentioned in the original post. You are correct about "Premature end of script headers" errors being hard to diagnose. The bscounter counter looks like a nice counter script with nice reporting. So I would like to use it. There is an option of using the alternative script called "setup.cgi" but it requires you to use a server side include which I was trying to avoid if possible. Thanks again for your reply. Mark
-
Help, I am a little new to cgi/perl scripting. Here is my problem. I am trying to add a counter to my index.html web page and it is not working. I am trying to use the Perl script bscounter v. 2.0.2 (found at http://www.stanback.net/programming/bscounter) and for some reason I can't get it to work. It is like the script exits right away. I am trying to use his "gd-count.cgi" perl script. I created a folder called bscounter in my cgi-bin folder (which is found in my public_html folder). I also tried moving all of the bscounter images (png and gif) from his image folder to the images folder (found in my public_html folder) because I thought I may not be able to read gif and/or png files in the cgi-bin folder. In the gd-count.cgi perl script file I just changed the variables: @allowed from "stanback.net", "gotmod.com", "spilledink.org" to "mectjv.com", "www.mectjv.com". Which will be my website. I also changed the variable: @$digits_dir from "./images/digits/" to "../../images/digits/" This is because the images folder is two folders up from the gd-count.cgi script. I also changed the variable: $data_dir from "/home/sites/www.stanback.net/web/cgi-bin/bscounter/data/" to "/home/mectjvc/public_html/cgi-bin/bscounter/data/". Here is the line of code that I have used in my index.html file to call the gd-count.cgi script: ><img src="/cgi-bin/bscounter/gd-count.cgi?page=hpcounter&style=plain_b&x=17&y=27&nbdigits=6"> Here is what I am using for permissions: index.html 644 cgi-bin folder 755 bscounter folder 755 gd-count.cgi 755 data folder (found in the bscounter folder) 777 I was originally getting some errors previously in the error log but now I get nothing except: "Premature end of script headers: /home/mectjvc/public_html/cgi-bin/bscounter/gd-count.cgi". Here is the first few lines of the gd-count.cgi script: >#!/usr/bin/perl -w use strict; use Fcntl ':flock'; use GD; I have tried to put "print" statements in the gd-count.cgi perl script, but I get nothing. It's like it will not call the gd-count.cgi script. Could it be something in my .htaccess file that is preventing the script from running? There is a statement in the gd-count.cgi perl script that checks the @allowed variable against the ($ENV{HTTP_REFERER} variable. If it is not found (no match), then it exits the script. But it seems it never gets that far because the "print" statements I placed in the script for debugging purposes never show up on my browser web page. I have attached the gd-count.cgi perl script if needed. I would appreciate any help. Thanks. Mark gd_count.cgi
