PHP Mailer not printing Value

5 replies·opened Jun 8, 2019
P
pankicidJun 8, 2019

Hi, I have a contact form like on the screenshot_1.
This is my HTML Code:

<form class="nobottommargin" id="template-contactform" name="template-contactform" action="include/sendemail.php" method="post">

								<div class="form-process"></div>

								<div class="col_one_third">
									<label for="template-contactform-name">Name <small>*</small></label>
									<input type="text" id="template-contactform-name" name="template-contactform-name" value="" class="sm-form-control required" />
								</div>

								<div class="col_one_third">
									<label for="template-contactform-email">Email <small>*</small></label>
									<input type="email" id="template-contactform-email" name="template-contactform-email" value="" class="required email sm-form-control" />
								</div>

								<div class="col_one_third col_last">
									<label for="template-contactform-phone">Telefon</label>
									<input type="text" id="template-contactform-phone" name="template-contactform-phone" value="" class="sm-form-control" />
								</div>

								<div class="clear"></div>

								<div class="col_full">
									<label for="template-contactform-service1">1. Um welche Projektart handelt es sich?</label>
									<select id="template-contactform-service1" name="template-contactform-service1" class="required sm-form-control">
										<option value="">-- Auswählen --</option>
										<option value="Private Website">Private Website</option>
										<option value="Firmenwebsite">Firmenwebsite</option>
										<option value="Webshop">Webshop</option>
										<option value="Weiß nicht">Weiß nicht</option>
									</select>
								</div>

								<div class="clear"></div>

								<div class="col_full">
									<label for="template-contactform-service2">2. Was soll gemacht werden?</label>
									<select id="template-contactform-service2" name="template-contactform-service2" class="required sm-form-control">
										<option value="">-- Auswählen --</option>
										<option value="Website Erstellen">Website Erstellen</option>
										<option value="Website Aktualisieren">Website Aktualisieren</option>
										<option value="Weiß nicht">Weiß nicht</option>
									</select>
								</div>

								<div class="clear"></div>

								<div class="col_full">
									<label for="template-contactform-service3">3. Gibt es bereits einen Server für die Seite?</label>
									<select id="template-contactform-service3" name="template-contactform-service3" class="required sm-form-control">
										<option value="">-- Auswählen --</option>
										<option value="Ja">Ja</option>
										<option value="Nein">Nein</option>
										<option value="Weiß nicht">Weiß nicht</option>
									</select>
								</div>

								<div class="clear"></div>

								<div class="col_full">
									<label for="template-contactform-service4">4. Wer soll die Inhalte der Website pflegen?</label>
									<select id="template-contactform-service4" name="template-contactform-service4" class="required sm-form-control">
										<option value="">-- Auswählen --</option>
										<option value="Agentur">Agentur</option>
										<option value="Eigenständig">Eigenständig</option>
										<option value="Weiß nicht">Weiß nicht</option>
									</select>
								</div>

								<div class="clear"></div>

								<div class="col_full">
									<label for="template-contactform-service5">5. Besteht bereits ein Corporate Design?</label>
									<select id="template-contactform-service5" name="template-contactform-service5" class="required sm-form-control">
										<option value="">-- Auswählen --</option>
										<option value="Ja">Ja</option>
										<option value="Nein">Nein</option>
										<option value="Weiß nicht">Weiß nicht</option>
									</select>
								</div>

								<div class="clear"></div>

								<div class="col_full">
									<label for="template-contactform-service6">6. Ist ein Domain- und Hosting-Paket vorhanden?</label>
									<select id="template-contactform-service6" name="template-contactform-service6" class="required sm-form-control">
										<option value="">-- Auswählen --</option>
										<option value="Ja">Ja</option>
										<option value="Nein">Nein</option>
										<option value="Weiß nicht">Weiß nicht</option>
									</select>
								</div>

								<div class="clear"></div>

								<div class="col_full">
									<label for="template-contactform-service7">7. Welche Aussage trifft am ehesten auf Ihr Unternehmen zu?</label>
									<select id="template-contactform-service7" name="template-contactform-service7" class="required sm-form-control">
										<option value="">-- Auswählen --</option>
										<option value="Geplante Gründung in unbestimmter Zukunft">Geplante Gründung in unbestimmter Zukunft</option>
										<option value="Unternehmen ist jünger als 6 Monate">Unternehmen ist jünger als 6 Monate</option>
										<option value="Unternehmen ist älter als 6 Monate">Unternehmen ist älter als 6 Monate</option>
										<option value="Sonstiges">Sonstiges</option>
									</select>
								</div>

								<div class="clear"></div>

								<div class="col_full">
									<label for="template-contactform-service8">8. Wann sollen die Maßnahmen abgeschlossen sein?</label>
									<select id="template-contactform-service8" name="template-contactform-service8" class="required sm-form-control">
										<option value="">-- Auswählen --</option>
										<option value="So schnell wie möglich">So schnell wie möglich</option>
										<option value="In 1 bis 3 Monaten">In 1 bis 3 Monaten</option>
										<option value="In mehr als 3 Monaten">In mehr als 3 Monaten</option>
										<option value="Weiß nicht">Weiß nicht</option>
									</select>
								</div>

							
								<div class="clear"></div>

								<div class="col_full">
									<label for="template-contactform-message">Nachricht <small>*</small></label>
									<textarea class="required sm-form-control" id="template-contactform-message" name="template-contactform-message" rows="6" cols="30"></textarea>
								</div>

								<div class="col_full hidden">
									<input type="text" id="template-contactform-botcheck" name="template-contactform-botcheck" value="" class="sm-form-control" />
								</div>

								<div class="col_full">
									<button name="submit" type="submit" id="submit-button" tabindex="5" value="Submit" class="button button-3d nomargin">Los Geht's</button>
								</div>

							</form>

