11. september 2005 - 02:03
Der er
14 kommentarer
PHP mailscript fejl
har følgende kode; <? $besked = "Sendt information:\n\n"; $besked .= "Navn: ".$_POST['navn']."\n"; $besked .= "Personnummer: ".$_POST['cpr']."\n"; $besked .= "Addresse: ".$_POST['addresse']."\n\n"; $besked .= "Postnummer: ".$_POST['postnr']."\n\n"; $besked .= "Telefon: ".$_POST['tlfnr']."\n"; $besked .= "Mobil: ".$_POST['mobilnr']."\n"; $besked .= "Email: ".$_POST['email']."\n"; if($_POST['korekort'] == "on") $besked .= "Kørekort: ja\n"; else $besked .= "Kørekort: nej\n"; if($_POST['bil'] == "on") $besked .= "Bil: ja\n"; else $besked .= "Bil: nej\n"; $besked .= "Grunduddannelse: ".$_POST['grundudd']."\n"; $besked .= "Eksamensår: ".$_POST['eksaar_grund']."\n"; $besked .= "Angående: " . implode(",",$_POST['angaaende']) . "\n"; if($_POST['ansat_i_vikarbureau'] == "on") $besked .= "Ansat i vikarbureau: ja\n"; else $besked .= "Ansat i vikarbureau: nej\n"; $besked .= "Hvor: ".$_POST['hvis_ansat']."\n"; if($_POST['har_vaeret_ansat'] == "on") $besked .= "har været ansat i vikarbureau: ja\n"; else $besked .= "har været ansat i vikarbureau: nej\n"; $besked .= "Hvor/hvornår: ".$_POST['hvis_har_vaeret']."\n\n"; $besked .= "Kommentar: ".$_POST['ovrigt']."\n"; $navn = $_POST['navn']; $besked .= "Vh. $navn"; mail("mathias_rem@mail.dk", "Anvend os", $besked); header("Location: return.php"); ?> Når den køres får jeg følgende fejl; Warning: implode(): Bad arguments. in /../vikarmail.php on line 20 Warning: Cannot modify header information - headers already sent by (output started at /../vikarmail.php:20) in /../vikarmail.php on line 37 tak på forhånd
Annonceindlæg fra Infor
11. september 2005 - 02:10
#1
$some = "'".implode("','",$_POST[angaaende])."'"; $besked .= "Angående: " .$some."\n";
11. september 2005 - 02:11
#2
-- og header skal altid vises øverst. Men istedet kan du: <?php $some = "'".implode("','",$_POST[angaaende])."'"; $besked = "Sendt information:\n\n"; $besked .= "Navn: ".$_POST['navn']."\n"; $besked .= "Personnummer: ".$_POST['cpr']."\n"; $besked .= "Addresse: ".$_POST['addresse']."\n\n"; $besked .= "Postnummer: ".$_POST['postnr']."\n\n"; $besked .= "Telefon: ".$_POST['tlfnr']."\n"; $besked .= "Mobil: ".$_POST['mobilnr']."\n"; $besked .= "Email: ".$_POST['email']."\n"; if($_POST['korekort'] == "on") $besked .= "Kørekort: ja\n"; else $besked .= "Kørekort: nej\n"; if($_POST['bil'] == "on") $besked .= "Bil: ja\n"; else $besked .= "Bil: nej\n"; $besked .= "Grunduddannelse: ".$_POST['grundudd']."\n"; $besked .= "Eksamensår: ".$_POST['eksaar_grund']."\n"; $besked .= "Angående: " .$some."\n"; if($_POST['ansat_i_vikarbureau'] == "on") $besked .= "Ansat i vikarbureau: ja\n"; else $besked .= "Ansat i vikarbureau: nej\n"; $besked .= "Hvor: ".$_POST['hvis_ansat']."\n"; if($_POST['har_vaeret_ansat'] == "on") $besked .= "har været ansat i vikarbureau: ja\n"; else $besked .= "har været ansat i vikarbureau: nej\n"; $besked .= "Hvor/hvornår: ".$_POST['hvis_har_vaeret']."\n\n"; $besked .= "Kommentar: ".$_POST['ovrigt']."\n"; $navn = $_POST['navn']; $besked .= "Vh. $navn"; mail("mathias_rem@mail.dk", "Anvend os", $besked); print "<script>location.href='return.php?'; </script>"; ?>
11. september 2005 - 02:25
#3
Mail bliver nu sendt, men der kommer ingen svar fra; $some = "'".implode("','",$_POST[angaaende])."'"; (kun "','").
11. september 2005 - 02:30
#4
Hvordan ser din input ud med _post[angaaende]? er det en select-box, inputfelt, eller en helt tredje?
11. september 2005 - 02:32
#5
select box Jeg har osse fundet ud af selvom jeg har checked checkboxene/radio siger de stadig de ikke er checked..
11. september 2005 - 02:33
#6
Stik mig koden til det.
11. september 2005 - 02:33
#7
Det fordi du skal lave navnet om til: <select name=angaeende[]>
11. september 2005 - 02:35
#8
<form onsubmit="return FormCheck1();" name="form1" id="form1" method="post" action="vikarmail.php"> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Navn: <font color="#FF0000">*</font></td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input required type="text" name="navn" value="" size="25" maxlength="50"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Personnummer:</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="text" name="cpr" value="" size="25" maxlength="50"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Adresse: <font color="#FF0000">*</font></td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="text" name="addresse" value="" size="25" maxlength="50"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Postnummer/By: <font color="#FF0000">*</font></td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="text" name="postnr" value="" size="25" maxlength="50"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Telefonnummer:<font color="#FF0000">*</font></td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="text" name="tlfnr" value="" size="25" maxlength="50"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Mobilnummer:</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="text" name="mobilnr" value="" size="25" maxlength="50"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Email:</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="text" name="email" value="" size="25" maxlength="50"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Jeg har kørekort</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="checkbox" name="korekort" value="ja"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Jeg har tilgang til bil</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="checkbox" name="bil" value="ja"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Grunduddannelse:</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="text" name="grundudd" value="" size="25" maxlength="50"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Eksammensår:</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="text" name="eksaar_grund" value="" size="25" maxlength="50"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Angående:</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><select name="angaaende"> <option value="none">Vælg område <option value="Sommervikariat Norge">Sommervikariat Norge <option value="Sommervikariat Sverige">Sommervikariat Sverige <option value="Sommervikariat Bornholm">Sommervikariat Bornholm <option value="Vikarjob Danmark">Vikarjob Danmark <option value="Weekend job">Weekend job <option value="Hjemmepleje">Hjemmepleje <option value="Plejehjem">Plejehjem </select> </td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Er du ansat i et andet vikarbureau?</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Ja: <input type="radio" name="ansat_i_vikarbureau" value="ja">Nej: <input type="radio" name="ansat_i_vikarbureau" value="nej"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Hvis ja - hvilke(t)?:</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="text" name="hvis_ansat" value="" size="25" maxlength="50"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Har du arbejdet for andre vikarbureauer?</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Ja: <input type="radio" name="har_vaeret_ansat" value="ja">Nej: <input type="radio" name="har_vaeret_ansat" value="nej"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Hvis ja - hvilke(t)? og hvornår?:</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><input type="text" name="hvis_har_vaeret" value="" size="25" maxlength="50"></td> </tr> <tr> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;">Øvrigt:</td> <td style="padding-top: 8px;"><span style="font-family: verdana; font-size: 10px; font-weight: normale;"><textarea name="ovrigt" rows="7" cols="19"></textarea></td> </tr> <tr> <td colspan="2"><center><span style="font-family: verdana; font-size: 10px; font-weight: normale;">* - Felterne der har en (<font color="#FF0000">*</font>), skal udfyldes</span></center></td> </tr> <tr> <td></td> <td colspan="2"><input type="submit" value="Send" name="B1"><input type="reset" value="Slet" name="B1"></td> </tr> </form>
11. september 2005 - 02:36
#9
<form onsubmit="return FormCheck1();" name="angaeende[]" id="angaeende[]" method="post" action="vikarmail.php">
11. september 2005 - 02:38
#10
Næ, hov. <select name="angaeende[]"> <option value="none">Vælg område <option value="Sommervikariat Norge">Sommervikariat Norge <option value="Sommervikariat Sverige">Sommervikariat Sverige <option value="Sommervikariat Bornholm">Sommervikariat Bornholm <option value="Vikarjob Danmark">Vikarjob Danmark <option value="Weekend job">Weekend job <option value="Hjemmepleje">Hjemmepleje <option value="Plejehjem">Plejehjem </select>
11. september 2005 - 02:38
#11
selecten virker men ikke checkboxene eller radio
11. september 2005 - 02:40
#12
<?php $some = "'".implode("','",$_POST[angaaende])."'"; $besked = "Sendt information:\n\n"; $besked .= "Navn: ".$_POST['navn']."\n"; $besked .= "Personnummer: ".$_POST['cpr']."\n"; $besked .= "Addresse: ".$_POST['addresse']."\n\n"; $besked .= "Postnummer: ".$_POST['postnr']."\n\n"; $besked .= "Telefon: ".$_POST['tlfnr']."\n"; $besked .= "Mobil: ".$_POST['mobilnr']."\n"; $besked .= "Email: ".$_POST['email']."\n"; if($_POST['korekort'] == "on") $besked .= "Kørekort: ja\n"; else $besked .= "Kørekort: nej\n"; if($_POST['bil'] == "on") $besked .= "Bil: ja\n"; else $besked .= "Bil: nej\n"; $besked .= "Grunduddannelse: ".$_POST['grundudd']."\n"; $besked .= "Eksamensår: ".$_POST['eksaar_grund']."\n"; $besked .= "Angående: " .$some."\n"; if($_POST['ansat_i_vikarbureau'] == "on") $besked .= "Ansat i vikarbureau: ja\n"; else $besked .= "Ansat i vikarbureau: nej\n"; $besked .= "Hvor: ".$_POST['hvis_ansat']."\n"; if($_POST['har_vaeret_ansat'] == "ja") $besked .= "har været ansat i vikarbureau: ja\n"; else $besked .= "har været ansat i vikarbureau: nej\n"; $besked .= "Hvor/hvornår: ".$_POST['hvis_har_vaeret']."\n\n"; $besked .= "Kommentar: ".$_POST['ovrigt']."\n"; $navn = $_POST['navn']; $besked .= "Vh. $navn"; mail("mathias_rem@mail.dk", "Anvend os", $besked); print "<script>location.href='return.php?'; </script>"; ?>
11. september 2005 - 02:40
#13
Og se lige at få lukke dine gamle spørgsmål, inden folk bliver alt for sure.
11. september 2005 - 12:51
#14
Igen smutter personen uden et tak eller noget. Dog sørgeligt.
Vi tilbyder markedets bedste kurser inden for webudvikling