473,397 Members | 1,969 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,397 software developers and data experts.

posting form data to two php scripts at once

How do i post the form data to different php files at once. I tried the
following code but it doesn't work. the data is sent only to the first
php file.

<form method="post" action="insert.php" action="mail.php">
Email<input type="text" name="email" value ="" size="20" />
<input type="submit" value="submit" />
</form>
Is there a solution?

Dec 17 '06 #1
3 1654
On 16 Dec 2006 17:08:45 -0800, on*******@gmail.com wrote:
>How do i post the form data to different php files at once. I tried the
following code but it doesn't work. the data is sent only to the first
php file.

<form method="post" action="insert.php" action="mail.php">
Email<input type="text" name="email" value ="" size="20" />
<input type="submit" value="submit" />
</form>
You can't, HTML forms don't work like that.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Dec 17 '06 #2

Andy Hassall wrote:
On 16 Dec 2006 17:08:45 -0800, on*******@gmail.com wrote:
How do i post the form data to different php files at once. I tried the
following code but it doesn't work. the data is sent only to the first
php file.

<form method="post" action="insert.php" action="mail.php">
Email<input type="text" name="email" value ="" size="20" />
<input type="submit" value="submit" />
</form>

You can't, HTML forms don't work like that.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

I have slightest idea, but i dont know how to finish this.i opened
mail.php
and added following at the end:
require_once insert.php;
$pass_on_again = ******* ($email);

what do i replace the ******* with?

Dec 17 '06 #3

on*******@gmail.com schrieb:
How do i post the form data to different php files at once. I tried the
following code but it doesn't work. the data is sent only to the first
php file.

<form method="post" action="insert.php" action="mail.php">
Email<input type="text" name="email" value ="" size="20" />
<input type="submit" value="submit" />
</form>
You simply can't submit two forms at once.

I'd propose to use AJAX's XMLHttpRequest. As a starting point, look
here: http://de.wikipedia.org/wiki/XMLHttpRequest

Basically, you need to instantiate two XMLHttpRequest object, and fire
them one after the other. Both XMLHttpRequest get fired asynchronously,
if used using correct settings.

To prepare the XMLHttpRequest, use JavaScript

Dec 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nomen Nescio | last post by:
can anyone be so kind as to look at http://www.mysolution.ws/HYPOCRITE.php and let me know why it isn't passing the form data to http://www.mysolution.ws/insertHYPOCRITES.php for the most...
13
by: dogu | last post by:
Noob alert. Code is below. File is saved as a .php. What I'm trying to do: User uses 'select' box drop down list to pick a value. Value ($site) is derived from a db query. This works fine....
7
by: Ant | last post by:
Hi, I'm, having some problems with this function. function displayElements() { for (i=0;i<document.forms.elements.length; ++i) { document.writeln(document.forms.elements.value); }
16
by: Hosh | last post by:
I have a form on a webpage and want to use JavaScript validation for the form fields. I have searched the web for form validation scripts and have come up with scripts that only validate...
7
by: louise raisbeck | last post by:
Hi, I'm sure this is a standard thing. I have a web form with several input boxes/drop down lists and checkboxes. They all represent a field within a sql table and I need the user to update the...
7
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem...
7
by: h7qvnk7q001 | last post by:
I'm trying to implement a simple server-side form validation (No Javascript). If the user submits a form with errors, I want to redisplay the same form with the errors highlighted. Once the form...
2
by: Norman Peelman | last post by:
From: "Norman Peelman" <npeelman@cfl.rr.com> Subject: Re: posting form data to two php scripts at once Date: Sunday, December 17, 2006 12:06 AM <one.1more@gmail.comwrote in message...
11
by: dba | last post by:
Have been displaying data from database using html for some time but just recently trying to display data back to "form". Can't find answer. <form method="post" action="<?php echo $PHP_SELF;?>">...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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.