I have also change the sendmail-autoresponder.php file like this:

if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
	if( $_POST['template-contactform-email'] != '' ) {

		$name = isset( $_POST['template-contactform-name'] ) ? $_POST['template-contactform-name'] : '';
		$email = isset( $_POST['template-contactform-email'] ) ? $_POST['template-contactform-email'] : '';
		$phone = isset( $_POST['template-contactform-phone'] ) ? $_POST['template-contactform-phone'] : '';
		$service = isset( $_POST['template-contactform-service'] ) ? $_POST['template-contactform-service'] : '';
		$service1 = isset( $_POST['template-contactform-service1'] ) ? $_POST['template-contactform-service1'] : '';
		$service2 = isset( $_POST['template-contactform-service2'] ) ? $_POST['template-contactform-service2'] : '';
		$service3 = isset( $_POST['template-contactform-service3'] ) ? $_POST['template-contactform-service3'] : '';
		$service4 = isset( $_POST['template-contactform-service4'] ) ? $_POST['template-contactform-service4'] : '';
		$service5 = isset( $_POST['template-contactform-service5'] ) ? $_POST['template-contactform-service5'] : '';
		$service6 = isset( $_POST['template-contactform-service6'] ) ? $_POST['template-contactform-service6'] : '';
		$service7 = isset( $_POST['template-contactform-service7'] ) ? $_POST['template-contactform-service7'] : '';
		$service8 = isset( $_POST['template-contactform-service8'] ) ? $_POST['template-contactform-service8'] : '';
		$subject = isset( $_POST['template-contactform-subject'] ) ? $_POST['template-contactform-subject'] : '';
		$message = isset( $_POST['template-contactform-message'] ) ? $_POST['template-contactform-message'] : '';

		$subject = isset($subject) ? $subject : 'New Message From Contact Form';

I have also change the sendmail-subscribe.php file like this:

if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
	if( $_POST['template-contactform-email'] != '' ) {

		$name = $_POST['template-contactform-name'];
		$email = $_POST['template-contactform-email'];
		$subscribe_email = $email;
		$phone = $_POST['template-contactform-phone'];
		$service = $_POST['template-contactform-service'];
		$service1 = $_POST['template-contactform-service1'];
		$service2 = $_POST['template-contactform-service2'];
		$service3 = $_POST['template-contactform-service3'];
		$service4 = $_POST['template-contactform-service4'];
		$service5 = $_POST['template-contactform-service5'];
		$service6 = $_POST['template-contactform-service6'];
		$service7 = $_POST['template-contactform-service7'];
		$service8 = $_POST['template-contactform-service8'];
		$subject = $_POST['template-contactform-subject'];
		$message = $_POST['template-contactform-message'];

		$subject = isset($subject) ? $subject : 'New Message From Contact Form';

I have also change the sendmail.php file like this:

if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
	if( $_POST['template-contactform-email'] != '' ) {

		$name = isset( $_POST['template-contactform-name'] ) ? $_POST['template-contactform-name'] : '';
		$email = isset( $_POST['template-contactform-email'] ) ? $_POST['template-contactform-email'] : '';
		$phone = isset( $_POST['template-contactform-phone'] ) ? $_POST['template-contactform-phone'] : '';
		$service = isset( $_POST['template-contactform-service'] ) ? $_POST['template-contactform-service'] : '';
		$service1 = isset( $_POST['template-contactform-service1'] ) ? $_POST['template-contactform-service1'] : '';
		$service2 = isset( $_POST['template-contactform-service2'] ) ? $_POST['template-contactform-service2'] : '';
		$service3 = isset( $_POST['template-contactform-service3'] ) ? $_POST['template-contactform-service3'] : '';
		$service4 = isset( $_POST['template-contactform-service4'] ) ? $_POST['template-contactform-service4'] : '';
		$service5 = isset( $_POST['template-contactform-service5'] ) ? $_POST['template-contactform-service5'] : '';
		$service6 = isset( $_POST['template-contactform-service6'] ) ? $_POST['template-contactform-service6'] : '';
		$service7 = isset( $_POST['template-contactform-service7'] ) ? $_POST['template-contactform-service7'] : '';
		$service8 = isset( $_POST['template-contactform-service8'] ) ? $_POST['template-contactform-service8'] : '';
		$subject = isset( $_POST['template-contactform-subject'] ) ? $_POST['template-contactform-subject'] : '';
		$message = isset( $_POST['template-contactform-message'] ) ? $_POST['template-contactform-message'] : '';

		$subject = $subject ? $subject : 'New Message From Contact Form';

**Тhe emails I get have only one field value (see Screenshot_2) **
Please help me to solve this issue

S
SemiColonWebSTAFFJun 10, 2019

Hello,

You appear to be using the Older Version of the Files. The Latest Version of Canvas uses include/form.php File which is more advanced and more flexible, as it does not require you to Edit the PHP File to add extra fields to your Forms. Please update to the Latest Version of the Files as this should fix your issues.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

P
pankicidJun 14, 2019

Hi I have updated to the Latest Version
<form class="nobottommargin" id="template-contactform" name="template-contactform" action="include/form.php" method="post">
But I geting a Bot Error mesage.
URL: https://web-mann.com/kontakt.html

P
pankicidJun 15, 2019

Hi please ignore my last message, I have figured out, but now I have another problem, all my forms (3 of them) working super but on index.html page when I submit the contact form I receive e-mail but my page crush.(blank page with my "alert": "success", "message" on it ) See the attached image.

P
pankicidJun 15, 2019

Please ignore all my messages I have figured out.
Sorry...

S
SemiColonWebSTAFFJun 15, 2019

Hello,

Really Glad that your issues were resolved. Thanks for your Patience.

Hope you will like the New Forms Processor and all its Customization Capabilities.

Do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard