Hi guys, I have another little problem with a form. I cannot get a couple sets of Radio buttons to show results in the email received. The page is live although not linked to from anywhere yet. www.hospitality-managers.com/contact.html
The page I think may be the problem is the freecontactformprocess.php - I think there may be something between these two pages not talking properly. I get the following results below whereby the website address is being sent thru correctly on the Website Address, but also again on the "style of Property: and the “Time required”. Any suggestions would be appreciated.
Form details below.
Full Name: G***** S*****
Email: *****@*****.com
Telephone: ######556
Website: www.hospitality-managers.com
Style: www.hospitality-managers.com
Time Required: www.hospitality-managers.com
Message: Another test from form
I don’t see anything obviously wrong in the html of the form, other than the extra spaces in the inputs of the second set of radios.
So the problem is most likely within the processor.
Hi there, I couldn’t see any difference between the bottom 3 lines, however I copied & pasted them as you have written. I wasn’t sure if you meant to completely remove the upper 3 lines of code or not. I tried removing them, but I then get the rest of the form delivering ok, but without the enquirers web address. (Before we had the www address on all 3 areas, website, style and time)
Form details below.
Full Name: G***** S*****
Email: *****@*****.com
Telephone: ######556
Website:
Style:
Time Required:
Message: Test
Hi guys,
Thanks for the help so far. Getting closer. I have put things back where they were as far as the upper 3 lines of code are concerned, but changed the last two lines of the lower code as follows:
and I now have the Style of property coming thru as follows:
Form details below.
Full Name: G***** S*****
Email: *****@*****.com
Telephone: ######556
Website: www.hospitality-managers.com
Style: Apartment
Time Required:
Message: Test again
So it looks like all we have to do now is try and get the “Time Required” to show something.
That’s exactly it - there was no difference between them, so they are putting the same information in to your email three times. They need to reflect the different values from the form.
Again, though, look carefully at this line of code:
$radio = $_POST['radSize']; // not required
What variable contains the value that you want to put into your email?
Hi there, Not 100% sure I know what you mean. I tried the following because I thought it should be time:
$email_message .= "Time Required: ".clean_string($time_required)."\r\n";
``` but it didn't work, then I looked back and thought maybe it should reflect the name of the radio buttons being $radSize but as I mentioned above, that didn't work either.
When I changed the "Style" one to: ```
$email_message .= "Style: ".clean_string($style)."\r\n";
``` then it worked, so I thought the "Time Required" should be the same, but no go.
Cheers,
OK, to ask the question another way. Where does your $radSize variable come from? Answer: nowhere at all, you never create a variable with that name. You have a form field called radSize, but you have to get the value from that form field (sent to your PHP in an array called $_POST) and put it into a variable. You have a line of code like this:
$radio = $_POST['radSize']; // not required
which gets the form field contents and assigns it to a variable. What is that variable called? (Note - PHP variables start with a $ dollar sign).
Hello again droopsnoot, I have found another problem. It all works perfectly from the desktop, also from an i-Pad which I have tested on both as per below results:
Form details below.
Full Name: *****
Email: *****
Telephone: *****
Website: *****
Style: Apartment
Time: 1 Month
Message: Test from desktop
Form details below.
Full Name: *****
Email: *****
Telephone: *****
Website: *****
Style: Motel
Time: 2 Weeks
Message: Test from ipad
However, the 1st lot of radio buttons won’t show on a Samsung phone and then it won’t send thru.
Both pages are live again, the /contact.html page along with the linked page from all pages the /form.php page.
Do you have any idea why this is now happening? I’m sure it worked yesterday.
Sorry, no idea. If it’s not drawing on the phone, that suggests it’s not a PHP issue, because that doesn’t come into it until you submit the form to the server, so you might be best opening a new topic in the HTML section.
Only thing that looks weird is the id for one of the options in the first radio button set, b&b seems a strange id. Could you change that and see if it alters anything?
Got it to work. The b&bwas short for Bed & Breakfast. In fact it may have been working before, but you had to look real hard to see the radio buttons. I cured it be creating a background behind the radio button and label. I also made one value “checked” so it is obvious to change if it is not correct. Appears to work perfectly everywhere now and is very obvious on the Samsung phone now.
Cheers.