Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Add.cgi and lost links problems

Quote Reply
Add.cgi and lost links problems
This was my intention, what I did, and what is happening. It's 5 pages long, I thought it would be best to include everything, I hope it all fits.

1. I wanted to include 2 more fields on the add.cgi script ( Contact Address, and Contact Telephone number)
I just read a response from Elliot Lee on lost links, saying to check the "Links.db" file to see if all the links are still there. I only seem to be able to find the links.cfg,links.def and db.pl file?
2. I made changes to these scripts:
add.cgi
Title: $in{'Title'}
URL: $in{'URL'}
Category: $in{'Category'}
Description: $in{'Description'}
Contact Name: $in{'Contact Name'}
Contact Email: $in{'Contact Email'}
Contact Address: $in{'Contact Address'}
Contact Telephone: $in{'Contact Telephone'}

Modify.cgi
ORIGINAL LINK:
===============================================
Title: $original{'Title'}
URL: $original{'URL'}
Description: $original{'Description'}
Country: $original{'Country'}
Type: $original{'Type'}
Contact Name: $original{'Contact Name'}
Contact Email: $original{'Contact Email'}
Contact Address: $original{'Contact Address'}
Contact Telephone: $original{'Contact Telephone'}
Category: $original{'Category'}

NEW LINK:
===============================================
Title: $in{'Title'}
URL: $in{'URL'}
Description: $in{'Description'}
Country: $in{'Country'}
Type: $in{'Type'}
Contact Name: $in{'Contact Name'}
Contact Email: $in{'Contact Email'}
Contact Address: $in{'Contact Address'}
Contact Telephone: $in{'Contact Telephone'}
Category: $in{'Category'}

Simple html changes to the html pages
add_success.html
add_error.html
modify_success.html
modify_error.html

Simple text changes to these files
Contact Address : <%Contact Address%>
Contact Telephone: <%Contact Telephone%>
email-add.txt
email-del.txt
email-modify.txt

At this point the information fields were present on the Internet when add a site was activated. When you filled out the information, the success page information appeared correctly, and I would receive an email with all the information.

When I would go to the Links Manager to validate the record, the file would appear minus the 2 extra rows of the table for the Contact Address and Contact Telephone.

I looked at the links.def file to see if there would be anything to try, so I decided to make these changes:
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']
'Contact Address' => [14, 'alpha', 40, 75, 1, '', ''],
'Contact Telephone' => [15, 'alpha', 40, 75, 1, '', ''],
Also in this area:
# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 8; $db_isnew = 9; $db_ispop = 10;
$db_contact_name = 6; $db_contact_email = 7; $db_title = 1;
$db_votes = 12; $db_rating = 11; $db_mail = 13;
$db_contact_address = 14; $db_contact_telephone = 15;

At this point my steps were fast but my memory of actions taken and specific order start to fail. As I remember, the files were accepted for validation but when I tried to "build all" I got this (below):

I don't understand the error to the admin_html.pl file below, because I didn't make any changes to it?

The error building links is a big problem now, because the data base appears empty.

I'm figuring there is some way to activate a back up of all the links, but I don't know how?

I would like to still keep the 2 new fields if it isn't to difficult.

I'm also wondering if I reverse all that I have done and "build all", will all my links return?
Any help would be appreciated.
Michael

VALIDATING
CGI ERROR
==========================================
Error Message : fatal error: Illegal division by zero at /home/funcost/public_html/cgi-bin/links/admin/admin_html.pl line
1056.

Script Location : admin.cgi
Perl Version : 5.00502

Form Variables
-------------------------------------------
db : links
validate_form : 1

Environment Variables
-------------------------------------------
AUTH_TYPE : Basic
DOCUMENT_ROOT : /home/funcost/public_html
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
HTTP_ACCEPT_CHARSET : iso-8859-1,*,utf-8
HTTP_ACCEPT_ENCODING: gzip
HTTP_ACCEPT_LANGUAGE: en
HTTP_CONNECTION : Keep-Alive
HTTP_HOST : funcostarica.com
HTTP_REFERER : http://funcostarica.com/cgi-bin/links/admin/admin.cgi?display=navigation
HTTP_USER_AGENT : Mozilla/4.7 [en] (WinNT; U)
PATH : /usr/local/bin:/usr/bin:/bin
QUERY_STRING : db=links&validate_form=1
REMOTE_ADDR : 196.40.47.236
REMOTE_PORT : 61985
REMOTE_USER : funcost
REQUEST_METHOD : GET
REQUEST_URI : /cgi-bin/links/admin/admin.cgi?db=links&validate_form=1
SCRIPT_FILENAME : /home/funcost/public_html/cgi-bin/links/admin/admin.cgi
SCRIPT_NAME : /cgi-bin/links/admin/admin.cgi
SERVER_ADMIN : funcost@funcostarica.com
SERVER_NAME : funcostarica.com
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.0
SERVER_SOFTWARE : Apache/1.3.3 (Unix) PHP/3.0.9 FrontPage/3.0.4.3
TZ : US/Central

