Solved

Sending the form automatically to be processed by a server

Posted on 2004-08-05
4
162 Views
Last Modified: 2013-12-25
Dear All:
I have to implement a monthly anniversary billing system.

Is there a way send the form automatically to be processed by some another server. I want to implement a perl program that runs everyday. I have to interact with a credit card server for it to work.  

A form based solution is easy but is there a way to send the form to server automatically without someone clicking the submit button.

Is this achieveable. Please let me know.

Thanks and Regards

sunnybrad
0
Comment
Question by:sunnybrad
4 Comments
 
LVL 16

Expert Comment

by:xDamox
ID: 11729731
I belive there is a javascript that does it,

Online banking site use it, why not make the java scrip like a timer and when it gets to a certian number it logs them out Java script below:


<script language="JavaScript">

<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var timerID = 0;
var tStart  = null;

function UpdateTimer() {
   if(timerID) {
      clearTimeout(timerID);
      clockID  = 0;
   }

   if(!tStart)
      tStart   = new Date();

   var   tDate = new Date();
   var   tDiff = tDate.getTime() - tStart.getTime();

   tDate.setTime(tDiff);

   document.theTimer.theTime.value = ""
                                   + tDate.getMinutes() + ":"
                                   + tDate.getSeconds();
   
   timerID = setTimeout("UpdateTimer()", 1000);


   if(timerID >= 10)
   {
     alert('Time is now');
     document.form.submit();
   }

}

function Start() {
   tStart   = new Date();

   document.theTimer.theTime.value = "00:00";

   timerID  = setTimeout("UpdateTimer()", 1000);


}

function Stop() {
   if(timerID) {
      clearTimeout(timerID);
      timerID  = 0;
   }

   tStart = null;
}

function Reset() {
   tStart = null;

   document.theTimer.theTime.value = "00:00";
}

//-->

</script>
<body onload="Reset()" onunload="Stop()">
<center><form name="theTimer"><table>
   <tr>
      <td colspan=3 align=center>
         <input type=text name="theTime" size=5>
      </td>
   </tr>
   <tr><td></td></tr>
   <tr>
      <td>
         <input type=button name="start" value="Start" onclick="Start()">
      </td>
      <td>
         <input type=button name="stop" value="Stop" onclick="Stop()">
      </td>
      <td>
         <input type=button name="reset" value="Reset" onclick="Reset()">
      </td>
   </tr>
</table></form></center>


hope this helps
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 250 total points
ID: 11730049
JavaScript to do real world jobs, is this a joke xDamox ;-)

perl has been suggested, do it like

#!/usr/bin/perl
use LWP::Simple;
while (1) {
    open(F,">>gotit");
    print F get("http://www.somewhere.tld/script?parameters");
    close F;
    sleep 84600;
}
# to be improved in many ways
0
 
LVL 9

Expert Comment

by:dutchfoxer
ID: 11731637
(if supported on the server / by hostingservice...) you can schedule Perl-scripts for example with CRON. So you could schedule the above script (without the sleep-line) to run every thursday-evening at 10.00 pm for example.

Read all about it here:
http://www.techtutorials.com/tutorials/unix/cron.shtml
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 250 total points
ID: 11748913
The usual Perl way of doing this is using the LWP bundle, eg:

use LWP::UserAgent;
$ua = LWP::UserAgent->new;  
my $req = HTTP::Request->new(POST => 'http://www.perl.com/cgi-bin/BugGlimpse');
$req->content_type('application/x-www-form-urlencoded');
$req->content('match=www&errors=0');  
my $res = $ua->request($req);
 print $res->as_string;
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

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…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

803 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