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

Problem with two form actions in form tag

118 100+
Hi,



I am getting the problem with form tag. i,e in in form action i am placing the some autoresponder page like

<form name="form1" method="post" action="http://www.autoresponder.com">
When i submit this form it goes to the page http://www.autoresponder.com .Along with this i want to run some extra functionality(mail sending) after the form submission .like
<?
//test mail
mail($to,$subject,$message)
?>

How can i run both the mail functionality and form action at the same time of form submission. Anybody please help me how i approch.



Thanks
Sravani
Oct 19 '09 #1
3 1841
ak1dnar
1,584 Expert 1GB
Php is executed line by line on the server side, and you can use conditional statements to manage the execution flow.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if($_POST){
  3. mail(.....)
  4. }
  5. ?> 
  6.  
Oct 19 '09 #2
Atli
5,058 Expert 4TB
@swethak
PHP is executed server-side, the form action is performed client-side.
Once your client is able to submit the form, your PHP code has long since finished executing.

If you want to execute some code when the user submits the form, you need to either do that on the page that the form is submitted to, or do it client-side before the form is submitted.
Oct 19 '09 #3
TheServant
1,168 Expert 1GB
I suspect that you will need to look at AJAX to submit data without sending it in traditional html. That way when a user clicks submit it can run a script in the background and then submit the page. The challenging part will be having two information/warning boxes.

I personally think that Atli's solution of having it all on one page is much easier. Using a simple include() the main part of the form processor can include the mail part from a separate file.
Oct 19 '09 #4

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

Similar topics

1
by: Lamberti Fabrizio | last post by:
I've an authentication problem with IServerXMLHTTPRequest. I've got two web server named WS_1 and WS_2 part of the same NT domain. On WS_1 I've published on the virtual directory virt1 the asp...
2
by: Matt | last post by:
The ASP page has multiple buttons, and when the user clicks different buttons, it will submit the form data to different URLs. My first approach was to use BUTTON type, and triggers javascript...
10
by: scorpion53061 | last post by:
What I thought would be pretty easy has turned out not to be. I have three variables. Actiontime is formatted as 08/11/2004 11:03PM Actiontime JobStreamStart (11:00:00PM) JobStreamEnd...
1
by: Mark Denardo | last post by:
I stumbled across a weird problem that I don't seem to understand and was wondering if anyone could help explain why it is occurring: Basically I have set up a client/server application where the...
4
by: hzgt9b | last post by:
Using VB .NET 2003, I have a windows application that performs a series of file actions (copy, move, delete) but the actions are completing before the window is painted on the screen... how can I...
5
by: Nadav | last post by:
Hi, I am writing a Thread pooled P2P application, I have a constant flow of actions that produce a certain problem, though I cannot find it’s cause. I get “Free Heap block 356c00 modified at...
4
by: asad.naeem | last post by:
hi to all this is the problem about inheritence. I have designed a form with some essential controls which are required for every form which will inherited from it. for example i have Button1 on...
7
xNephilimx
by: xNephilimx | last post by:
lHi guys! I'm having a little problem that's getting on my nerves, I couldn't find a solution, I also tryed googling it and I found nothing... (my field of expertise is in AS 2 and 3, but I still...
5
by: inepu | last post by:
I have 3 tables, Actions, Objects and AO, where "AO" a table that relates Actions and Objects, each row is a pair the other tables' keys) I have a form that is generated with values from Objects,...
1
by: javabeginner123 | last post by:
i have a java prob, and i have to solve it fast, but i'm just getting to know it, so plz help me solve it with full code completed, thanks so much. the prob is to create a monter fight and there is...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.