Re: [PHP] form with two actions
in php, do $perl=fopen('http://localhost/your_perl_script.pl?data='.$your_data,'r'); fclose($perl); optionaly, you can read from the file handler to get some feedback from the perl script Scott wrote: I just realized I should have been more specific with my question. What I want to do is use php to submit registration data to the database and then send part of the data to a perl script to be encrypted and sent in an email. I have to use perl for the encryption because of user permissions on the server-Php and GPG run as different users. So I have to send the data in 2 different directions rather than keep it in the same script. I would like to be able to do it without having the user do double entries. If I can still do this without two submits, then I guess I do need an example. Thanks for the responses, SW On Wednesday 13 November 2002 07:16 am, you wrote: For that example, you don't need two submits... the same script that handles the submitted data for the database can send the email... usually it's only a problem if one form has to be submitted to two servers, or something... do you need an example? Justin on 13/11/02 3:05 PM, Scott ([EMAIL PROTECTED]) wrote: Hello I would like to know if it is possible to use Php to make a form perform 2 actions by having the user click on a single submit button. For instance, send data to a database and email it simultaneously. I would prefer not to use javascript. If someone could point me to an example I would appreciate it Thanks, S.W. Justin French Creative Director http://Indent.com.au Web Developent & Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fwd: Re: [PHP] form with two actions
I just realized I should have been more specific with my question. What I want to do is use php to submit registration data to the database and then send part of the data to a perl script to be encrypted and sent in an email. I have to use perl for the encryption because of user permissions on the server-Php and GPG run as different users. So I have to send the data in 2 different directions rather than keep it in the same script. I would like to be able to do it without having the user do double entries. If I can still do this without two submits, then I guess I do need an example. Thanks for the responses, SW On Wednesday 13 November 2002 07:16 am, you wrote: > For that example, you don't need two submits... the same script that > handles the submitted data for the database can send the email... > > usually it's only a problem if one form has to be submitted to two servers, > or something... > > do you need an example? > > > Justin > > on 13/11/02 3:05 PM, Scott ([EMAIL PROTECTED]) wrote: > > Hello > > I would like to know if it is possible to use Php to make a form perform > > 2 actions by having the user click on a single submit button. For > > instance, send data to a database and email it simultaneously. I would > > prefer not to use javascript. If someone could point me to an example I > > would appreciate it > > > > Thanks, > > S.W. > > Justin French > > Creative Director > http://Indent.com.au > Web Developent & > Graphic Design > --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form with two actions
I just realized I should have been more specific with my question. What I want to do is use php to submit registration data to the database and then send part of the data to a perl script to be encrypted and sent in an email. I have to use perl for the encryption because of user permissions on the server-Php and GPG run as different users. So I have to send the data in 2 different directions rather than keep it in the same script. I would like to be able to do it without having the user do double entries. If I can still do this without two submits, then I guess I do need an example. Thanks for the responses, SW On Wednesday 13 November 2002 07:16 am, you wrote: > For that example, you don't need two submits... the same script that > handles the submitted data for the database can send the email... > > usually it's only a problem if one form has to be submitted to two servers, > or something... > > do you need an example? > > > Justin > > on 13/11/02 3:05 PM, Scott ([EMAIL PROTECTED]) wrote: > > Hello > > I would like to know if it is possible to use Php to make a form perform > > 2 actions by having the user click on a single submit button. For > > instance, send data to a database and email it simultaneously. I would > > prefer not to use javascript. If someone could point me to an example I > > would appreciate it > > > > Thanks, > > S.W. > > Justin French > > Creative Director > http://Indent.com.au > Web Developent & > Graphic Design > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form with two actions
For that example, you don't need two submits... the same script that handles the submitted data for the database can send the email... usually it's only a problem if one form has to be submitted to two servers, or something... do you need an example? Justin on 13/11/02 3:05 PM, Scott ([EMAIL PROTECTED]) wrote: > Hello > I would like to know if it is possible to use Php to make a form perform 2 > actions by having the user click on a single submit button. For instance, > send data to a database and email it simultaneously. I would prefer not to > use javascript. If someone could point me to an example I would appreciate it > > Thanks, > S.W. Justin French Creative Director http://Indent.com.au Web Developent & Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form with two actions
If you want php to do it in the remote server (your case), of course, you do not have to use javascript // Just do like this if (isset($_POST['submit'])) // to verify that browser are sending something correctly { // --> record posted data into database and after // --> send mail } But if you want 2 actions in the client-side browser, you should use javascript, for example you want first to check data and simultaneously, display progress bar (animated gif), like this onsubmit="return(send_data(document.form));" and the on the function send_data() you have 1. do action 1 2. do action 2 3. return true - Original Message - From: "Scott" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Wednesday, November 13, 2002 4:05 PM Subject: [PHP] form with two actions > Hello > I would like to know if it is possible to use Php to make a form perform 2 > actions by having the user click on a single submit button. For instance, > send data to a database and email it simultaneously. I would prefer not to > use javascript. If someone could point me to an example I would appreciate it > > Thanks, > S.W. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form with two actions
Hi Scott, what you want to do can be acomplished just by telling php what to do in order... for example run the $query to insert the data into the DB and after that, run a mail function that sends the mail. IF you want to be more elegant in your scripting, do the mailing within an IF clause so the mail will be sent ONLY and ONLY IF the data was succsesfully stored into the DB. Cheers, Cesar - Original Message - From: "Scott" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Wednesday, November 13, 2002 2:05 AM Subject: [PHP] form with two actions > Hello > I would like to know if it is possible to use Php to make a form perform 2 > actions by having the user click on a single submit button. For instance, > send data to a database and email it simultaneously. I would prefer not to > use javascript. If someone could point me to an example I would appreciate it > > Thanks, > S.W. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] form with two actions
Hello I would like to know if it is possible to use Php to make a form perform 2 actions by having the user click on a single submit button. For instance, send data to a database and email it simultaneously. I would prefer not to use javascript. If someone could point me to an example I would appreciate it Thanks, S.W. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php