und natürlich gibt es ein eingabeformular für das ganze. *** Es wird zunächst in dieses File included
ireg.php
// Ausgabepufferung zur Headermanipulation aktivieren
ob_start();
// Die JS Alternative dazu ... einzufugen an der Stelle header("location.html")
//<script type="text/javascript">
//<!--
//window.location.href = "imail.php";
//-->
//</script>
include("include/session.php");
?>
<!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" xml:lang="en" lang="en">
<head>
<title>PHROZEN's Browsergame Tests </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noarchive" />
<meta name="keywords" content=" Insert keywords - SOME search engines still use keywords" />
<meta name="description" content=" Description is used by some search engines" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="header">
<?php include ("header.php") ?>
</div>
<div class="menu">
<?php include ("regmenu.php") ?> // *********** das ist das besagte eingabeformular
</div>
<div class="mainbody">
<?php include ("homebody.php") ?>
</div>
<div class="footer">
<?php include ("footer.php") ?>
</div>
</body>
</html>
<?php
// Ausgabepufferung zur Headermanipulation beenden und Ausgabe
ob_end_flush();
So war net so viel ... jetzt noch das ganze Eingabeformular das das ganze verwaltet
regmenu.php
<?php
// * Register.php
// *
// * Displays the registration form if the user needs to sign-up,
// * or lets the user know, if he's already logged in, that he
// * can't register another name.
/**
* The user is already logged in, not allowed to register.
*/
if($session->logged_in){
echo "<h1>Registered</h1>";
echo "<p>We're sorry <b>$session->username</b>, but you've already registered. "
."<a href=\"index.php\">Main</a>.</p>";
}
/**
* The user has submitted the registration form and the
* results have been processed.
*/
else if(isset($_SESSION['regsuccess'])){
/* Registration was successful */
if($_SESSION['regsuccess']){
echo "<h4>Registered!</h4>";
echo "<p>Thank you <b>".$_SESSION['reguname']."</b>, your information has been added to the database, "
."you may now <a href=\"index.php\">log in</a>.</p>";
}
/* Registration failed */
else{
echo "<h4>Registration Failed</h4>";
echo "<p>We're sorry, but an error has occurred and your registration for the username <b>".$_SESSION['reguname']."</b>, "
."could not be completed.<br>Please try again at a later time.</p>";
}
unset($_SESSION['regsuccess']);
unset($_SESSION['reguname']);
}
/**
* The user has not filled out the registration form yet.
* Below is the page with the sign-up form, the names
* of the input fields are important and should not
* be changed.
*/
else{
?>
<h4>Register</h4>
<?php
if($form->num_errors > 0){
echo "<td><font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font></td>";
}
?>
<form action="process.php" method="POST">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr>
<td>Username:</td><td><input type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>"></td>
</tr><tr>
<div><td><?php echo $form->error("user"); ?></td></div>
</tr><tr>
<td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>"></td>
</tr><tr>
<div><td><?php echo $form->error("pass"); ?></td></div>
</tr><tr>
<td>Email:</td><td><input type="text" name="email" maxlength="50" value="<?php echo $form->value("email"); ?>"></td>
</tr><tr>
<div><td><?php echo $form->error("email"); ?></td></div>
</tr><tr>
<div><td><img border="0" src="captcha.php?PHPSESSID=<?php echo session_id();?>&ver=<?php echo time();?>" alt="" ></td></div>
</tr><tr>
<td>Code: </td><td><input maxlength="6" name="ccode" size="6" type="text" /></td>
<div><td><?php echo $form->error("captcha"); ?></td></div>
</tr><tr>
<td colspan="2" align="center">
<input type="hidden" name="subjoin" value="1">
<input type="submit" value="Join!">
</td>
</tr><tr>
<td><div><a href="index.php">Back to Main</a></td></div>
</tr>
</table>
</form>
<?php
}
?>
Wie man hier sieht hatte ich schon alles vorbereitet und meiner meinung nach richtig ins Formular eingebaut um das Captcha zu verarbeiten. Allerdings hab ich nach mehreren Umbauversuchen aufgegeben und versuch mal bei euch hier was rauszufinden.
Das Problem an sich ist das das IMG nicht angezeigt wird ... die Auswertung des captchas konnte ich daher noch nicht nachprüfen ob sie
überhaupt funktioniert. Ich denke aber das ganze hängt an der sessionverwaltung und wie das img über
<img border="0" src="captcha.php?PHPSESSID=<?php echo session_id();?>&ver=<?php echo time();?>" alt="" >
angesprochen wird
... so sorry schonmal an die MOD's wegen dem vielen code hab leider noch keinen Server auf dem ich das ganze platzieren kann und muss das ganze über >Xamp aufbauen, daher poste ich den code hier direkt ins forum....
So Leutz ... ich hoffe ihr könnts mir erklären