Algemeen forum ontrent de ontwikkelng, design en hosting van weergerelateerde websites (dit laatste om een beetje on topic te blijven)
Door forsurh
#23737
Ik ben op zoek naar een leuk aan te passen script voor een prijsvraag. Google levert niets op en ik heb wel een simpele html, maar dat vindt ik er niet zo leuk uitzien.

En ik ben nou ook weer niet zo'n kei in php dat ik het even zelf schrijf....


Groeten,
Wisse
Door forsurh
#23812
Dit is wat ik heb:

Een html code met een prijsvraag, die via een post.php verstuurd wordt.

De html werkt goed, je kan alles invullen etc.

Maar met de mail komt alleen het onderste tekstvak maar binnen.
Wat doe ik fout?

link naar de html code:

http://www.weerstation-grootegast.nl/Prijsvraag/prijsvraag.html

link naar de php code:

http://www.weerstation-grootegast.nl/Prijsvraag/post.php

Groeten,
Wisse
Door Luc
#23824
De broncode van php file is op deze manier niet te bekijken B)

Wellicht kun je die even copy en pasten ...

Gr,
Luc
Door forsurh
#23825
bij deze:

kon hem niet in het code veld krijgen, daardoor staan er nu op plaatsen smiles....




if (!isset($_POST['naam']) || !isset($_POST['email']) || !isset($_POST['bericht']) || !isset($_POST['Antwoord1']) || !isset($_POST['Antwoord2']) || !isset($_POST['Antwoord3'])) {
echo 'U heeft niet alle velden ingevuld!';
exit;
}

$naam = htmlspecialchars($_POST['naam']);
$email = htmlspecialchars($_POST['email']);
$bericht = htmlspecialchars($_POST['bericht']);
$Antwoord1 = htmlspecialchars($_POST['Antwoord1']);
$Antwoord2 = htmlspecialchars($_POST['Antwoord2']);
$Antwoord3 = htmlspecialchars($_POST['Antwoord3']);

?>

if (!isset($_POST['naam']) || !isset($_POST['email']) || !isset($_POST['bericht']) || !isset($_POST['Antwoord1']) || !isset($_POST['Antwoord2']) || !isset($_POST['Antwoord3'])) {
echo 'U heeft niet alle velden ingevuld!';
exit;
}

$naam = htmlspecialchars($_POST['naam']);
$email = htmlspecialchars($_POST['email']);
$bericht = htmlspecialchars($_POST['bericht']);
$Antwoord1 = htmlspecialchars($_POST['Antwoord1']);
$Antwoord2 = htmlspecialchars($_POST['Antwoord2']);
$Antwoord3 = htmlspecialchars($_POST['Antwoord3']);

$tijd = time();
$datum = strftime('%d/%m/%y %H:%M', $tijd);
$ip = getenv('REMOTE_ADDR');
$message = $naam.' met het e-mailadres '.$email.' en het IP '.$ip.' stuurde op '.$datum.' het volgende bericht:
____________________________________
'.$bericht.'
------------------------------------';
?>

if (!isset($_POST['naam']) || !isset($_POST['email']) || !isset($_POST['bericht']) || !isset($_POST['Antwoord1']) || !isset($_POST['Antwoord2']) || !isset($_POST['Antwoord3'])) {
echo 'U heeft niet alle velden ingevuld!';
exit;
}

$naam = htmlspecialchars($_POST['naam']);
$email = htmlspecialchars($_POST['email']);
$bericht = htmlspecialchars($_POST['bericht']);
$Antwoord1 = htmlspecialchars($_POST['Antwoord1']);
$Antwoord2 = htmlspecialchars($_POST['Antwoord2']);
$Antwoord3 = htmlspecialchars($_POST['Antwoord3']);

$tijd = time();
$datum = strftime('%d/%m/%y %H:%M', $tijd);
$ip = getenv('REMOTE_ADDR');
$message = $naam.' met het e-mailadres '.$email.' en het IP '.$ip.' stuurde op '.$datum.' het volgende bericht:
____________________________________
'.$bericht.'
------------------------------------';

