Solved

Dynamic Update of Page

Posted on 2002-06-20
17
159 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
  • 7
  • 6
  • 4
17 Comments
 
LVL 15

Expert Comment

by:samri
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 3

Author Comment

by:jeffbeasley
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 12

Expert Comment

by:lexxwern
Comment Utility
as soon as you confirm this is what you want ^^
0
 
LVL 15

Expert Comment

by:samri
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
any help needed in understanding, ill be glad to tell.
0
 
LVL 3

Author Comment

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

Accepted Solution

by:
lexxwern earned 300 total points
Comment Utility
ops forgot..



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

Expert Comment

by:lexxwern
Comment Utility
glad to help, thanks for the A!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now