0

Hello!
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!

3
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by NinjaMediaD
0

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

0

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';
f.submit();
<?php    /* your php code here */?>

}
</script>

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.

0

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

0

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:

<?php 
$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.