sugar
Erfahrenes Mitglied
Ich habe das Problem das folgendes Formular eigentlich sehr gut funktioniert. Nur bei manchen Anmeldungen die anscheinend über Internet Explorer ausgeführt werden, funktioniert das Captcha nicht. Ich habe schon verschiedenen Captcha Scripte eingebaut, also denke ich nicht, dass es direkt dran liegt. Das Formular läuft über eine SSL Verbindung. Fehlermeldungen gibt es sonst keine. Bei den Anmeldungen wo es nicht funktioniert erscheint eben immer wieder die Aufforderung den richtigen Sicherheitscode einzugeben. Ich habe es in verschiedenen Versionen von IE getestet nur lustigerweise kann ich den Fehler nicht rekonstruieren! Hier mal der Code:
PHP:
session_start();
include "lang/english.php";
require_once "includes/capya.php";
$date = date("d.m.y");
foreach($_POST as $k=>$v){
htmlentities($v);
}
//Auslesen der Dateien
$price=$_POST['price'];
$_SESSION['price'] = $price;
$Titel=$_POST['Titel'];
$_SESSION['Titel'] = $Titel;
$datum=$_POST['date'];
$_SESSION['date'] = $date;
$Anrede=$_POST['Anrede'];
$_SESSION['Anrede'] = $Anrede;
$Firma=$_POST['Firma'];
$_SESSION['Firma'] = $Firma;
$Institut=$_POST['Institut'];
$_SESSION['Institut'] = $Institut;
$Vorname=$_POST['Vorname'];
$_SESSION['Vorname'] = $Vorname;
$Nachname=$_POST['Nachname'];
$_SESSION['Nachname'] = $Nachname;
$initials=$_POST['initials'];
$_SESSION['initials'] = $initials;
$Strasse=$_POST['Strasse'];
$_SESSION['Strasse'] = $Strasse;
$Strasse2=$_POST['Strasse2'];
$_SESSION['Strasse2'] = $Strasse2;
$PLZ=$_POST['PLZ'];
$_SESSION['PLZ'] = $PLZ;
$Ort=$_POST['Ort'];
$_SESSION['Ort'] = $Ort;
$Land=$_POST['Land'];
$_SESSION['Land'] = $Land;
$Telefon=$_POST['Telefon'];
$_SESSION['Telefon'] = $Telefon;
$Fax=$_POST['Fax'];
$_SESSION['Fax'] = $Fax;
$Type=$_POST['Type'];
$_SESSION['Type'] = $Type;
$Remarks=$_POST['Remarks'];
$_SESSION['Remarks'] = $Remarks;
$Zahlungsweise=$_POST['Zahlungsweise'];
$_SESSION['Zahlungsweise'] = $Zahlungsweise;
$Kreditkarte=$_POST['Kreditkarte'];
$_SESSION['Kreditkarte'] = $Kreditkarte;
$Kartennummer=$_POST['Kartennummer'];
$_SESSION['Kartennummer'] = $Kartennummer;
$Expiration_date=$_POST['Expiration_date'];
$_SESSION['Expiration_date'] = $Expiration_date;
$Datenschutz=$_POST['Datenschutz'];
$_SESSION['Datenschutz'] = $Datenschutz;
$Event=$_POST['Event'];
$_SESSION['Event'] = $Event;
$Kopie=$_POST['Kopie'];
$_SESSION['Kopie'] = $Kopie;
$capya=$_POST['capya'];
$guests=$_POST['guests'];
$_SESSION['guests'] = $guests;
$E_Mail=$_POST['E_Mail'];
$_SESSION['E_Mail'] = $E_Mail;
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/reg.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
background:#e3f6f6;
margin:30px 40px;
color:#000;
}
</style>
</head>
<body>
<div id="wrapper_reg">
<div id="content_reg">
<h2>Registration:<br />
</h2> <br /> <br />
<div id="formular">
PHP:
if($_POST['submit']){
// this strips out any unwanted html tags and turns it into a string
$_POST['Vorname'] = filter_var($_POST['Vorname'], FILTER_SANITIZE_STRING);
//if the text field is empty put the error in the array
if ($_POST['Vorname'] == "") {
$errors[] = "Please enter your first name";
}
// this strips out any unwanted html tags and turns it into a string
$_POST['Nachname'] = filter_var($_POST['Nachname'], FILTER_SANITIZE_STRING);
//if the text field is empty put the error in the array
if ($_POST['Nachname'] == "") {
$errors[] = "Please enter your last name";
}
if ($Datenschutz == "") {
$errors[] = "Please consent to our privacy terms!";
}
if(md5($_REQUEST['capya'])!= $_SESSION['askapache_captcha']){
$errors[] = "Please enter the security code!";
}
if ($Firma == "") {
$errors[] = "Please enter your University!";
}
if ($Telefon == "") {
$errors[] = "Please enter your telephone number!";
}
if ($Land == "") {
$errors[] = "Please enter your country!";
}
if ($PLZ == "") {
$errors[] = "Please enter your ZIP code!";
}
if ($Ort == "") {
$errors[] = "Please enter your city!";
}
if ($Strasse == "") {
$errors[] = "Please enter your street!";
}
if ($Zahlungsweise == "") {
$errors[] = "Please select a payment!";
}
if ($Zahlungsweise == "CreditCard" && $Kartennummer == "") {
$errors[] = "Please enter credit card number!";
}
if ($Zahlungsweise == "CreditCard" && $Expiration_date == "") {
$errors[] = "Please enter your credit card expiration date!";
}
if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $E_Mail) || $E_Mail == ""){
$errors[] = "Please enter your correct email!";
}
// === BCC Spam check =======================================================
if
(
eregi("\r",$E_Mail) || eregi("\n",$E_Mail) || eregi("\r\n",$E_Mail)
)
{
die('Get lost');
}
foreach($_POST as $k=>$v)
{
if(eregi("bcc:",$v)){
die('Get lost');
}
if(eregi("MIME-Version:",$v)){
die('Get lost');
}
if(eregi("Content-Type:",$v)){
die('Get lost');
}
}
// === BCC Spam check end =======================================================
// if there the array has any values in it the echo them else process the form
if(is_array($errors))
{
echo '<div class="terms">The following errors happened whilst processing your form!<ul>';
while (list($key,$value) = each($errors))
{
echo '<li>'.$value.'</li><br />';
}echo'</ul></div><br /> <br /> ';
}
else {
//submit the data to a database or process it further in our case we echo that the form was submitted ok and echo the data
header("Location: reg_send.php");
}}
HTML:
<form action="<?php $PHP_SELF ?>" method="post" name="form">
<fieldset>
<legend><span>Participant</span></legend>
<div class="fieldset">
<label for="input_Anrede">
<span class="label">Form of address<span class="red">*</span>:</span></label>
<span class="formRightContent">
<select name="Anrede" id="input_Anrede" class="validate-selection">
<option value="" selected="selected">Please select:</option>
<option value="Ms.">Ms.</option>
<option value="Mr.">Mr.</option>
</select> </span>
<label for="input_Titel" > <span class="label">Title:</span>
<span class="formRightContent"> <input class="text" name="Titel" type="text" value="<?php echo $Titel ?>" /> </span> </label>
<label for="input_Vorname" > <span class="label">First name<span class="red">*</span>:</span>
<span class="formRightContent"> <input class="text" name="Vorname" type="text" value="<?php echo $Vorname ?>" /> </span> </label>
<label for="input_Nachname" > <span class="label">Last name<span class="red">*</span>:</span>
<span class="formRightContent"> <input type="text" class="text" name="Nachname" value="<?php echo $Nachname ?>" /> </span> </label>
<label for="input_Firma" > <span class="label">Company/ University<span class="red">*</span>:</span>
<span class="formRightContent">
<input type="text" class="text" name="Firma" id="input_Firma" value="<?= $_POST["Firma"] ?>" /> </span> </label>
<label for="input_Strasse" > <span class="label">Street<span class="red">*</span>:</span>
<span class="formRightContent"> <input type="text" class="text" name="Strasse" id="input_Strasse" value="<?= $_POST["Strasse"] ?>" /> </span> </label>
<label for="input_PLZ" class="kontaktPLZ"> <span class="label">ZIP<span class="red">*</span>:</span>
<span class="formRightContent"> <input type="text" class="text" name="PLZ" id="input_PLZ" value="<?= $_POST["PLZ"] ?>" /> </span> </label>
<label for="input_Ort" class="kontaktStadt"> <span class="label">City<span class="red">*</span>:</span>
<span class="formRightContent"> <input type="text" class="text" name="Ort" id="input_Ort" value="<?= $_POST["Ort"] ?>" /> </span> </label>
<label for="input_Land" > <span class="label">Country<span class="red">*</span>:</span>
<span class="formRightContent"> <input type="text" class="text" name="Land" id="input_Land" value="<?= $_POST["Land"] ?>" /> </span> </label>
<label for="input_Telefon" > <span class="label">Phone<span class="red">*</span>:</span>
<span class="formRightContent"> <input type="text" class="text" name="Telefon" id="input_Telefon" value="<?= $_POST["Telefon"] ?>" /> </span> </label>
<label for="input_Fax" > <span class="label">Fax:</span>
<span class="formRightContent"> <input type="text" class="text" name="Fax" id="input_Fax" value="<?= $_POST["Fax"] ?>" /> </span> </label>
<label for="input_E_Mail" > <span class="label">Email<span class="red">*</span>:</span>
<span class="formRightContent"> <input type="text" class="text" name="E_Mail" id="input_E_Mail" value="<?= $_POST["E_Mail"] ?>" /> </span> </label>
<br /><br /><br />
<div align="center"><img src="images/lock.png" width="16" height="16" /><em>Your personal data will be transmitted in SSL-encrypted form and cannot be viewed by third parties</em></div>
</div>
</fieldset>
<fieldset><legend>
<span>Registration fees / Method of payment</span>
</legend>
<div class="fieldset">
<br />
<label class="checkbox"> <input name="guests" type="checkbox" value="yes" <?php if ($guests == "yes") { ?>checked="checked"<?php } ?> /> <span class="formFloatBoxCheck">Accompanying Person (incl. reception, Dinner, Public Transport System): 80 Euro</span></label>
<br />
<br />
<hr noshade="noshade" style="background:#ccc; height:1px; border:0;" />
<div class="noLabel" id="noLabel_Zahlungsweise">
<h3>Payment method<span class="red">*</span>:</h3>
<ul class="formListRadio">
<li> <label class="radio"> <input type="radio" class="radio" name="Zahlungsweise" id="input_Zahlungsweise_1" value="Electronic transfer on receipt of invoice" <?php if ($Zahlungsweise == "Electronic transfer on receipt of invoice") { ?>checked="checked"<?php } ?> />
<span class="formFloatBoxRadio">Electronic transfer on receipt of invoice</span> </label> </li>
<li> <label class="radio"> <input type="radio" class="radio" name="Zahlungsweise" id="input_Zahlungsweise_2" value="CreditCard" <?php if ($Zahlungsweise == "CreditCard") { ?>checked="checked"<?php } ?> />
<span class="formFloatBoxRadio">Credit card (VISA or MasterCard only)</span> </label> </li>
</ul>
</div>
<div id="showcredit">
<label for="input_Kreditkarte" >
<span class="label">Credit card:</span></label>
<span class="formRightContent">
<select name="Kreditkarte" id="input_Kreditkarte">
<?php if ($Kreditkarte == "VISA") { ?>
<option value="VISA" selected="selected">VISA</option>
<option value="MasterCard">MasterCard</option>
<?php } else if ($Kreditkarte == "MasterCard") { ?>
<option value="MasterCard" selected="selected">MasterCard</option>
<option value="VISA">VISA</option>
<?php } else { ?>
<option value="" selected="selected">Please select:</option>
<option value="VISA">VISA</option>
<option value="MasterCard">MasterCard</option>
<?php } ?>
</select><span class="red">*</span></span>
<label for="input_Kartennummer" > <span class="label">Card number:<span class="red">*</span></span>
<span class="formRightContent"> <input type="text" class="text" name="Kartennummer" id="input_Kartennummer" value="<?= $_POST["Kartennummer"] ?>" maxlength="16" /> </span> </label>
<span class="formTextBox"> <div class="subnote">Please enter the 16-digit card number.</div> </span>
<label for="input_Expiration_date" class="validTil"> <span class="label">Expiration date:<span class="red">*</span></span>
<span class="formRightContent"> <input name="Expiration_date" type="text" class="text" id="input_Expiration_date" value="<?= $_POST["Expiration_date"] ?>" size="10" maxlength="7" />
</span> </label>
<span class="formTextBox"> <div class="subnote">Please enter the expiration date in MM/YYYY format<br />
</div> </span>
</div>
</div>
</fieldset>
<br style="clear:both;" />
<label for="input_Datenschutz" class="checkbox"> <input name="Datenschutz" type="checkbox" id="input_Datenschutz" value="Ja" <?php if ($Datenschutz == "Ja") { ?>checked="checked"<?php } ?> /> <span class="formFloatBoxCheck">I consent to the data contained in this application being processed for the purpose of registration.</span> </label>
<br /><br />
<div class="sec">
Security Code<span class="red">*</span>
<?php
askapache_captcha();
?> Please enter the characters above.
</div>
<input type="hidden" name="date" value="<?php setlocale(LC_TIME, 'de_DE'); echo strftime("%e. %B %Y"); ?>" /><input type="hidden" name="Kopie" value="Ja" /><input type="hidden" name="lang" value="en" />
<br />
<div class="submitButtons"> <input type="submit" class="submit" name="submit" value="Next Step" /></div>
</form>
</div><!-- Ende formular -->
<p>All fields marked with an asterisk <span class='red'>*</span> are mandatory.</p>
<div class="terms">
After the registration you will receive a confirmation and invoice within the next days via email. <br />
<strong>Cancellation:</strong><br>
</div>
</div> <!-- Ende content -->
</div> <!-- Ende Wrapper -->