473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Email PHP Form "Confirmation email" - Radio Group Problem

Hi,

I have a form on a site I am working on. 99% of it all works fine, but there is one thing that is not working.

This is the form:

http://www.leighdesignstudio.com/itech/iquote.php

The problem area is the four radio buttons.
actually - just the IT services one.

The validation is all fine. its just when the email confirmation gets sent to the client, one thing is not working. I have spent a while on this and i have it as close as i can get.

If i select IT services - the confirmation email is CORRECT.
However, if i select anything else, the one that is correct will appear, but it will also show that i have selected IT services. I have tried various different things. I will put the relevant code here:

iquote page
Expand|Select|Wrap|Line Numbers
  1. <label>
  2. <input type="radio" name="rdGroup" value="iphone" id="iphone" />
  3. iPhone </label>
  4. <label>
  5. <input type="radio" name="rdGroup" value="ipad" id="ipad" />
  6. iPad </label>
  7. <label>
  8. <input type="radio" name="rdGroup" value="ipod" id="ipod" />
  9. iPod Touch</label>
  10. <label>
  11. <input type="radio" name="rdGroup" value="it" id="it" />
  12. IT issue</label>
iquote thanks page
Expand|Select|Wrap|Line Numbers
  1. $it = "iT Services";
  2. $fullmessage .= "Which service are you enquiring about\r\n";
  3. $fullmessage .= "---------------------------------------------------";
  4. if ($rdGroup="iphone") {$fullmessage .= "$iPhone\r\n";}
  5. if ($rdGroup="ipad") {$fullmessage .= "$iPad\r\n";}
  6. if ($rdGroup="ipod") {$fullmessage .= "$iPod\r\n";}
  7. if ($rdGroup!="iphone" || $rdGroup!="ipad" || $rdGroup!="ipod") {$fullmessage .= "$it\r\n";}
  8.  
  9. I tried this before - also didn't work.
  10. if ($rdGroup="it") {$fullmessage .= "$it\r\n";}
  11.  
  12. if ($rdGroup="it") {$fullmessage .= "IT";}
Any help would be much appreciated!
Leigh
May 7 '12 #1
2 1896
johny10151981
1,059 1GB
in php = is assignment operator.

Expand|Select|Wrap|Line Numbers
  1. //say you have selected "ipod"
  2. //if your try this code what happen is important
  3.  
  4. if ($rdGroup="it") //FIRST IT SET the value of $rdGroup to "it" and then it varify the statement, which is true
  5. {
  6. //it enter here.
  7.  $fullmessage .= "$it\r\n";
  8.  
  9. }
  10.  
  11. if ($rdGroup="it") //then again same thing and it enter here
  12. {
  13. $fullmessage .= "IT";
  14.  
  15. }
  16.  
the corrected code for comparing two argument for equality is ==
as example
Expand|Select|Wrap|Line Numbers
  1. if($i==3) .. //do action
  2.  
  3.  
some compiler dont allow to assign in the if statement but php does, so be careful
May 7 '12 #2
I'm sorry, I'm not understanding completely what I have to do. When I I try anything like that it does not work.
May 7 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've...
7
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The problem is that I am using the _search target to open...
4
by: kaeli | last post by:
All, I've been unable to find out if javascript supports for (var e in obj) type of looping syntax. Does it? If so, is this for DOM browsers only? TIA! --
1
by: Verner Vaz | last post by:
Select Email ID based on 'a' selected radio button Hello there, I have a simple form with some fields to be filled in and when submitted is emailed to a couple of email ID. Now, this form...
6
by: Craig Keightley | last post by:
I have a page that has n number of radio groups (yes/No) how can i prevent the form being submitted if more than one radio group is not selected? By default all radio groups are unchecked ...
3
by: Adam Toline | last post by:
In reference to the following: http://www.bellecose.com/form.htm At the top of each column there is a box for "All". When one is checked I need to check all of (and only) those boxes...
13
by: kurtj | last post by:
Hello Gurus: I have a validation script (below) that is somehow messed up. If the Name field is blank, I get the alert message, then the browser window goes to a blank document with the word...
6
by: sowencheung | last post by:
I have the following code in the event onbeforeunload if ( typeof executingPostBack != 'undefined' && !executingPostBack ) event.returnValue = ""Warning: Modified data has not been saved.""; ...
13
by: dhughey | last post by:
I am using <script type="text/javascript"> function setAction(frm){ act = ''; for(x=0;x<frm.se.length;x++){ if(frm.se.checked){ act = frm.se.value; } }
6
Haitashi
by: Haitashi | last post by:
Users register on my page. It's a multi-page form. After my insert statement, I have the following code: if(!$insert){ die("There's little problem: ".mysql_error()); } echo "Thank you for...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.