SitePoint Sponsor |
|
User Tag List
Results 1 to 12 of 12
Thread: radio button result not showing
-
Nov 24, 2004, 04:31 #1
- Join Date
- Nov 2004
- Location
- erfurt
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
radio button result not showing
hi everybody,
i'm new to this forum and new to php.
i've been working on an email form for days, and just decided to add in some radio buttons. everything else shows up perfect in the email the php script sends me. but when a radio button is being checked it doesnt show. i'm sure this is simple but i havent been able to find an answer and i've been looking for hours.
this is the php code:
<?php
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$Anrede = $_REQUEST['herr'.checked] ;
$Anrede = $_REQUEST['frau'.checked] ;
$Name = $_REQUEST['Name'] ;
$Vorname = $_REQUEST['Vorname'] ;
$Telefon = $_REQUEST['Telefon'] ;
$radioschreib = $_REQUEST['radioschreib'] ;
$textfieldschreib = $_REQUEST['textfieldschreib'] ;
$radiotranslation = $_REQUEST['radiotranslation'] ;
$textfieldtranslation = $_REQUEST['textfieldtranslation'] ;
$radiobewerb = $_REQUEST['radiobewerb'] ;
$onlineorpaper = $_REQUEST['online'] ;
$onlineorpaper = $_REQUEST['normal'] ;
$textfieldbewerb = $_REQUEST['textfieldbewerb'] ;
$radiotel = $_REQUEST['radiotel'] ;
$select = $_REQUEST['select'] ;
$textfielddauer = $_REQUEST['textfielddauer'] ;
$Firmenname = $_REQUEST['Firmenname'] ;
$radiowebdesign = $_REQUEST['radiowebdesign'] ;
$textareaweb = $_REQUEST['textareaweb'] ;
if (!isset($_REQUEST['email'])) {
header( "Location: http://www.mydomain.de/form.htm" );
}
elseif (empty($email) || empty($Name)) {
header( "Location: http://www.mydomain.de/error.htm" );
}
else {
mail( "myemail@provider.com", "Anfrage form",
"Anrede: $herr; $frau; \nName: $Name; \nVorname: $Vorname; \nEmail: $email; \nTelefon: $Telefon; \nFirma: $Firmenname; \nMessage: $message;
\nSchreibdienst: $radioschreib; \nArt und Umfang: $textfieldschreib; \nÜbersetzung: $radiotranslation;
\nSprache: $textfieldtranslation; \nBewerbungen: $radiobewerb; \nonlineorpaper: $online; \nonlineorpaper: $normal; \nBewerb.-Anmerkungen: $textfieldbewerb;
\nTelefondienst: $radiotel; \nTel.ges.: $select;
\nDauer: $textfielddauer; \nWebdesign: $radiowebdesign; \nwas webdesign: $textareaweb", "From: form" );
header( "Location: http://www.mydomain.de/thankyou.htm" );
}
?>
the html code for the buttons is correct, i am 100% sure there's nothing wrong there.
again, the problem is that in the email the form sends me it doesnt say that either one of the radio buttons was checked.
any help would be greatly appreciated!!!
-
Nov 24, 2004, 04:50 #2
- Join Date
- Mar 2004
- Location
- West Midlands, United Kingdom
- Posts
- 2,631
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Could you post the HTML so we can check?
-
Nov 24, 2004, 04:55 #3
- Join Date
- Nov 2004
- Location
- erfurt
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
hope you can see this okay, its such a mess..... thanks for the quick reply
<form method="post" action="sendmail.php">
<table width="516">
<tr><td height="2" bgcolor="#333333" colspan="2"></td></tr>
<tr>
<td><p>
<label>
<input type="radio" name="Anrede" value="herr" checked>
Herr</label>
<br>
</p>
</td>
<td> <p>
<label>
<input type="radio" name="Anrede" value="frau">
Frau</label>
<br>
</p></td>
</tr>
<tr>
<td width="80"><span class="Stil4">*</span>Name: </td>
<td width="424"><input type="text" name="Name">
</td>
</tr>
<tr>
<td>Vorname: </td>
<td><input type="text" name="Vorname"></td></tr>
<tr>
<td><span class="Stil4">*</span>Email: </td>
<td><input name="email" type="text" /> <span class="Stil5">Beispiel: mustername@musterprovider.de</span></td>
</tr>
<tr>
<td>Telefon: </td>
<td><input type="text" name="Telefon"></td></tr>
<tr>
<td>Firma: </td>
<td><input type="text" name="Firmenname"></td></tr></table>
<table>
<tr><td height="2" bgcolor="#333333"></td></tr>
<tr>
<td>Sie möchten Auskunft über...</td>
</tr>
<tr>
<td width="504"><input type="checkbox" name="radioschreib" value="ja">
<strong>Schreibarbeit</strong></td></tr>
<tr>
<td colspan=2>Art und Umfang der Schreibarbeit: <br>
<input type="text" name="textfieldschreib">
</td>
</tr>
<tr><td height="1" bgcolor="#333333"></td></tr>
<tr>
<td><input type="checkbox" name="radiotranslation" value="ja">
<strong>Übersetzung</strong></td>
</tr>
<tr>
<td colspan=2>Sprache: <br>
<input type="text" name="textfieldtranslation">
Beispiel: Englisch-Deutsch</td>
</tr>
<tr><td height="1" bgcolor="#333333"></td></tr>
<tr>
<td><input type="checkbox" name="radiobewerb" value="ja">
<strong>Bewerbungen</strong></td>
</tr>
<tr>
<td colspan=2>
<label> </label>
<p>
<label> </label><label>
<input type="radio" name="onlineorpaper" value="normal">
normale Bewerbung </label>
<br>
<label>
<input type="radio" name="onlineorpaper" value="online">
Online-Bewerbung (Erstellung einer Website) </label>
<br>
<br>
Anmerkungenbr>
<input type="text" name="textfieldbewerb">
</p>
</td>
<tr><td height="1" bgcolor="#333333"></td></tr>
<tr>
<td width="504"><input type="checkbox" name="radiotel" value="ja">
<strong>Büroservice</strong>(telefonischer Sekretariatsdienst)</td>
</tr>
<tr><td><select name="select" size="1">
<option>bitte wählen...</option>
<option>G&S Büroservice</option>
<option>Andere</option>
</select></td></tr>
<tr>
<td colspan=2>Zeitdauer: <br>
<input type="text" name="textfielddauer"> Beispiel: 1 Woche
</td>
<tr><td height="1" bgcolor="#333333"></td></tr>
<tr><td><input name="radiowebdesign" type="checkbox" value="ja"><strong>Webdesign</strong></td></tr>
<tr><td>Wofür interessieren Sie sich beim Thema Webdesign?<br><textarea name="textareaweb">
</textarea></td></tr>
<tr><td height="1" bgcolor="#333333"></td></tr>
<td><strong>Sonstige Mitteilungen/strong></td>
</tr>
<tr>
<td><textarea name="message"></textarea></td>
</tr>
<tr>
<td>
<div align="left">
<input type="submit" />
</div></td></tr>
</table>
</form>
-
Nov 24, 2004, 04:56 #4
- Join Date
- Nov 2004
- Location
- erfurt
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i'd be so embarrassed if something turned out wrong in the html :-D
-
Nov 24, 2004, 05:10 #5
Now if u'r method is post then
variable would be post not request.and as per my understanding
$var = empty($_POST['Anrede']) ? '' : $_POST['lAnrede'];
tried out
or mention the html radiobutton part.
-
Nov 24, 2004, 05:17 #6
- Join Date
- Mar 2004
- Location
- West Midlands, United Kingdom
- Posts
- 2,631
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
$_REQUEST can access both $_GET & $_POST data I think, so request should be ok. Although it may be worth trying $_POST instead.
The html looks ok!
Mark.
-
Nov 24, 2004, 05:26 #7
- Join Date
- Nov 2004
- Location
- erfurt
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
mmmh does that mean nothing is really wrong with it? isnt there a usual code for radiobuttons to show their value in an email if they were clicked?
keep in mind i'm just a beginner..
anja
-
Nov 24, 2004, 05:30 #8
Originally Posted by aschi
-
Nov 24, 2004, 05:38 #9
- Join Date
- Nov 2004
- Location
- erfurt
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yeah, i put it in, except i dont know where so i just put it anywhere, and it didnt work...
could there be some kind of "if checked show" thing?
-
Nov 24, 2004, 05:42 #10
- Join Date
- Nov 2004
- Location
- erfurt
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
this is what the email looks like:
Anrede: ; ; <--here it should be showing either "herr" or "frau" depending on what was chosen
Name: last name;
Vorname: first name;
Email: email@email.com;
Telefon: 121212121212;
Firma: company inc.;
Message: ;
etc...
-
Nov 24, 2004, 05:44 #11
U just send the html form and that radio button only with php script radio button receive part otherwise it is too much complex.
-
Nov 24, 2004, 05:49 #12
- Join Date
- Nov 2004
- Location
- erfurt
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
could you explain that a little more?
Bookmarks