de sidste tre bogstaver i dk alfabetet vises ikke korrekt
Jeg skal have en formular til ar virke 100 %. Formularen bliver da godt nok sendt og ser virkelig godt ud men men æ ø og å vises ikke korrekt. Jeg har indsat en lille sekvens i php-filen men den virker ikke.Håber der er en af jer der kan hjælpe :-)
senvensen er her derefter kommer hele php filen og tilsidst sidefilen
i øvrigt avender cms made simple.
1 sekvensen:
function bog( $_post ) {
$_post = str_replace( "Ã¥", "å", $_post );
$_post = str_replace( "æ", "æ", $_post );
$_post = str_replace( "ø", "ø", $_post );
$_post = str_replace( "ä", "ä", $_post );
$_post = str_replace( "ö", "ö", $_post );
$_post = str_replace( "Ã…", "Å", $_post );
$_post = str_replace( "Æ", "Æ", $_post );
$_post = str_replace( "Ø", "Ø", $_post );
$_post = str_replace( "Ä", "Ä", $_post );
$_post = str_replace( "Ö", "Ö", $_post );
return $_post;
}
2 - php-filen:
<?php
function bog( $_post ) {
$_post = str_replace( "Ã¥", "å", $_post );
$_post = str_replace( "æ", "æ", $_post );
$_post = str_replace( "ø", "ø", $_post );
$_post = str_replace( "ä", "ä", $_post );
$_post = str_replace( "ö", "ö", $_post );
$_post = str_replace( "Ã…", "Å", $_post );
$_post = str_replace( "Æ", "Æ", $_post );
$_post = str_replace( "Ø", "Ø", $_post );
$_post = str_replace( "Ä", "Ä", $_post );
$_post = str_replace( "Ö", "Ö", $_post );
return $_post;
}
// recipients
$to = $_POST['recipient'];
if ( isset( $_POST['ema'] ) ) {
$to .= ", Sender <".$_POST['ema'].">";
}
// subject
$subject = "frivillig-formularen";
$m4_20 = $_POST['m4_20'] ? 'x' : '';
$m4_21 = $_POST['m4_21'] ? 'x' : '';
$m4_22 = $_POST['m4_22'] ? 'x' : '';
$m4_23 = $_POST['m4_23'] ? 'x' : '';
$m4_24 = $_POST['m4_24'] ? 'x' : '';
$m4_25 = $_POST['m4_25'] ? 'x' : '';
$m4_26 = $_POST['m4_26'] ? 'x' : '';
$m4_27 = $_POST['m4_27'] ? 'x' : '';
$m4_28 = $_POST['m4_28'] ? 'x' : '';
$m4_29 = $_POST['m4_29'] ? 'x' : '';
$m4_30 = $_POST['m4_30'] ? 'x' : '';
$m4_31 = $_POST['m4_31'] ? 'x' : '';
$m4_32 = $_POST['m4_32'] ? 'x' : '';
$m4_33 = $_POST['m4_33'] ? 'x' : '';
$m4_34 = $_POST['m4_34'] ? 'x' : '';
$m4_35 = $_POST['m4_35'] ? 'x' : '';
$m4_36 = $_POST['m4_36'] ? 'x' : '';
$m4_37 = $_POST['m4_37'] ? 'x' : '';
$m4_38 = $_POST['m4_38'] ? 'x' : '';
$m4_39 = $_POST['m4_39'] ? 'x' : '';
$m4_40 = $_POST['m4_40'] ? 'x' : '';
$m4_41 = $_POST['m4_41'] ? 'x' : '';
$m4_42 = $_POST['m4_41'] ? 'x' : '';
// message
$message = '<table width="573" cellspacing="1" cellpadding="1" border="0">'."\n";
$message .= "\t<tbody>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<th></th>\n";
$message .= "\t\t\t<th width=\"80\">12 - 18</th>\n";
$message .= "\t\t\t<th width=\"80\">18 - 23</th>\n";
$message .= "\t\t\t<th width=\"150\">Nattevagt 23 - 09</th>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Fredag 31. august</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_20."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_21."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_22."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Lørdag 1. september</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_23."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_24."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_25."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Søndag</td>\n";
$message .= "\t\t\t<td></td>\n";
$message .= "\t\t\t<td></td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_26."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Mandag</td>\n";
$message .= "\t\t\t<td></td>\n";
$message .= "\t\t\t<td></td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_27."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Tirsdag</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_28."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_29."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_30."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Onsdag</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_31."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_32."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_33."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Torsdag</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_34."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_35."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_36."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Fredag 7. september</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_37."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_38."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_39."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Lørdag 8. september</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_40."</td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_41."</td>\n";
$message .= "\t\t\t<td></td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Oprydning lørdag 8. sep.</td>\n";
$message .= "\t\t\t<td></td>\n";
$message .= "\t\t\t<td style=\"text-align: center;\">".$m4_42."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Dato: </td>\n";
$message .= "\t\t\t<td colspan=\"3\">".$_POST['dato']."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Navn: </td>\n";
$message .= "\t\t\t<td colspan=\"3\">".$_POST['navn']."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Adresse: </td>\n";
$message .= "\t\t\t<td colspan=\"3\">".$_POST['adresse']."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Postnr. og by: </td>\n";
$message .= "\t\t\t<td colspan=\"3\">".$_POST['by']."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t\t<tr>\n";
$message .= "\t\t\t<td>Email adresse:</td>\n";
$message .= "\t\t\t<td colspan=\"3\" valign=\"top\">".$_POST['ema']."</td>\n";
$message .= "\t\t</tr>\n";
$message .= "\t</tbody>\n";
$message .= "</table>";
$email = <<<EOD
<html>
<head>
<title>Tilmeldning</title>
</head>
<body>
$message
</body>
</html>
EOD;
// additional headers
$headers = "MIME-Version: 1.0\n";
$headers .= "content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: Hjemmesiden thomasbangpedersen.dk <ths@oncable.dk>\r\n";
// and now mail it
if ( mail( $to, $subject, $email, $headers ) ) {
header( "location:".$_POST['redirect'] );
} else {
echo "Meddelsen blev desværre ikke sendt.";
}
?>
3 - og endelig sidefilen:
<p>Tilmelding</p>
<p>Jazz-& Folk teltet</p>
<form action="http://www.thomasbangpedersen.dk/uploads/mail4.php" method="post">
<!-- INDSTILLINGER --><!-- Hjælp til nedenstående linie: Her skrives email-adressen som formularen skal sende til. --><input type="hidden" name="recipient" value="ths@oncable.dk" /> <!-- Hjælp til nedenstående linie: Her angives hvilke felter som skal være obligatoriske. --><input type="hidden" name="required" value="m4_20,m4_21,m4_22,m4_23,m4_24,m4_25,m4_26,m4_27,m4_28,m4_29,m4_30,m4_31,m4_32,m4_33,m4_34,m4_35,m4_36,m4_37,m4_38,m4_39,m4_40,m4_41,m4_42,dato,navn,adresse,by,ema" /> <!-- Hjælp til nedenstående linie: Her skrives den fulde adresse på siden som brugeren skal se, efter succesfuld indtastning/sending.. --><input type="hidden" name="redirect" value="http://www.thomasbangpedersen.dk/index.php?page=sendt" /> <!-- INDSTILLINGER -->
<table cellspacing="1" cellpadding="1" width="573" border="0">
<tbody>
<tr>
<th colspan="4"> </th>
<th width="80">12 - 18</th>
<th width="80">18 - 23</th>
<th width="140">Nattevagt 23 - 09</th>
</tr>
<tr>
<td colspan="4">Fredag 31. august</td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_20" value="12 - 18" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_21" value="18 - 23" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_22" value="Nattevagt 23 - 09" /></td>
</tr>
<tr>
<td colspan="4">Lørdag 1. september</td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_23" value="12 - 18" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_24" value="18 - 23" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_25" value="Nattevagt 23 - 09" /></td>
</tr>
<tr>
<td colspan="4">Søndag</td>
<td style="TEXT-ALIGN: center"> </td>
<td style="TEXT-ALIGN: center"> </td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_26" value="Nattevagt 23 - 09" /></td>
</tr>
<tr>
<td colspan="4">Mandag</td>
<td style="TEXT-ALIGN: center"> </td>
<td style="TEXT-ALIGN: center"> </td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_27" value="Nattevagt 23 - 09" /></td>
</tr>
<tr>
<td colspan="4">Tirsdag</td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_28" value="12 - 18" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_29" value="18 - 23" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_30" value="Nattevagt 23 - 09" /></td>
</tr>
<tr>
<td colspan="4">Onsdag</td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_31" value="12 - 18" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_32" value="18 - 23" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_33" value="Nattevagt 23 - 09" /></td>
</tr>
<tr>
<td colspan="4">Torsdag</td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_34" value="12 - 18" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_35" value="18 - 23" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_36" value="Nattevagt 23 - 09" /></td>
</tr>
<tr>
<td colspan="4">Fredag 7. september</td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_37" value="12 - 18" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_38" value="18 - 23" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_39" value="Nattevagt 23 - 09" /></td>
</tr>
<tr>
<td colspan="4">Lørdag 8. september</td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_40" value="12 - 18" /></td>
<td style="TEXT-ALIGN: center"><input style="WIDTH: 10px" type="checkbox" name="m4_41" value="Nattevagt 23 - 09" /></td>
<td style="TEXT-ALIGN: center"> </td>
</tr>
<tr>
<td colspan="4">
<p align="right"> </p>
</td>
<td colspan="2">
<p align="center">Oprydning <br />
lørdag 24 - 02</p>
</td>
<td>
<p align="left"> <input style="WIDTH: 10px" type="checkbox" name="m4_42" value="Nattevagt 23 - 09" /> </p>
</td>
</tr>
<tr>
<td colspan="4">Dato:</td>
<td colspan="3"><input maxlength="8" size="8" name="dato" value="dd-mm-åå" /></td>
</tr>
<tr>
<td colspan="4">Navn: </td>
<td colspan="3"><input style="WIDTH: 300px" maxlength="32" name="navn" /></td>
</tr>
<tr>
<td colspan="4">Adresse: </td>
<td colspan="3"><input style="WIDTH: 300px" maxlength="32" name="adresse" /></td>
</tr>
<tr>
<td colspan="4">Postnr. og by: </td>
<td colspan="3"><input style="WIDTH: 300px" maxlength="32" name="by" /></td>
</tr>
<tr>
<td colspan="4">Indtast din mail adresse,<br />
og få sendt en bekræftelse:</td>
<td valign="top" colspan="3"><input style="WIDTH: 300px" maxlength="32" name="ema" /></td>
</tr>
<tr>
<td colspan="4"> </td>
<td colspan="2"><input style="WIDTH: 140px" type="submit" value="Send" /></td>
<td style="TEXT-ALIGN: right"><input style="WIDTH: 140px" type="reset" value="Fortryd" /></td>
</tr>
</tbody>
</table>
</form>