Solved

Sending the form automatically to be processed by a server

Posted on 2004-08-05
4
161 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
Comment Utility
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
Comment Utility
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
Comment Utility
(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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
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 viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

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

8 Experts available now in Live!

Get 1:1 Help Now