PDA

View Full Version : Path problem


stevan
12-06-2002, 03:50 AM
I am trying to use the following cgi script and get the errror that the database is not there

I have been told the

You're still using "absolute url's" (http://www...) and you should be using "relative paths" (/usr/home/cruisewarehouse...). You need to find out the PATH to the data file and html files...not the URL.

These are the items i uploaded to the site

http://www.cruisewarehouse.cc/header.html

http://www.cruisewarehouse.cc/footer.html

http://www.cruisewarehouse.cc/cgi-bin/dbspace.cgi


Here is the section of script where the changes are to be made



Thxs Steve
This is really a tough problem for me I have no idea how to fix this one


#!/usr/local/bin/perl

###############################################

###

### dbSpace v1.8b

### Copyright Spaceout

### http://www.spaceout.com

###

### By using this code you agree to indemnify

### Spaceout Media from any liability that might

### arise from its use.

###

###############################################

use CGI qw (:standard);

use CGI::Carp qw(fatalsToBrowser);

###############################################

### Set Configurations Below

###############################################

### Specify your database fields in the array below

@fields = ("Name","Address","City","State","Zip","Email","Phone","Fax","URL");

### Set URL and email fields to be hyperlinks

### The number used corresponds to its placement in the array above

### Remeber to start your count at zero

### Leave the variables empty to remove the hyperlink

$index_of_url = "8";

$index_of_email = "5";

### Specify the required fields below. This may be left empty

@required = ("Name");

### Specify the filtered words below. You must define at least one word here

@filter = ("Proprietary");

$database = "./data/data.html"; # Data file name and path

$script_name = "dbspace.cgi"; # This script name

$db_name = "Cruise Data Base"; # The database name

$table_width = "90%"; # The display width of the entire table

$record_width = "80%"; # The display width of the database records

$max_rows_returned = "10"; # Max number of rows displayed per page

$filter_html_tags = "yes"; # Removes HTML tags from record entries

$user_file = "users.txt"; # User file name and path

$check_user_duplicates = "yes"; # Checks for duplicate user names in user file

@extra_user_fields = ("Email"); # Additional info needed when registering users

$use_external_html = "no"; # Set to "yes" to use your own html template

$external_html_header = "header.html"; # File name and path to html template header

$external_html_footer = "footer.html"; # File name and path to html template footer

$authenticate = "no"; # Prompts users for a user name and password

$register = "yes"; # Allows new user registration

$record_ownership = "yes"; # Users can modify/delete only their records

$admin_user_name = "admin"; # This is the default Administrator user name

$default_user_permission_search = "yes"; # Gives newly registered users Search permission

$default_user_permission_add = "yes"; # Gives newly registered users Add permission

$default_user_permission_modify = "yes"; # Gives newly registered users Modify permission

$default_user_permission_delete = "yes"; # Gives newly registered users Delete permission

###############################################

### Change Nothing Below This Line

eloi_egon
12-09-2002, 09:19 PM
I've tried the same script and installed in 30 sec. Don't know what you did wrong.

On opening and filling out the admin (http://www.cruisewarehouse.cc/cgi-bin/dbspace.cgi) i'm getting a

Software error:
Error creating user file. Permission denied

For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.


What you should do is:

1. Create a datafolder in the root of your site (or best in the www-folder)
2. change $user_file = "users.txt"; to $user_file = "../www/data/users.txt"
3. change $database = "./data/data.html"; to $database = "../www/data/data.txt";
4. check the permissions of the data folder (chmod 666 or 777)
5. delete the old user.txt and data.html(data.txt) files (if they exits)

Best of luck