Two not working scripts

Hello,

I have two scripts which don’t work.
One of them is a script with radio buttons: inkoop.php

[code]

<?php if( $_SERVER['REQUEST_METHOD'] == "POST" ) { // iig even checken of er gepost is $naam = htmlspecialchars($_POST["naam"]); $telefoon = htmlspecialchars($_POST["telefoon"]); $email = htmlspecialchars($_POST["email"]); $tekst = htmlspecialchars($_POST["tekst"]); if (!$naam) { echo "U heeft geen naam ingevuld!"; exit; } if (!$telefoon) { echo "U heeft geen telefoonnummer ingevuld!"; exit; } if (!$email) { echo "U heeft geen e-mailadres ingevuld!"; exit; } if (!$tekst) { echo "U heeft geen tekst ingevuld!"; exit; } echo($_POST["Radio1"]); $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 . " ------------------------------------"; $ to = '[email protected]'; $ subject = 'onderwerp'; $ message = 'het te versturen bericht'; $ headers = 'From: [email protected]' . "rn" . 'X-Mailer: PHP/' . phpversion(); mail( $ to, $ subject, $ message, $ headers); //$mailadres = "[email protected]"; //$message = str_replace ("
","n", $message); //mail("$mailadres", "Bericht van mijndomein.nl", //$message, "From: " . $email . "");*/ echo "Uw bericht is verzonden. U krijgt zo snel mogelijk antwoord."; exit; } else { // niks gepost, dus formulier weergeven ?>[/code]

The other one is some sort of contact form: website.php

[code]<?php
if( $_SERVER[‘REQUEST_METHOD’] == “POST” ) { // iig even checken of er gepost is
$naam = htmlspecialchars($_POST[“naam”]);
$website = htmlspecialchars($_POST[“website”]);
$beschrijving = htmlspecialchars($_POST[“email”]);
$bericht = htmlspecialchars($_POST[“bericht”]);

if (!$naam) {
echo “U heeft geen naam ingevuld!”;
exit; }

if (!$website) {
echo “U heeft geen website ingevuld!”;
exit; }

if (!$beschrijving) {
echo “U heeft geen beschrijving voor de website ingevuld!”;
exit; }

if (!$bericht) {
echo “U heeft geen bericht ingevuld!”;
exit; }

else {

$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 . "
------------------------------------";

$mailadres = “[email protected]”;
$message = str_replace ("
",“n”, $message);
mail("$mailadres", “Bericht van mijndomein.nl”,
$message, "From: " . $email . “”);

echo “Uw bericht is verzonden. U krijgt zo snel mogelijk antwoord.”;
}
?>[/code]

Both files are located at http://www.jermit.nl
http://www.jermit.nl/inkoop.php and http://www.jermit.nl/website.php
Can anyone help me please?

What exactly is it not doing? Are you getting any errors (by using error_reporting(E_ALL);)? What does the output look like? There’s a good chance that the solution to one file solves the other file’s problem, since the scripts look so similar.

on the website.php script I’m getting this error:
Parse error: syntax error, unexpected $end in /customers/jermit.nl/jermit.nl/httpd.www/website.php on line 41

on the inkoop.php script I’m getting this error:
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or ‘$’ in /customers/jermit.nl/jermit.nl/httpd.www/inkoop.php on line 32

Unexpected $end usually indicates that you forgot to close a set of brackets.

This is line 32:

$ to      = '[email protected]';

I see a space between the ‘$’ and the ‘to’. Why is it there?

I removed the spaces and it still doesn’t work, in the other file I can’t find the error at all

What does the code for inkoop.php look like now?

else { // niks gepost, dus formulier weergeven ?>

You’re opening brackets here, do you close them anywhere?

This is the code for inkoop.php:

[code]<?php
if( $_SERVER[‘REQUEST_METHOD’] == “POST” ) { // iig even checken of er gepost is
$naam = htmlspecialchars($_POST[“naam”]);
$telefoon = htmlspecialchars($_POST[“telefoon”]);
$email = htmlspecialchars($_POST[“email”]);
$tekst = htmlspecialchars($_POST[“tekst”]);
if (!$naam) {
echo “U heeft geen naam ingevuld!”;
exit; }

if (!$telefoon) {  
echo "U heeft geen telefoonnummer ingevuld!";  
exit; } 
 
if (!$email) {  
echo "U heeft geen e-mailadres ingevuld!";  
exit; }  
 
if (!$tekst) {  
echo "U heeft geen tekst ingevuld!";  
exit; }  

echo($_POST["Radio1"]); 

$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 . " 
------------------------------------";  

$to = ‘[email protected]’;
$subject = ‘reactie op inkoop’;
$message = ‘bericht van mijn domein’;
$headers = ‘From: [email protected]’ . “rn” .
‘X-Mailer: PHP/’ . phpversion();
mail( $to, $subject, $message, $headers);

//$mailadres = "[email protected]";  
//$message = str_replace ("<br>","n", $message);   
//mail("$mailadres", "Bericht van mijndomein.nl",  
//$message, "From: " . $email . "");*/  
      
echo "Uw bericht is verzonden. U krijgt zo snel mogelijk antwoord.";   
exit; 

}
else { // niks gepost, dus formulier weergeven
}
?>[/code]

It does send the e-mail now but it doesn’t show the data that was entered

website.php:

[code]<?php
if( $_SERVER[‘REQUEST_METHOD’] == “POST” ) { // iig even checken of er gepost is
$naam = htmlspecialchars($_POST[“naam”]);
$website = htmlspecialchars($_POST[“website”]);
$beschrijving = htmlspecialchars($_POST[“email”]);
$bericht = htmlspecialchars($_POST[“bericht”]);

if (!$naam) {
echo “U heeft geen naam ingevuld!”;
exit; }

if (!$website) {
echo “U heeft geen website ingevuld!”;
exit; }

if (!$beschrijving) {
echo “U heeft geen beschrijving voor de website ingevuld!”;
exit; }

if (!$bericht) {
echo “U heeft geen bericht ingevuld!”;
exit; }

else {

$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 . "
------------------------------------";

$mailadres = “[email protected]”;
$message = str_replace ("
",“n”, $message);
mail("$mailadres", “Bericht van mijndomein.nl”,
$message, "From: " . $email . “”);

echo “Uw bericht is verzonden. U krijgt zo snel mogelijk antwoord.”;
exit;

}
?>[/code]

It still doesn’t work

Sponsor our Newsletter | Privacy Policy | Terms of Service