How can I send a form's informations to several php file...!?
For example, a user with a form can to register several website or blog.
I am waiting for your guidance and thanks!

5 Years
Discussion Span
Last Post by NinjaMediaD

Please explain this further. Do you know about this training or Subject!


I had a similar problem so what I did was link php with Javascript.

On the form submit button:

<input id="Cart66CheckoutButton" class="Cart66ButtonPrimary Cart66CompleteOrderButton" type="submit"  onclick="submitTwice(this.form);" value="Complete Order" name="Complete Order"/>

you will notice the on click event.
then above the form in javascript I have :

<script type="text/javascript">
function submitTwice(f){
f.action = '';  // whatever your form action is or you can leave blank.
f.target ='_self';
<?php    /* your php code here */?>


Now where the php code is you can include the php files and call the functions to perform actions on the submitted data. Hope that helps.


You do know that the php code is executed when the page is generated, and not when the javascript function is called ?


I believe line 4/5 of the javascript code generates a new page. It works (I tested it in opera, safari, ie 9, firefox) cross browser I can give you the site I used it on.

It is similar to using

<?php echo $_SERVER["PHP_SELF"];?>

as the action to a form. It refreshes the page, thus calling the php. My script was used to send an email to the site owner because cart 66 does not allow creditcard capture of manual checkout. The next line of PHP in the above code is:

$someVariable = $_POST['cardNumber']; 
if($someVariable != ""){ /* email info here */ }


It works try it.

*actual variable names have been changed

Edited by NinjaMediaD: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.