?
Solved

Sending the form automatically to be processed by a server

Posted on 2004-08-05
4
Medium Priority
?
170 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 1000 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 1000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

840 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