bonfires
27.07.2009, 20:16:58
Hallo Profis,
ich habe eine Spamschutzabfrage gebastelt, die sieht so aus:
<?php
$id = $_GET['id'];
$test = isset($_POST["test"]) ? $_POST["test"] : "";
#$kopie_check = ((isset($_POST["kopie"])) ? ' checked="checked"' : "");
$id1 = isset($_POST["id"]) ? $_POST["id"] : "";
$eingabefehler = "";
$zufallszahl1 = mt_rand(1, 100);
$zufallszahl2 = mt_rand(1, 9);
$ergebnis = md5($zufallszahl1 + $zufallszahl2);
$hexcode = "&#" . (48 + $zufallszahl2) . ";";
$formular = "
<form name=\"Formular\" method=\"post\" action=\"" . $_SERVER["SCRIPT_NAME"] . "\">
<table border=\"0\" cellPadding=\"4\" cellSpacing=\"1\">
<caption><strong>Spamschutz</strong></caption>
<tr>
<td>
<strong>ID:</strong>
</td>
<td>
<input type=\"text\" name=\"id\" size=\"47\" maxlength=\"60\" value=\"" . $id . $id1 ."\">
</td>
</tr>
</tr>
<td>
<input type=\"hidden\" name=\"test\" size=\"40\" maxlength=\"45\" value=\"" . $test . "\">
</td>
</tr>
<tr>
<td colspan=\"2\">
<strong>Spamschutz:</strong> <em>" . $zufallszahl1 . " + " . $hexcode . "</em> =
<input type=\"text\" name=\"zip\" size=\"5\">
<input type=\"hidden\" name=\"zip2\" value=\"" . $ergebnis . "\">
</td>
</tr>
<tr>
<th colspan=\"2\"><br>
<input type=\"submit\" value=\"absenden\">
</th>
</tr>
</table>
</form>";
if (isset($_POST["test"])) {
if (md5($_POST["zip"]) != $_POST["zip2"]) {
$eingabefehler .= "• Der Spamschutz ist leider falsch!<br />";
}
if ($eingabefehler == "") {
echo "ID = ";
echo $id;
echo "<br>ID1 = ";
echo $id1;
echo "Ihre Nachricht wurde gesendet - Vielen Dank!";
echo'<script language="javascript">
window.location.href="count.php?id=2"
</script>';
}
else {
echo "<span style=\"color: #000000\"><strong>Bitte korrigieren:</strong><br>";
echo $eingabefehler . "</span>" . $formular;
}
}
else {
echo $formular;
}
?>
<?
echo $id;
?>
dieses Formular wird mit einer ID aufgerufen, wenn ich jetzt das Formular absende
( mit oder ohne eingaben ) wird die ID aus der URL entfernt.
Wie kann ich das verhindern, denn ich brauche diese an der gelb markierten stelle.
Die ID muss als Variable an die gelb markierte Stelle übergeben werden
Aufruf Spamschutz.php
http://www.???.de/?????/????/Spamschutz.php?id=1
http://www.???.de/?????/????/Spamschutz.php?id=2
http://www.???.de/?????/????/Spamschutz.php?id=3 usw.
Ich hoffe Ihr könnt mir helfen
Gruss André
ich habe eine Spamschutzabfrage gebastelt, die sieht so aus:
<?php
$id = $_GET['id'];
$test = isset($_POST["test"]) ? $_POST["test"] : "";
#$kopie_check = ((isset($_POST["kopie"])) ? ' checked="checked"' : "");
$id1 = isset($_POST["id"]) ? $_POST["id"] : "";
$eingabefehler = "";
$zufallszahl1 = mt_rand(1, 100);
$zufallszahl2 = mt_rand(1, 9);
$ergebnis = md5($zufallszahl1 + $zufallszahl2);
$hexcode = "&#" . (48 + $zufallszahl2) . ";";
$formular = "
<form name=\"Formular\" method=\"post\" action=\"" . $_SERVER["SCRIPT_NAME"] . "\">
<table border=\"0\" cellPadding=\"4\" cellSpacing=\"1\">
<caption><strong>Spamschutz</strong></caption>
<tr>
<td>
<strong>ID:</strong>
</td>
<td>
<input type=\"text\" name=\"id\" size=\"47\" maxlength=\"60\" value=\"" . $id . $id1 ."\">
</td>
</tr>
</tr>
<td>
<input type=\"hidden\" name=\"test\" size=\"40\" maxlength=\"45\" value=\"" . $test . "\">
</td>
</tr>
<tr>
<td colspan=\"2\">
<strong>Spamschutz:</strong> <em>" . $zufallszahl1 . " + " . $hexcode . "</em> =
<input type=\"text\" name=\"zip\" size=\"5\">
<input type=\"hidden\" name=\"zip2\" value=\"" . $ergebnis . "\">
</td>
</tr>
<tr>
<th colspan=\"2\"><br>
<input type=\"submit\" value=\"absenden\">
</th>
</tr>
</table>
</form>";
if (isset($_POST["test"])) {
if (md5($_POST["zip"]) != $_POST["zip2"]) {
$eingabefehler .= "• Der Spamschutz ist leider falsch!<br />";
}
if ($eingabefehler == "") {
echo "ID = ";
echo $id;
echo "<br>ID1 = ";
echo $id1;
echo "Ihre Nachricht wurde gesendet - Vielen Dank!";
echo'<script language="javascript">
window.location.href="count.php?id=2"
</script>';
}
else {
echo "<span style=\"color: #000000\"><strong>Bitte korrigieren:</strong><br>";
echo $eingabefehler . "</span>" . $formular;
}
}
else {
echo $formular;
}
?>
<?
echo $id;
?>
dieses Formular wird mit einer ID aufgerufen, wenn ich jetzt das Formular absende
( mit oder ohne eingaben ) wird die ID aus der URL entfernt.
Wie kann ich das verhindern, denn ich brauche diese an der gelb markierten stelle.
Die ID muss als Variable an die gelb markierte Stelle übergeben werden
Aufruf Spamschutz.php
http://www.???.de/?????/????/Spamschutz.php?id=1
http://www.???.de/?????/????/Spamschutz.php?id=2
http://www.???.de/?????/????/Spamschutz.php?id=3 usw.
Ich hoffe Ihr könnt mir helfen
Gruss André