Email variables from web form are empty

I have a web form that when a user submits it inserts into an SQL database and also sends an email advising of certain details in the form. The email sends through fine but the variables are empty. When I check the sendEmail.php in the console it returns the following error…

PHP Notice: Undefined index: problemdescript in D:\inetpub\wwwroot\SMT_Request_DevWIP\board\sendEmail.php on line 2

I’ve been following this question regarding changing the $_POST to a get or vise versa but the variables remain blank.

This is the sendEmail.php code…

   $details  = $_GET['problemdescript'];
   $to       = "";
   $subject  = "SMT Internal RFA: A new job has been created";
   $message  = "
   Ticket details: $details \n
   Please click the following link to access the SMT Track & Trace system 
and view the ticket: 
   $headers  = "Cc:";

And here is my index.php which contains the form (which i’ve slimmed down as it’s a rather large form)…

<form id="newForm" action="sendEmail.php" method="post" enctype="multipart/form-data">

<label for="problem"><b>Problem Description:</b></label><br>
<textarea id="problemdesc" name="problemdescript" style='background-color: #ffff99'; cols="100" rows="4" style="resize:none" placeholder="Please provide as     much information as possible..."></textarea>


I want whatever is written in the ‘problemdescript’ textarea to be displayed within the email but so far can’t get anything back. Any help would be greatly appreciated.

You should first have a look at what data your script is getting, so use var_dump($_GET, $_POST, $_REQUEST) and see where the data is

Sponsor our Newsletter | Privacy Policy | Terms of Service