Jump to content

PHP linked to button


Chronix

Recommended Posts

Hi all, first time posting here and wondering if anyone can help me.

 

Ive linked a button in a HTML so that it sends an email to me. But the thing thats really bugging me is that sometimes it sends the persons email address and sometimes it doesnt AND ALSO ive got multiple boxes in my HTML that I want it to send but it will only send 1 and not all 5. This is what my PHP looks like at the moment:

 

<?php
  $email = $_REQUEST[ 'email_box' ] ;
  $message = $_REQUEST[ 'test1_box' ] ;
  $message = $_REQUEST[ 'test2_box' ] ;
  $message = $_REQUEST[ 'test3_box' ] ;
  $message = $_REQUEST[ 'test4_box' ] ;
  $message = $_REQUEST[ 'test5_box' ] ;

  mail( "test1049@live.com", "Test Feedback sheet",
    $message, "From: $email" );
?>

 

Can you please tell me where I have gone wrong? I really need this to be sorted out and im completely new to PHP, ive only just gotten past basic knowledge of html


Link to comment
Share on other sites

Thanks for the help, I got the email to work properly now but im having problems with the php page loading a HTML after it has submitted the email. Heres the code im using:

 

<?php
  $email = $_POST[ 'email_box' ] ;
  $message1 = $_POST[ 'test1_box' ] ;
  $message2 = $_POST[ 'test2_project_box' ] ;
  $message3 = $_POST[ 'test3_box' ] ;
  $message4 = $_POST[ 'test4_box' ] ;
  $message5 = $_POST[ 'test5_box' ] ;

   mail("live1049@live.com", 'Test Email Feedback Form', "test email: ".$email."\n\ntest1: ".$message1."\n\ntest2: ".$message2."\n\ntest3:".$message3."\n\ntest4: ".$message4."\n\ntest5: ".$message5, "From: $email");
header( 'Location:thankyou.html' ) ;
?>

 

Whats gone wrong? It keeps saying Warning: Cannot modify header information - headers already sent by everytime sendmail.php loads

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.