Bendeguz Posted November 4, 2008 Share Posted November 4, 2008 hello all I am very new to php and am having trouble adding the php script to my contact form. I have a contact form made in swishmax2. this form was a tutorial and i have done that. But as for the php script for the contact form, it was not explained how and where to add script if i create new fields in the movie. I have done this in Swishmax2 this code is for thew submit button. Now originally there was 4 fields with this tutorial and i added 4 more but i am not sure where to add the extra php script for the new fields. this is the script in Swishmax2 for the submit button: on (release) { if((bridenameVar=="")||(brideemailVar=="")||(weddingdateVar=="")||(ceremonylocationVar=="")||(bridesaddressVar=="")||(cityVar=="")||(zipcodeVar=="")||(weddingdetailsVar=="")){ errormessage="Please fill out all the fields"; } else { errormessage="Sending...."; send="yes"; this.loadVariables("contact.php",'POST'); send="no"; bridenameVar="";//this was the nameVar// brideemailVar="";//this was the emailVar// weddingdateVar="";//this was the subjectVar// ceremonylocationVar="";//new field added// bridesaddressVar="";//new field added// cityVar="";//new field added// zipcodeVar="";//new field added// weddingdetailsVar="";//this was the messageVar// } } Now the original php script that came with the tutorial is this: <? if ($send=="yes") { $to = "[email protected]";//this is the email the message will be delivered to// $subject = "$subjectVar"; $body .= "$msgVar"; $from = "$nameVar"; $tfrom = "From: <$emailVar>"; mail($to,$subjectVar,$msgVar,$tfrom); } echo "&errormessage=Email has been sent&"; ?> Could someone please help me with adding the script in the php for the newly created fields. Thanks in Advance Bendeguz Quote Link to comment https://forums.phpfreaks.com/topic/131342-php-contact-form-in-swish/ Share on other sites More sharing options...
serverman Posted November 4, 2008 Share Posted November 4, 2008 pease use code btn it is maked with # makes code easy to read <?php on (release) { if((bridenameVar=="")||(brideemailVar=="")||(weddingdateVar=="")||(ceremonylocationVar=="")||(bridesaddressVar=="")||(cityVar=="")||(zipcodeVar=="")||(weddingdetailsVar=="")){ errormessage="Please fill out all the fields"; } else { errormessage="Sending...."; send="yes"; this.loadVariables("contact.php",'POST'); send="no"; bridenameVar="";//this was the nameVar// brideemailVar="";//this was the emailVar// weddingdateVar="";//this was the subjectVar// ceremonylocationVar="";//new field added// bridesaddressVar="";//new field added// cityVar="";//new field added// zipcodeVar="";//new field added// weddingdetailsVar="";//this was the messageVar// } } Now the original php script that came with the tutorial is this: ?> <?php if ($send=="yes") { $to = "[email protected]";//this is the email the message will be delivered to// $subject = "$subjectVar"; $body .= "$msgVar"; $from = "$nameVar"; $tfrom = "From: <$emailVar>"; mail($to,$subjectVar,$msgVar,$tfrom); } echo "&errormessage=Email has been sent&"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/131342-php-contact-form-in-swish/#findComment-682032 Share on other sites More sharing options...
Bendeguz Posted November 4, 2008 Author Share Posted November 4, 2008 Hello the first script is not a php it's just an action script in Swishmax. The second script is the php script for the contact form. Thanks Bendeguz Quote Link to comment https://forums.phpfreaks.com/topic/131342-php-contact-form-in-swish/#findComment-682042 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.