Solved

Dynamic Update of Page

Posted on 2002-06-20
17
164 Views
Last Modified: 2013-12-25
I want to update the rates at the site listed below, through the use of a web based form............

however, they don't have a database to work with...

http://www.triadbank.net/rates.html

any example code would be well rewarded....

TY,
Jeff
0
Comment
Question by:jeffbeasley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 4
17 Comments
 
LVL 15

Expert Comment

by:samri
ID: 7096434
Jeff,

It all depends on the format raw data (the rate information).  Another factor too consider is the webserver OS, Webserver platform, and any tools that is available to support the dynamic updates.

It seems that the OS is Unix flavor, and the webserver server is -----.

Assuming that the the page is update manually - editing the HTML file, and uploded to the server; you could use the HTTP Refresh method in the HTML.


Another option would be using CGI+Perl.
0
 
LVL 3

Author Comment

by:jeffbeasley
ID: 7096476
They have been using front page to maintain the site and they are not wanting to ftp anything or use frontpage anymore.......
they just want to go to a web based form, with minor password protection to update their rates.........

I am a Cold Fusion developer not a perl expert do you know of any sample out there that may assist me.....

TY
0
 
LVL 15

Expert Comment

by:samri
ID: 7096677
TY,

I have a quick visit to the site, and... very impressive.

However, there seems to be too many figures.

If you could post some sample of the figure that the staff are updating, I might be able to try to work some Perl scripts.

Unfotunately, I can comment much on Cold Fusion... in fact, I just started to learn to do CGI in Perl.

I would believe this is a way to go;

- Use the exisiting html code as the template.
- write some perl code to accept data, and post it to the server
- have the perl to insert the data (rate data) using the HTML template.

The server needs to be configure to provide some basic ACL/Authentication.  Maybe allow certain IP address/Netblock to go in, userame/password, and/or SSL.

I knew that there should be some approach much simple than this, however I'm pretty (my knowledge) are pretty much limited to perl/cgi.

fist, the sample input data, and see if I (or anybody) could give a practical solution.

btw:  it's almost midnight here, and I cannot promise a fast response

cheers.

hang on! something pops us.
how about getting FP server extension installed/and configured.  That sure helps some coding headache, and retraining the user.  It would be possible.
0
Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

 
LVL 3

Author Comment

by:jeffbeasley
ID: 7096796
I need to do it in perl not Cold Fusion.......

or some other cgi language.....

I am trying to basically allow them to update a flat text file.......................

this falt text file will contain the rates...........

They need to input the new rates (password, username) into a form then click submit............

this should then update the text file

and when then end-user loads the page it will have the updated rates

Ty
0
 
LVL 15

Expert Comment

by:samri
ID: 7097802
Jeff,

It should be possible.
First you might need to ensure that your perl comes with CGI.pm  (I think it should).

There would be some configuration on the webserver to enable Perl/CGI to work, and we would need to fix the ACL as well.

Please let us know should you need assistance in getting the webserver configured as well.

I should be able to give you the skeleton scripts in short while.

0
 
LVL 15

Expert Comment

by:samri
ID: 7098064
Jeff,

some very basic perl code that I managed to come up with.  It is based on Perl on Win2K, server is Apache/1.3.24 (Win32) mod_perl/1.27_01-dev

It serve the updating.  Need to be modified for checking, backup of the old rate file, etc. etc.

Another thing to look for is the webserver configuration to allow perl/cgi to work.
----
#!c:\perl\bin\perl
$|=1;
use CGI;

$q = new CGI;
$file_rates="rates.txt";


@passed=$q->param;

if (@passed) {
  open(OUT,"> $file_rates");
  foreach (@passed) {
    print OUT $q->param($_),"\n";
  }
  close(OUT);
}

print $q->header;
print $q->start_html(-title=>"My Title");



&DisplayFile;
&DoForm;

print $q->end_html();
#---------------------------

sub DisplayFile {
 # reopen for reading
 open (IN,$file_rates) || die;
 while (<IN>) {
   chomp;
   print "$_<br>";
 }
 close(IN);
}

sub DoForm{

#  print $q->start_form(-method=>post,-action->self);
  print $q->start_form;
  print "Rate 1", $q->textfield(-name=>'rate1'), "<br>";
  print "Rate 2", $q->textfield('rate2'), "<br>";
  print "Rate 3", $q->textfield('rate3'), "<br>";
  print "Rate 4", $q->textfield('rate4'), "<br>";
  print "Rate 5", $q->textfield('rate5'), "<br>";
#  print $q->submit(-name=>"UPDATE");
  print $q->submit;
  print $q->reset(-name=>"RESET");
  print $q->end_form();
}

0
 
LVL 15

Expert Comment

by:samri
ID: 7098066
If you could give me the sample rate file (can email to samrishah@yahoo.com), I might be able to revise the script.

0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7106884
hello, maybe i can help.

do you want to change the source rates.html with the new rates?

or

do you want to change the source from which rates.html gets the rates?

from what ive read and seen you want the first option.

it is possible. ill post the code below soon.
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7106892
as soon as you confirm this is what you want ^^
0
 
LVL 15

Expert Comment

by:samri
ID: 7106962
Lexxwern,

Sorry to interrupt.

But it's great to see how the 'pros do it, and I'd be greateful to learn too.

cheers.
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7107071
lol, im a college student and a freelancer. not a pro yet.

i would really like to change the rates in a database,

but if thats not the case then the script would overwrite the rate.html file from a template and will replace the old source with the new modifed source. thats all.
0
 
LVL 3

Author Comment

by:jeffbeasley
ID: 7107447
lexxwerm...
You hit the ball on the nose...............
Look forward toward you help............
I want to change rates.html
TY,
Jeff
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7113438
hi, i wont give the complete code, im having probs of my own that need to be taken care of.

but here's what you do,

create a html page with the form of new values for rates... somewhat like this


<form action="MODIFY.CGI" method="POST">
<input ............... name="INPUTsNAME">
</form>


then your MODIFY.cgi should take the form values, i use cgi-lib.pl. some thing like this...



ReadParse(*input);
$PERLvARIAbLe = $input{'INPUTsNAME'};




now what you do is delete the existing rates.html, here

unlink("rates.html");




now create a new rates.html

open(RATES,">rates.html");




then you write a new content into rates.html

print RATES"<html><...................>";
print RATES"<td>$PERLvARIABLe.........";



close rates.html

close(RATES);




voila! done
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7113443
any help needed in understanding, ill be glad to tell.
0
 
LVL 3

Author Comment

by:jeffbeasley
ID: 7113645
I will take a look and see what I come up with..........
0
 
LVL 12

Accepted Solution

by:
lexxwern earned 300 total points
ID: 7119582
ops forgot..



require "cgi-lib.pl";
ReadParse(*input);
$PERLvARIAbLe = $input{'INPUTsNAME'};
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7216016
glad to help, thanks for the A!
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question