mail('contact@weerstation-grootegast.nl', 'Bericht van weerstation-grootegast.nl', $message, 'From: '.$email);

echo 'Uw bericht is verzonden. Na 14 september wordt de winnaar via mail en de site bekendgemaakt';
?>
Door Luc
#23829
Volgens mij moet je $Antwoord1, $Antwoord2 en $Antwoord3 nog aan de variabele $bericht toevoegen plakken, anders worden deze niet gemaild.

bv:

Code: Selecteer alles
$bericht = $bericht . '<br/>' . $Antwoord1 . '<br/>' . $Antwoord2 . '<br/>' . $Antwoord3;


Gr,
Luc
Door forsurh
#23833
Bedankt Luc,

Maar nu iets nieuws, ik krijg voor de keuzeknoppen alleen "on" gemaild .....


Zie code;

if (!isset($_POST['naam']) || !isset($_POST['email']) || !isset($_POST['bericht']) || !isset($_POST['Antwoord1']) || !isset($_POST['Antwoord2']) || !isset($_POST['Antwoord3'])) {
echo 'U heeft niet alle velden ingevuld!';
exit;
}

$naam = htmlspecialchars($_POST['naam']);
$email = htmlspecialchars($_POST['email']);
$bericht = htmlspecialchars($_POST['bericht']);
$Antwoord1 = htmlspecialchars($_POST['Antwoord1']);
$Antwoord2 = htmlspecialchars($_POST['Antwoord2']);
$Antwoord3 = htmlspecialchars($_POST['Antwoord3']);

?>

if (!isset($_POST['naam']) || !isset($_POST['email']) || !isset($_POST['bericht']) || !isset($_POST['Antwoord1']) || !isset($_POST['Antwoord2']) || !isset($_POST['Antwoord3'])) {
echo 'U heeft niet alle velden ingevuld!';
exit;
}

$naam = htmlspecialchars($_POST['naam']);
$email = htmlspecialchars($_POST['email']);
$bericht = htmlspecialchars($_POST['bericht']);
$Antwoord1 = htmlspecialchars($_POST['Antwoord1']);
$Antwoord2 = htmlspecialchars($_POST['Antwoord2']);
$Antwoord3 = htmlspecialchars($_POST['Antwoord3']);

$tijd = time();
$datum = strftime('%d/%m/%y %H:%M', $tijd);
$ip = getenv('REMOTE_ADDR');
$message = $naam.' met het e-mailadres '.$email.' en het IP '.$ip.' stuurde op '.$datum.' het volgende bericht:
____________________________________
'.$bericht.'
'.$Antwoord1.'
'.$Antwoord2.'
'.$Antwoord3.'
------------------------------------';
?>

if (!isset($_POST['naam']) || !isset($_POST['email']) || !isset($_POST['bericht']) || !isset($_POST['Antwoord1']) || !isset($_POST['Antwoord2']) || !isset($_POST['Antwoord3'])) {
echo 'U heeft niet alle velden ingevuld!';
exit;
}

$naam = htmlspecialchars($_POST['naam']);
$email = htmlspecialchars($_POST['email']);
$bericht = htmlspecialchars($_POST['bericht']);
$Antwoord1 = htmlspecialchars($_POST['Antwoord1']);
$Antwoord2 = htmlspecialchars($_POST['Antwoord2']);
$Antwoord3 = htmlspecialchars($_POST['Antwoord3']);

$tijd = time();
$datum = strftime('%d/%m/%y %H:%M', $tijd);
$ip = getenv('REMOTE_ADDR');
$message = $naam.' met het e-mailadres '.$email.' en het IP '.$ip.' stuurde op '.$datum.' het volgende bericht:
____________________________________
'.$bericht.'
'.$Antwoord1.'
'.$Antwoord2.'
'.$Antwoord3.'
------------------------------------';

mail('contact@weerstation-grootegast.nl', 'Bericht van weerstation-grootegast.nl', $message, 'From: '.$email);

echo 'Uw bericht is verzonden. Na 14 september wordt de winnaar via mail en de site bekendgemaakt';
?>