Pagina 1 van 1
Php script voor prijsvraag
Geplaatst: 01 aug 2010, 08:11
door forsurh
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
Re:Php script voor prijsvraag
Geplaatst: 01 aug 2010, 18:08
door weerstation
Prijsvraag is een beetje een ruim begrip. Wat moet het script precies doen.
Re:Php script voor prijsvraag
Geplaatst: 04 aug 2010, 21:18
door forsurh
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
Re:Php script voor prijsvraag
Geplaatst: 05 aug 2010, 10:34
door Luc
De broncode van php file is op deze manier niet te bekijken B)
Wellicht kun je die even copy en pasten ...
Gr,
Luc
Re:Php script voor prijsvraag
Geplaatst: 05 aug 2010, 10:54
door forsurh
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';
?>
Re:Php script voor prijsvraag
Geplaatst: 05 aug 2010, 11:09
door Luc
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
Re:Php script voor prijsvraag
Geplaatst: 05 aug 2010, 11:54
door forsurh
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';
?>