Ich kann mich in der Register.php Registrieren.
Und die Datenbank frisst das.
Jedoch wenn ich versuche via dem anghängtem Script den Account zu editieren passiert nichts O_o?
Alles Funktionirt mit Varchar 255 (Name und Pw mit 50, 20)
not Null
Wäre froh wenn mir jemand helfen kann es kann auch im PHP Code liegen... aber weiss nicht was Falsch ist ^^
Ich glaub bei denen liegt das problem O_o
Und die Datenbank frisst das.
Jedoch wenn ich versuche via dem anghängtem Script den Account zu editieren passiert nichts O_o?
Alles Funktionirt mit Varchar 255 (Name und Pw mit 50, 20)
not Null
Wäre froh wenn mir jemand helfen kann es kann auch im PHP Code liegen... aber weiss nicht was Falsch ist ^^
PHP-Code:
<?php
require("./CustomSql.inc.php");
session_start();
if (!(session_is_registered("CID"))){
print "<a href=\"login.php\">$front_pleaselogin</a>";
exit;
}
$db = new CustomSQL($DBName);
$showtable = true;
$errortag = false;
if (!empty($edituser)) {
if (empty($email)){
$errortag = true;
$errormsg = $error_emailempty;
}
if ($email!=$emailretype){
$errortag = true;
$errormsg = $error_emailretypewrong;
}
if (!$errortag){
$db->edituser($email,$homepage,$icq,$aol,$yahoo,$msn,$location,$occupation,$interests,$biography,$customerid,$ava,$level,$CID);
$showtable = false;
}
}
$userinfo = $db->getuserinfobyid($CID);
$email = $userinfo[0]["email"];
$homepage = $userinfo[0]["homepage"];
$icq = $userinfo[0]["icq"];
$location = $userinfo[0]["location"];
?>
<html>
<head>
<title><?php print "$front_modiinfo"; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php print "$front_charset"; ?>">
<link rel="stylesheet" href="jo.css" type="text/css">
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
</head>
<body bgcolor="#3D506E">
<table>
<tr>
<td>
<table>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td> <?php print "$front_modiinfo"; ?> <font color="#FF0000">*</font> <?php print "$front_requiredinfo"; ?></td>
</tr>
<?php
if ($errortag){
?>
<tr>
<td><font color="#FF0000"><?php print "$errormsg"; ?></font></td>
</tr>
<?php
}
?>
<tr>
<td>
<?php
if ($showtable){
?>
<form action="<?php print "$PHP_SELF"; ?>" method="POST">
<table>
<tr><td width="120"><?php print "$front_email"; ?>: </td><td><input type="text" name="email" value="<?php print "$email"; ?>"> <font color="#FF0000">*</font></td></tr>
<tr><td><?php print "$front_emailagain"; ?>: </td><td><input type="text" name="emailretype" value=""> <font color="#FF0000">*</font></td></tr>
<tr><td><?php print "$front_homepage"; ?>: </td><td><input type="text" name="homepage" value="<?php print "$homepage"; ?>"></td></tr>
<tr><td><?php print "$front_icq"; ?>: </td><td><input type="text" name="icq" value="<?php print "$icq"; ?>"></td></tr>
<tr><td><?php print "$front_location"; ?>: </td><td><input type="text" name="location" value="<?php print "$location"; ?>"></td></tr>
<tr><td></td><td><input type="submit" name="edituser" value="<?php print "$front_modiinfo"; ?>"></td></tr>
</table>
</form>
<br><br>
<?php
}
else{
?>
<?php
}
?>
</td>
</tr>
<tr>
<td align="right"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
PHP-Code:
<?php
require("./DbSql.inc.php");
Class CustomSQL extends DBSQL
{
// the constructor
function CustomSQL($DBName = "")
{
$this->DBSQL($DBName);
}
function checkusername($username)
{
$sql = "select customerid from customer where username='$username'";
$result = $this->select($sql);
return $result;
}
function adduser($username,$password,$email,$homepage,$icq,$aol,$yahoo,$msn,$location,$occupation,$interests,$biography)
{
$sql = "insert into customer (username,password,email,homepage,icq,aol,yahoo,msn,location,occupation,interests,biography) values ('$username','$password','$email','$homepage','$icq','$aol','$yahoo','$msn','$location','$occupation','$interests','$biography')";
$result = $this->insert($sql);
return $result;
}
function logincheck($username,$password)
{
$sql = "select customerid from customer where username='$username' and password='$password'";
$result = $this->select($sql);
if (empty($result)) {
return 0;
}else{
$CID = $result[0]["customerid"];
return $CID;
}
}
function checkpassword($customerid,$password)
{
$sql = "select customerid from customer where password='$password' and customerid='$customerid'";
$result = $this->select($sql);
if (empty($result)) {
return 0;
}else{
$CID = $result[0]["customerid"];
return $CID;
}
}
function emailcheck($email)
{
$sql = "select password from customer where email='$email'";
$result = $this->select($sql);
if (empty($result)) {
return 0;
}else{
$password = $result[0]["password"];
return $password;
}
}
function getuserinfobyid($customerid)
{
$sql = "select * from customer where customerid='$customerid'";
$result = $this->select($sql);
return $result;
}
function edituser($email,$homepage,$icq,$aol,$yahoo,$msn,$location,$occupation,$interests,$biography,$customerid)
{
$sql = "update customer set email='$email',homepage='$homepage',icq='$icq',aol='$aol',yahoo='$yahoo',msn='$msn',location='$location',occupation='$occupation',interests='$interests',biography='$biography' where customerid='$customerid'";
$results = $this->update($sql);
return $results;
}
function modifypass($password,$customerid)
{
$sql = "update customer set password='$password' where customerid='$customerid'";
$results = $this->update($sql);
return $results;
}
}
?>
Kommentar