Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need a script to add a record to a DB on the server. 1

Status
Not open for further replies.

Pyrrhus

Technical User
Dec 18, 2001
112
AU
Can anyone out there help me get started with this please?

I have been screwing around with this problem for ages. It involves getting a long string (approx 1.5K) from my client’s page back to me. I have had several shots at a JS / form / email solutions, but the email input box can’t or won't handle the long string. I’ve had plenty of input from Tek-Tips folk, and I’m grateful for that.

I have to go the CGI route of updating a db file on the server in full record mode. I don’t need to be able to update fields in the db, or query the db, just allow the user to click a button and write a string contained in a JS variable as a new record in the db (the string is comprised of 450 or so 2-byte values separated by commas or whatever, and each value will be a db field). I can then download the db periodically in file mode and update my offline db. It is used for statistical purposes only and there is no need for real-time interaction by either the user or myself.

I don’t know Perl, but I’m happy to come to grips with it. If I had a script as a starting point that would be a huge help.

Hope you can assist.
 
The two modules you require are

CGI.pm
and
DBI.pm

On your server type

man CGI

This will get you a lot of docs and examples of how to use this library to interact with a browser.

Then you can type

man DBI

and get the same for database interaction.

Based on that you can start hammering together some code. Your application is custom enough that a canned script is probably not going to be coming your way anytime soon.

Keep posting!
 
Thanks, Siberian. Appreciate your response (again).

I'm a real novice at this, working alone. I don't know how to get into my server to type anything.

I don't have a server installed myself. My site is hosted by a crowd called SmartHosting.com (good reliability and response time, but quite hard to get any info or assistance out of). I have access to a "control panel" which includes the following "options":

E-mail Tools
CGI Tools
Error Editors
Security Tools
Data Manager
Search Engines
FTP Tools
System Tools
Reseller Manager
Miscellaneous
Documentation

Any idea where I go to get access to the modules or documentation you refer to. (The documentation referred to on the control panel is very basic.)

Thanks again for your help.
 
Follow-up to Siberian:

Maybe I need to install my own server for the development, is that what you're saying?
 
Check the Documentation section for info on what perl modules are available to you.

Did they give you database information?

I am not sure your hosting provider is giving you the options you need but investigate it fully before setting up your own server etc.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top