PHP Flash form help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kronikle88
    New Member
    • Feb 2008
    • 2

    PHP Flash form help

    Hey,
    I am new to PHP, and i have been reading up on it a little, but I seem to be having some trouble. In a flash website im making i created a form from a template i found. The original template had E-mail, Name, Comment fields, and the PHP code is as follow,

    Code:
    <?
    
    $destination="mjweitz@gmail.com";
    $name=$_POST['name'];
    $email=$_POST['email'];
    $mes=$_POST['comments'];
    $subject="Message from $name" ;
    $mes="Name : $name\n
    Email: $email\n
    Comments: $mes\n";
    mail($destination,$subject,$mes); ?>

    In the flash video, i added a few fields, Street Address, City, State, Zip, Favorite Designers, and i reformated the code to this, but now it doesnt work at all. If anyone can assist me in what i am doing wrong, i would be greatly happy.

    Code:
    <?
    
    $destination="mjweitz@gmail.com";
    $name=$_POST['name'];
    $email=$_POST['email'];
    $mes=$_POST['street'];
    $mes=$_POST['city'];
    $mes=$_POST['state'];
    $mes=$_POST['zip'];
    $mes=$_POST['designer'];
    $mes=$_POST['comments'];
    $subject="LINK WEBSITE Form, From $name" ;
    $mes="Name : $name\n
    Email: $email\n
    Street Address: $street\n";
    City/Town: $city\n";
    State: $state\n";
    Zip: $zip\n";
    Favorite Designers: $designer\n";
    Comments: $mes\n";
    mail($destination,$subject,$mes); ?>
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by Kronikle88
    Hey,
    I am new to PHP, and i have been reading up on it a little, but I seem to be having some trouble. In a flash website im making i created a form from a template i found. The original template had E-mail, Name, Comment fields, and the PHP code is as follow,

    Code:
    <?
    
    $destination="mjweitz@gmail.com";
    $name=$_POST['name'];
    $email=$_POST['email'];
    $mes=$_POST['comments'];
    $subject="Message from $name" ;
    $mes="Name : $name\n
    Email: $email\n
    Comments: $mes\n";
    mail($destination,$subject,$mes); ?>

    In the flash video, i added a few fields, Street Address, City, State, Zip, Favorite Designers, and i reformated the code to this, but now it doesnt work at all. If anyone can assist me in what i am doing wrong, i would be greatly happy.

    Code:
    <?
    
    $destination="mjweitz@gmail.com";
    $name=$_POST['name'];
    $email=$_POST['email'];
    $mes=$_POST['street'];
    $mes=$_POST['city'];
    $mes=$_POST['state'];
    $mes=$_POST['zip'];
    $mes=$_POST['designer'];
    $mes=$_POST['comments'];
    $subject="LINK WEBSITE Form, From $name" ;
    $mes="Name : $name\n
    Email: $email\n
    Street Address: $street\n";
    City/Town: $city\n";
    State: $state\n";
    Zip: $zip\n";
    Favorite Designers: $designer\n";
    Comments: $mes\n";
    mail($destination,$subject,$mes); ?>
    [php]
    $destination="m jweitz@gmail.co m";
    $name=$_POST['name'];
    $email=$_POST['email'];
    $mes=$_POST['street'];
    $mes=$_POST['city'];
    $mes=$_POST['state'];
    $mes=$_POST['zip'];
    $mes=$_POST['designer'];
    $mes=$_POST['comments'];
    $subject="LINK WEBSITE Form, From $name" ;
    $mes="Name : $name\n
    Email: $email\n
    Street Address: $street\n
    City/Town: $city\n
    State: $state\n
    Zip: $zip\n
    Favorite Designers: $designer\n
    Comments: $mes\n";
    mail($destinati on,$subject,$me s); ?>
    [/php]

    Notice the quotes and semicolons i took out.
    They are used to end strings... you were ending strings that hadnt even started :P

    Comment

    • TheServant
      Recognized Expert Top Contributor
      • Feb 2008
      • 1168

      #3
      Originally posted by markusn00b
      [php]
      $destination="m jweitz@gmail.co m";
      $name=$_POST['name'];
      $email=$_POST['email'];
      $mes=$_POST['street'];
      $mes=$_POST['city'];
      $mes=$_POST['state'];
      $mes=$_POST['zip'];
      $mes=$_POST['designer'];
      $mes=$_POST['comments'];
      $subject="LINK WEBSITE Form, From $name" ;
      $mes="Name : $name\n
      Email: $email\n
      Street Address: $street\n
      City/Town: $city\n
      State: $state\n
      Zip: $zip\n
      Favorite Designers: $designer\n
      Comments: $mes\n";
      mail($destinati on,$subject,$me s); ?>
      [/php]

      Notice the quotes and semicolons i took out.
      They are used to end strings... you were ending strings that hadnt even started :P
      I don't understand why you are changing the $mes variable? Shouldn't it be:
      [php]
      $destination="m jweitz@gmail.co m";
      $name=$_POST['name'];
      $email=$_POST['email'];
      $street=$_POST['street'];
      $city=$_POST['city'];
      $state=$_POST['state'];
      $zip=$_POST['zip'];
      $designer=$_POS T['designer'];
      $comments=$_POS T['comments'];
      $subject="LINK WEBSITE Form, From $name" ;
      $mes="Name : $name\n
      Email: $email\n
      Street Address: $street\n
      City/Town: $city\n
      State: $state\n
      Zip: $zip\n
      Favorite Designers: $designer\n
      Comments: $comments\n";
      mail($destinati on,$subject,$me s); ?>
      [/php]

      Comment

      • Kronikle88
        New Member
        • Feb 2008
        • 2

        #4
        Now that i see it, its so obvious. I guess looking at the same thign over and over, you tend to ove rlook the minor mistakes. Thank you guys very much for your help.
        Back to the books!

        Comment

        Working...