hallo, ich habe ein formular...alles läuft super...unter www.example.com/seite.php wenn ich aber www.example.com/seite.php?lang=de und die scripte per include aufrufe ...mit
dann läuft php nicht mehr. weder captcha, noch die validierung. ausserdem sehe ich eine leere seite. : hier mein formular:
und dann das formular:
was ich nicht weiss...
warum lädt
action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"?
nicht 100% die gleiche seite, sondern ohne ?lang=de?
danke...
PHP-Code:
<?php include('../ssi/struc1.php'); ?>
PHP-Code:
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$vorname = $_POST['vorname'];
$adresse = $_POST['adresse'];
$plz = $_POST['plz'];
$visitor_email = $_POST['email'];
$user_message = $_POST['message'];
///------------Do Validations-------------
if(empty($name)||empty($visitor_email))
{
$errors .= "\n Name and Email are required fields. ";
}
if(IsInjected($visitor_email))
{
$errors .= "\n Bad email value!";
}
if(empty($_SESSION['6_letters_code'] ) ||
strcasecmp($_SESSION['6_letters_code'], $_POST['6_letters_code']) != 0)
{
//Note: the captcha code is compared case insensitively.
//if you want case sensitive match, update the check above to
// strcmp()
$errors .= "\n The captcha code does not match!";
}
if(empty($errors))
{
//send the email
$to = $your_email;
$subject="New form submission";
$from = $your_email;
$ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
$body = "A user $name submitted the contact form:\n".
"Pack: $pack\n".
"Name: $name\n".
"Vorname: $vorname\n".
"Adresse: $adresse\n".
"PLZ: $plz\n".
"Email: $visitor_email \n".
"Message: \n".
"$user_message\n".
"IP: $ip\n";
$headers = "From: $from \r\n";
$headers .= "Reply-To: $visitor_email \r\n";
mail($to, $subject, $body,$headers);
header('Location: thank-you.html');
}
}
PHP-Code:
<?php
if(!empty($errors)){
echo "<p class='err'>".nl2br($errors)."</p>";
}
?>
<div id='form1_errorloc' class='err'></div>
<form method="POST" name="form1"
action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
...</form>
warum lädt
action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"?
nicht 100% die gleiche seite, sondern ohne ?lang=de?
danke...
Kommentar