Jump to content

Recommended Posts

Hi

I need help, this was my first time setting up a web based form and using php.

I created two forms hidden on a website that a href link will be sent to our clients to direct them to a survey. I have set everything up and everything is working but for some reason when the client hits send the data that the form captures is not pulled though to the admin email set up.

I know it's something to do with my php.

 

these are the surveys

and this is my PHP doc for both. I can't see where i'm going wrong. Please help i'm desperate and need to get this working ASAP.

I just can't SEE where I have made the error.

HUGE Thanks

 

Student php

<?php

 

/* Subject and Email Variables */

 

$emailSubject = 'Student Survey Completed ';

$webMaster = 'nataliea@selections.co.za' ;

 

/* Gathering Data Variables */

 

$emailField = $_POST['name'];

$surnameField = $_POST['surname'];

$institutionField = $_POST['institution'];

$yearField = $_POST['year'];

$telField = $_POST['tel'];

$emailField = $_POST['email'];

$productInfoField = $_POST['RadioGroup1'];

$interactivePresentationField = $_POST['RadioGroup2'];

$learnSomethingNewField = $_POST['RadioGroup3'];

$commentsField = $_POST['comments'];

$productsField = $_POST['products'];

 

$body = <<<EOD

<br><hr><br>

Name: $name <br>

Surname: $surname <br>

Institution: $institution <br>

Year: $year <br>

Tel: $tel <br>

Email: $email <br>

Product Information: $productInfo <br>

Interactive Presentation: $interactivePresentation <br>

Learn Something New: $learnSomethingNew <br>

Comments: $comments <br>

Products: $products <br>

EOD;

 

$headers = "From: $email\r\n";

$headers .= "Content-type: text/html\r\n";

$success = mail($webMaster, $emailSubject, $body, $headers);

 

 

/* Results rendered as HTML */

 

$theResults = <<<EOD

<html>

<head>

<title>Selections Warehouse Student Feedback</title>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<style type="text/css">

<!--

body {

background-color: #ADADA5;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

font-style: normal;

line-height: normal;

font-weight: normal;

color: #666666;

text-decoration: none;

}

.style14 {color: #69AAB7;

font-weight: bold;

font-size:8px;

}

.style4 { font-size: 11px;

font-weight: bold;

text-align: center;

color: #000000;

}

-->

</style>

</head>

 

<div>

<div align="left">

<table width="658" align="center">

<tr>

<td width="650" colspan="2" align="center" valign="top"><img src="../Ref/header_2.png" alt="1" width="650" height="200" /></td>

</tr>

<tr>

<td width="650" height="59" colspan="2" align="center" valign="top" bgcolor="#FFFFFF"><p> </p>

<p>Thank you for successfully completing the student feedback servey. </p>

<p>Sould you have any questions please feel free to contact us.</p>

<p> </p></td>

</tr>

<tr>

<td height="28" colspan="2" align="center" valign="middle" bgcolor="#D0CEC7" class="style4">Ground Floor, Wembly Square 2, Solan Street, Gardens, 8001 -

Tel: 021 815 5798 - <a href="

</tr>

<tr>

<td height="10" colspan="2" align="center" valign="middle" class="style4"><span class="style14">FIND US ON FACEBOOK AND LIKE OUR PAGE TO FIND OUT MORE ABOUT OUR UPCOMING FUNCTIONS, EXHIBITIONS AND EVENTS. </span></td>

</tr>

<tr>

<td height="28" colspan="2" align="center" valign="middle" class="style4"><table width="14%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td align="right" valign="top"> </td>

<td align="middle" valign="top" width="5"></td>

<td align="right" valign="top"><a href="
title="Pintrest"><img src="../Ref/pinttrest.jpg" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td>

<td align="middle" valign="top" width="5"></td>

<td align="right" valign="top"><a href="
title="twitter"><img src="../Ref/image_8451441.gif" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td>

<td align="middle" valign="top" width="5"></td>

<td align="right" valign="top"><a href="
title="fb"><img src="../Ref/image_4604455.gif" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td>

