473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Submit form X times

Hey everyone , i am trying to submit a form 4 times with diffrent inputs.

i have 2 files

main.php
Expand|Select|Wrap|Line Numbers
  1. $p = 1
  2. while ($p < 5 ){
  3. file_get_contents("submit.php?p=" . $p);
  4. echo "Submited form  " . $p . "<br />";
  5. $p++; 
  6. }
and submit.php
Expand|Select|Wrap|Line Numbers
  1. $c = $_GET[p];
  2.  
  3. echo "
  4. <form name='register' action='http://...form.php' method='post'>
  5. <input id='n' type='text' name='name' value='" . $c . "' />
  6. <input id='e' type='text' name='email' value='" . $c . "@email.com' />
  7. <input id='s' type='submit' value='Register' />
  8. </form>
  9. <body onload=s.click()>";
i didnt worry about checking if $_GET[p] was set because this is only an experiment.
this method should submit to the external 'form.php' 4 times with a diffrent name and email each time.

this however isnt working programaticly , when i go to the url manually it works. I believe it hase somethign to do with the s.click() dom i used.

all input is appreaciated , thankyou
Mar 18 '09 #1
0 1073

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Frank Way | last post by:
Hi all, I've googled this one to death, and still can't find an answer. Not sure I'm asking the right question, but here goes: Have a form with an onSubmit that has some javscript to disable...
4
by: Peloux | last post by:
Hi, I have written some htc in order to validate data in a form. most of htc are attached on 'onblur' event. Now, we would like to use the Enter Key to sublit form, so we use the following...
8
by: shandain | last post by:
Ok, I have done this a million times, and I can't get this to work... I hope I am just being an idiot and missing something... but I can't see it... so please call me an idiot and tell me what it...
8
by: bettina | last post by:
I want to submit a form but without a submit button. That's to say, I want that by giving a definite code in a field and then press <ENTER> the form will be submitted. For Example <form...
7
by: amerar | last post by:
Hi All, I am really green at Javascript. Someone gave me some code to play with and I'm trying to understand it: <INPUT TYPE=text NAME=subject SIZE=60 MAXLENGTH=60><BR><BR> <input...
1
by: sudhaoncyberworld | last post by:
Hi all I am trying to submit the form and after form.submit line i am trying to open a url using window.open.... I found in some forum it is not possible to reach out the statement after the...
13
by: deko | last post by:
I have a basic feedback form with a submit button. After the "send" button is clicked, I want the user to be redirected to a different page that says "Your message has been sent." How do I do...
14
by: white lightning | last post by:
How to have <select onchange="this.form.submit()"and also a Submit button on one form? I have something like this: <form action="<?php $_SERVER; ?>" method="post"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.