Hi all,
My first post here. I would be very thankful if you could help me with a recent problem of mine.
I have been asked to put together a website for my friend, as I used to dabble with a little HTML in my teens - I have been ‘out of it’ for 10 years and a lot has changed! so I am trying to play catch up as you can imagine.
One of my friend’s requests was for a contact form with a few, in my view, complicated components - like checkboxes and alternative questions than the usual ‘Name’ ‘Email’ ‘Contact number’ etc.
I have copied across the code I am using, I was wondering if any of you could highlight where I am going wrong. On a test run of the form, I am receiving the error: ‘Parse error: syntax error, unexpected ‘<’ in D:\Hosting\11889492\html\contact_nextstep\contact.php on line 15’
[code]
What would you like to achieve with your health and fitness?: |
Out of the following, which are your top 3 concerns?:
Weight
Tone
Shape
Mobility
Energy |
When you look in the mirror, physically how do you view yourself?: |
Does the way you view yourself, make you feel...: Content Frustrated Sad |
What potential problem(s) could get in the way of you achieving your goals?: |
How does the way you look and feel hold you back in life?: |
How would achieving this goal impact your life?: |
Name: |
Email: |
Contact number: |
Only click the Next Step button if you are ready to begin your transformation and get the results you deserve. |
[php]<?php
$q1 = $_POST[‘q1’];
$q2 = $_POST[‘q2’];
$q3 = $_POST[‘q3’];
$q4 = $_POST[‘q4’];
$q5 = $_POST[‘q5’];
$q6 = $_POST[‘q6’];
$q7 = $_POST[‘q7’];
$name = $_POST[‘name’];
$email = $_POST[‘email’];
$contact = $_POST[‘contact’];
$formcontent=" From: $name \n Contact number: $contact \n What would you like to achieve with your health and fitness: $q1 \n Out of the following which are your top 3 concerns: $q2 \n When you look in the mirror physically how do you view yourself: $q3 \n Does the way you view yourself make you feel: $q4 \n What potential problems could get in the way of you achieving your goals: $q5 \n How does the way you look and feel hold you back in life: $q6 \n How would achieving this goal impact your life: $q7";
$recipient = "[email protected]";
$subject = “JP Budget Fitness website submission”;
$mailheader = “From: $email \r\n”;
mail($recipient, $subject, $formcontent, $mailheader) or die(“Error!”);
echo “Thank you!”;
?>[/php]
Also, I feel really cheeky asking for some reason but do any of you know how to redirect the user to my own thankyou.html and error.html pages? As again, that is another request from my friend that without your help, I doubt I would be able to achieve. Google has not been kind this time round!
Thank you in advance for your help. (if anyone helps that is…)
Pete