</tr>

</table>

<div align="center"></div></td>

</tr>

</table>

</div>

</div>

</body>

</html>

EOD;

echo "$theResults";

?>

 

 

Supplier php

<?php

 

/* Subject and Email Variables */

 

$emailSubject = 'Supplier Survey Completed ';

$webMaster = 'nataliea@selections.co.za' ;

 

/* Gathering Data Variables */

 

$emailField = $_POST['name'];

$surnameField = $_POST['surname'];

$companyField = $_POST['company'];

$telField = $_POST['tel'];

$emailField = $_POST['email'];

$displayField = $_POST['RadioGroup1'];

$feedbackField = $_POST['RadioGroup2'];

$serviceField = $_POST['RadioGroup3'];

$remainField = $_POST['RadioGroup4'];

$activitiesField = $_POST['activities'];

$improvementField = $_POST['improvements'];

 

$body = <<<EOD

<br><hr><br>

Name: $name <br>

Surname: $surname <br>

Company: $company <br>

Tel: $tel <br>

Email: $email <br>

Display: $RadioGroup1 <br>

Feedback: $RadioGroup2 <br>

Service: $RadioGroup3 <br>

Remain: $RadioGroup4 <br>

Activities: $activities <br>

Improvement: $improvements <br>

EOD;

 

$headers = "From: $email\r\n";

$headers .= "Content-type: text/html\r\n";

$success = mail($webMaster, $emailSubject, $body, $headers);

 

 

/* Results rendered as HTML */

 

$theResults = <<<EOD

<html>

<head>

<title>Selections Warehouse Supplier Feedback</title>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<style type="text/css">

<!--

body {

background-color: #ADADA5;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

font-style: normal;

line-height: normal;

font-weight: normal;

color: #666666;

text-decoration: none;

}

.style14 {color: #69AAB7;

font-weight: bold;

font-size:8px;

}

.style4 { font-size: 11px;

font-weight: bold;

text-align: center;

color: #000000;

}

-->

</style>

</head>

 

<div>

<div align="left">

<table width="658" align="center">

<tr>

<td width="650" colspan="2" align="center" valign="top"><img src="../Ref/header.png" alt="1" width="650" height="200" /></td>

</tr>

<tr>

<td width="650" height="59" colspan="2" align="center" valign="top" bgcolor="#FFFFFF"><p> </p>

<p>Thank you for successfully completing the supplier servey. </p>

<p>Sould you have any questions please feel free to contact us.</p>

<p> </p></td>

</tr>

<tr>

<td height="28" colspan="2" align="center" valign="middle" bgcolor="#D0CEC7" class="style4">Ground Floor, Wembly Square 2, Solan Street, Gardens, 8001 -

Tel: 021 815 5798 - <a href="

</tr>

<tr>

<td height="10" colspan="2" align="center" valign="middle" class="style4"><span class="style14">FIND US ON FACEBOOK AND LIKE OUR PAGE TO FIND OUT MORE ABOUT OUR UPCOMING FUNCTIONS, EXHIBITIONS AND EVENTS. </span></td>

</tr>

<tr>

<td height="28" colspan="2" align="center" valign="middle" class="style4"><table width="14%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td align="right" valign="top"> </td>

<td align="middle" valign="top" width="5"></td>

<td align="right" valign="top"><a href="
title="Pintrest"><img src="../Ref/pinttrest.jpg" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td>

<td align="middle" valign="top" width="5"></td>

<td align="right" valign="top"><a href="
title="twitter"><img src="../Ref/image_8451441.gif" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td>

<td align="middle" valign="top" width="5"></td>

<td align="right" valign="top"><a href="
title="fb"><img src="../Ref/image_4604455.gif" width="24" height="24" style="display:block;" border="0" alt="1"/></a></td>

</tr>

</table>

<div align="center"></div></td>

</tr>

</table>

</div>

</div>

</body>

</html>

EOD;

echo "$theResults";

?>

Link to comment
https://forums.phpfreaks.com/topic/273897-php-servey-form-help/
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.