?
Solved

Sending the form automatically to be processed by a server

Posted on 2004-08-05
4
Medium Priority
?
167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

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

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
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 …
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

752 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