Automatic form submission

B

BernieH

I'm trying to move a search value from one page to another; this works
nicely. Except that the user has to click a button to submit the 2nd page.
Can anybody suggest something to ensure the 2nd page is submitted
automatically without having to click "submit".

Here's the code.

TIA


<HTML>
<HEAD>
<TITLE>Welcome to XYZ</TITLE>
</HEAD>
<BODY onload="document.xyz.submit()">
<form name="form1" method="get"
action="http://www.some.com./search-name.asp?">
<input type="hidden"
name="tfSearchName" value="<?php $search=$HTTP_GET_VARS['search']; echo
"$search"; ?>">
<!-- <input type="submit" name="btSearchCo23" value="submit"> -->
Your browser should continue
automatically to XYZ. If it doesn't, click <input type="submit" value="
here ">
</form>
</BODY>
</HTML>

BernieH
 
J

Jan Faerber

BernieH said:
Can anybody suggest something to ensure the 2nd page is submitted
automatically without having to click "submit".
....
</HEAD>
<BODY onload="document.xyz.submit()">
<form name="form1" method="get"
action="http://www.some.com./search-name.asp?">
....


It redirects fine for me with the correct element names:
<BODY onload="document.form1.submit()">
 
J

Jan Faerber

BernieH said:
Jan, thank you! I didn't pick up on that.

BernieH


Or maybe you want to use a perl script like this?

#!/usr/bin/perl -w

use strict;
use CGI;
my $cgi = new CGI;
use CGI::Carp qw(fatalsToBrowser);

open(FH,">>/usr/web/data/userlog.xml");
print FH "<user-call>\n <remote-host>",
$cgi->remote_host(),
"</remote-host>\n <user-agent>",
$cgi->user_agent(),
"</user-agent>\n <goto-url>",
$cgi->url_param('goto'),
"</goto-url>\n <time-stamp>",
localtime(time),
"</time-stamp>\n</user-call>\n";
close(FH);

print $cgi->redirect($cgi->url_param('goto'));


Then you can use in a href=".. something like this
http://localhost/cgi-bin/redirect.pl?goto=http://www.teamone.de/

Yes, I found that on teamone.de - it´s german - I know - I am a looser.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top