View Full Version : Auto loop Form

Deacon Frost
12-17-2008, 04:50 PM
I'm trying to get it to post to my forum with a different twist (a new website etc, long story short)

But right now I'm trying a simple test of this method. So I'm having it submit data to a page multiple times...


$i = 1

do {


form info here




while($i <= 10);


In the form, it'll change just one value, and then resubmit it until that value = 10.

Really simple to do, but I don't know how to get a form to automatically submit. Right now, it'll just display the form 10 times DD::confused:

Also, I don't know any of the variables on the next page. I'm pretty sure it uses post data, because it doesn't show up in the url :P.

12-17-2008, 04:56 PM
Where is the bit that is supposed to submit the form?

Deacon Frost
12-17-2008, 05:02 PM
uhm, For now I'll just make it a random page =/.

So it'd be something like:

<form action=thispage.php method=post>

then just a few text input boxes...

but the main thing I can't figure out is how to send the all the looped/changed data to the page.

I'm developing it to make 100 posts in a thread instantly.

Point is, once I get it to auto submit, I can get it setup with the current data in the forum via modifications. But I need to know how to set it up to do that :P.

So it sends the data, rather than shows the form multiple times.

12-17-2008, 08:23 PM
OK well you can't really do it that way. Your browser is the mechanism that submits a form which then sends a POST or GET HTTP request back to the webserver, which then processes your PHP script, which then heads back out to your browser.

So your loop would have to include that entire journey, which can't be achieved inside a PHP script, which is only part of the journey.

You'll probably be able to do this on the client side using Javascript.

p.s. there is actually a way to send HTTP requests to the webserver using PHP, which could of course be put inside a loop. However I wouldn't see the point, if what you really want to test, or exercise, is the form submittal process. But if you want to give it a shot, look into fsockopen(), and/or curl.



Deacon Frost
12-20-2008, 04:55 PM
Awesome :D.

I tried both of those, neither worked (well) to my level of ability.

So, I am focusing on the document.form.submit function in javascript, and I can figure it out, but I can't grasp the concept of the idea of sending all the data at once.

What I am trying to do... to make it really simple, is use a for loop in javascript, and send the data (not echo, but send the data) to the page all at once after it's collected it.

My idea is to store it all in an array, and then send the arrays, each holding the info from each one.

but then I'd have to alter all of the other pages, which I can't do since it's a premade script (and uses so many different inserts it's not even funny).

So what I need to do is put all of the post data on the same page as the forms for a certain number of time. and then it just submit all of that at once (as different forms).

Can anyone give me a headache break with some potential possibilities? This really has my head raped right now XD.

Deacon Frost
12-23-2008, 01:36 PM
Can someone move this to JavaScipt please?

Or should I just repost it there?