Solved

Auto-Submiiting a Form Question

Posted on 2006-06-14
3
259 Views
Last Modified: 2012-06-27
Hi All,
I have a page where I want it to auto-submit without the user seeing it. What is the easiest way to do this? The reason I need to do this is because the php curl function won't operate properly if I re-post the page to itself and then pass on to a Paypal page. I now have two pages set-up but as the second page is purely functional (no use to the user) I don't want them to have to click another submit button. Is there an easy php or javascript solution to this? Any help would be much appreciated.
Thanks,
D
0
Comment
Question by:dereksheahan
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 500 total points
ID: 16901716
Hi dereksheahan,

<body onload="document.forms[0].submit();">

So when the page loads, the form is submitted automatically.

Tim Cottee
0
 
LVL 20

Expert Comment

by:Gawai
ID: 16902121
to work timcottee code, u should write <form> attributes as well.

<body onload="document.Autofrm.submit();">
<form action="finalpage.htm" method="post" name="Autofrm">
<input type......................>
.....

</form>
</body>



@-GaWai-@
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 16902173
gawai,

Indeed, though that was assumed (perhaps I shouldn't have).

Tim
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

708 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

16 Experts available now in Live!

Get 1:1 Help Now