BUILDING
Building Pages

Pages built on 4-Mar-2001 at 09:55:36
--------------------------------------------------------

Backing up database . . .
Backing up links, category and email database (File::Copy) ...
Done.

Building URL Index . . .
Done.

Updating New and Popular Records . . .
What's New Cutoff: 14 days
Popular Cutoff: 2 hits

CGI ERROR
==========================================
Error Message : Error building! Links database is 0 bytes!
Script Location : nph-build.cgi
Perl Version : 5.00502

Form Variables
-------------------------------------------

Environment Variables
-------------------------------------------
AUTH_TYPE : Basic
DOCUMENT_ROOT : /home/funcost/public_html
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
HTTP_ACCEPT_CHARSET : iso-8859-1,*,utf-8
HTTP_ACCEPT_ENCODING: gzip
HTTP_ACCEPT_LANGUAGE: en
HTTP_CONNECTION : Keep-Alive
HTTP_HOST : funcostarica.com
HTTP_REFERER : http://funcostarica.com/cgi-bin/links/admin/admin.cgi?display=navigation
HTTP_USER_AGENT : Mozilla/4.7 [en] (WinNT; U)
PATH : /usr/local/bin:/usr/bin:/bin
QUERY_STRING :
REMOTE_ADDR : 196.40.47.236
REMOTE_PORT : 62937
REMOTE_USER : funcost
REQUEST_METHOD : GET
REQUEST_URI : /cgi-bin/links/admin/nph-build.cgi
SCRIPT_FILENAME : /home/funcost/public_html/cgi-bin/links/admin/nph-build.cgi
SCRIPT_NAME : /cgi-bin/links/admin/nph-build.cgi
SERVER_ADMIN : funcost@funcostarica.com
SERVER_NAME : funcostarica.com
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.0
SERVER_SOFTWARE : Apache/1.3.3 (Unix) PHP/3.0.9 FrontPage/3.0.4.3
TZ : US/Central


Subject Author Views Date
Thread Add.cgi and lost links problems michaelcr 9496 Mar 6, 2001, 1:51 PM
Thread Re: Add.cgi and lost links problems
Stealth 9171 Mar 6, 2001, 2:13 PM
Thread Re: Add.cgi and lost links problems
michaelcr 9176 Mar 8, 2001, 7:16 AM
Thread Re: Add.cgi and lost links problems
Paul 9180 Mar 8, 2001, 7:19 AM
Thread Re: Add.cgi and lost links problems
michaelcr 9151 Mar 9, 2001, 8:58 AM
Post Re: Add.cgi and lost links problems
Stealth 9133 Mar 9, 2001, 8:59 AM
Thread Re: Add.cgi and lost links problems
Paul 9160 Mar 9, 2001, 9:00 AM
Thread Re: Add.cgi and lost links problems
michaelcr 9100 Mar 9, 2001, 10:12 AM
Post Re: Add.cgi and lost links problems
Paul 9097 Mar 9, 2001, 10:16 AM
Thread Re: Add.cgi and lost links problems
Stealth 9148 Mar 9, 2001, 10:35 AM
Thread Re: Add.cgi and lost links problems
michaelcr 9185 Mar 9, 2001, 2:32 PM
Post Re: Add.cgi and lost links problems
Paul 9071 Mar 9, 2001, 2:46 PM
Thread Re: Add.cgi and lost links problems
Stealth 9200 Mar 9, 2001, 2:52 PM
Post Re: Add.cgi and lost links problems
michaelcr 9113 Mar 9, 2001, 3:17 PM
Thread Re: Add.cgi and lost links problems
michaelcr 9118 Mar 9, 2001, 3:46 PM
Thread Re: Add.cgi and lost links problems
Paul 9123 Mar 9, 2001, 4:03 PM
Thread Re: Add.cgi and lost links problems
michaelcr 9040 Mar 11, 2001, 9:41 AM
Thread Re: Add.cgi and lost links problems
Stealth 9032 Mar 11, 2001, 10:16 AM
Thread Re: Add.cgi and lost links problems
michaelcr 9012 Mar 12, 2001, 12:32 PM
Thread Re: Add.cgi and lost links problems
Stealth 9059 Mar 12, 2001, 12:44 PM
Thread Re: Add.cgi and lost links problems
michaelcr 9029 Mar 12, 2001, 1:21 PM
Post Re: Add.cgi and lost links problems
Stealth 9019 Mar 12, 2001, 1:52 PM
Thread Re: Add.cgi and lost links problems
michaelcr 9006 Mar 12, 2001, 1:38 PM
Thread Re: Add.cgi and lost links problems
Stealth 9032 Mar 12, 2001, 1:55 PM
Post Re: Add.cgi and lost links problems
michaelcr 8981 Mar 12, 2001, 3:40 PM