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 = "[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

Link to comment
https://forums.phpfreaks.com/topic/131342-php-contact-form-in-swish/
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 = "[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&";
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.