Dynamic Update of Page

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
LVL 3
jeffbeasleyAsked:
Who is Participating?
 
lexxwernCommented:
ops forgot..



require "cgi-lib.pl";
ReadParse(*input);
$PERLvARIAbLe = $input{'INPUTsNAME'};
0
 
samriCommented:
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
 
jeffbeasleyAuthor Commented:
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
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
samriCommented:
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
 
jeffbeasleyAuthor Commented:
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
 
samriCommented:
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
 
samriCommented:
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
 
samriCommented:
If you could give me the sample rate file (can email to samrishah@yahoo.com), I might be able to revise the script.

0
 
lexxwernCommented:
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
 
lexxwernCommented:
as soon as you confirm this is what you want ^^
0
 
samriCommented:
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
 
lexxwernCommented:
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
 
jeffbeasleyAuthor Commented:
lexxwerm...
You hit the ball on the nose...............
Look forward toward you help............
I want to change rates.html
TY,
Jeff
0
 
lexxwernCommented:
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
 
lexxwernCommented:
any help needed in understanding, ill be glad to tell.
0
 
jeffbeasleyAuthor Commented:
I will take a look and see what I come up with..........
0
 
lexxwernCommented:
glad to help, thanks for the A!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.