Jump to content

php contact form in swish


Bendeguz

Recommended Posts

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 = "info@mafloral.com";//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

Link to comment
Share on other sites

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 = "info@mafloral.com";//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&";
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.