Nieuw lid |
|
Dit moet dus een script voorstellen waarmee je je profiel kan updaten, volgens mij klopt er niks van maja ik hoop dat jullie me opweg kunnen helpen.
Code:
<?php
if ($ingelogt == false){
header("Location: ?p=Login");
}
$uid = $_SESSION['user_id'];
?>
<link href="../styles/style.css" rel="stylesheet" type="text/css" />
<table width="492" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="677" height="23" background="images/block.gif" style="border-bottom:1px solid #a7a6ac; border-top:0px solid #a7a6ac; border-left:1px solid #a7a6ac; border-right:1px solid #a7a6ac;"><div class="style1">
<div align="left"><b> </b>Edit Profile </div>
</div></td>
</tr>
<tr>
<td height="27" align="left" valign="top" bgcolor="#f5f5f5" style="border-bottom:1px solid #a7a6ac; border-top:0px solid #a7a6ac; border-left:1px solid #a7a6ac; border-right:1px solid #a7a6ac;">
<table width="492" border="0" cellspacing="4" cellpadding="0" class='zwart'>
<tr>
<td width="566" height="19" align="left" valign="top">
<table width="471" border="0" cellspacing="1" cellpadding="0">
<tr>
<td width="188" class="zwartdik">Personal Information</td>
<td width="283" class="zwart"> </td>
</tr>
<?php
if (isset($_GET['submit'])){
else{
$user_realname = $_POST['user_realname'];
$user_leeftijd = $_POST['user_leeftijd'];
$user_geslacht = $_POST['user_geslacht'];
$user_email = $_POST['user_email'];
$user_realname = htmlspecialchars($user_realname);
$user_leeftijd = htmlspecialchars($user_leeftijd);
$user_geslacht = htmlspecialchars($user_geslacht);
$user_email = htmlspecialchars($user_email);
emailcontrole($email);
$bestaat1 = mysql_query("SELECT user_email FROM gebruikers WHERE user_email = '$email'") or die(mysql_error());
$aantal1 = mysql_num_rows($bestaat2);
elseif ($aantal1 == '1'){
echo "<div class='error'>Sorry, but this email has already been taken.</div>";
}
elseif (!$user_realname || !$user_leeftijd || $user_geslacht || $user_email){
echo "<div class='error'>You need to fill al fields!</div>";
}
/*elseif ($password != $password2){
echo "<div class='error'>The passwords you entered did not match.</div>";
}*/
else{
$query = mysql_query("UPDATE gebruikers SET user_realname = '" . $user_realname . "', user_leeftijd = '" . $user_leeftijd . "', user_geslacht = '" . $user_geslacht . "', user_email = '" . $user_email . "'");
if(!$query)
{
echo 'Query niet gelukt<br>' . mysql_error();
}
elseif($query)
{
Header("Location: ?p=Index");
}
else
{
?><tr>
<td class="zwart">Real Name</td>
<td class="zwart"><input type="text" name="user_realname" size="50" <?php echo $user_realname; ?>> </td>
</tr>
<td class="zwart">Age</td>
<td class="zwart"><input name="user_leeftijd" type="text" id="user_leeftijd" size="3" maxlength="2" <?php echo $user_leeftijd; ?>></td>
</tr>
<tr>
<td class="zwart">Sex</td>
<td class="zwart"><select name="user_geslacht" id="user_geslacht" <?php echo $user_geslacht; ?>>
<option selected="selected">Private</option>
<option>Men</option>
<option>Woman</option>
</select> </td>
</tr>
<tr>
<td class="zwart">Email</td>
<td class="zwart"><input name="user_email" type="text" id="user_email" size="50" <?php echo $user_email; ?>></td>
</tr>
<tr>
<td class="zwart"> </td>
<td class="zwart"><input type="submit" name="Submit" value="Submit" /></td>
</tr>
<tr>
<?php
}
?>
</tr>
</table></td></tr>
</table> </td>
</tr>
</table>
<?php if ($ingelogt == false){ } $uid = $_SESSION['user_id']; ?> <link href="../styles/style.css" rel="stylesheet" type="text/css" /> <table width="492" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="677" height="23" background="images/block.gif" style="border-bottom:1px solid #a7a6ac; border-top:0px solid #a7a6ac; border-left:1px solid #a7a6ac; border-right:1px solid #a7a6ac;"><div class="style1"> <div align="left"><b> </b>Edit Profile </div> </div></td> </tr> <tr> <td height="27" align="left" valign="top" bgcolor="#f5f5f5" style="border-bottom:1px solid #a7a6ac; border-top:0px solid #a7a6ac; border-left:1px solid #a7a6ac; border-right:1px solid #a7a6ac;"> <table width="492" border="0" cellspacing="4" cellpadding="0" class='zwart'> <tr> <td width="566" height="19" align="left" valign="top"> <table width="471" border="0" cellspacing="1" cellpadding="0"> <tr> <td width="188" class="zwartdik">Personal Information</td> <td width="283" class="zwart"> </td> </tr> <?php if (isset($_GET['submit'])){ else{ $user_realname = $_POST['user_realname']; $user_leeftijd = $_POST['user_leeftijd']; $user_geslacht = $_POST['user_geslacht']; $user_email = $_POST['user_email']; emailcontrole($email); elseif ($aantal1 == '1'){ echo "<div class='error'>Sorry, but this email has already been taken.</div>"; } elseif (!$user_realname || !$user_leeftijd || $user_geslacht || $user_email){ echo "<div class='error'>You need to fill al fields!</div>"; } /*elseif ($password != $password2){ echo "<div class='error'>The passwords you entered did not match.</div>"; }*/ else{ $query = mysql_query("UPDATE gebruikers SET user_realname = '" . $user_realname . "', user_leeftijd = '" . $user_leeftijd . "', user_geslacht = '" . $user_geslacht . "', user_email = '" . $user_email . "'"); if(!$query) { } elseif($query) { } else { ?><tr> <td class="zwart">Real Name</td> <td class="zwart"><input type="text" name="user_realname" size="50" <?php echo $user_realname; ?>> </td> </tr> <td class="zwart">Age</td> <td class="zwart"><input name="user_leeftijd" type="text" id="user_leeftijd" size="3" maxlength="2" <?php echo $user_leeftijd; ?>></td> </tr> <tr> <td class="zwart">Sex</td> <td class="zwart"><select name="user_geslacht" id="user_geslacht" <?php echo $user_geslacht; ?>> <option selected="selected">Private</option> <option>Men</option> <option>Woman</option> </select> </td> </tr> <tr> <td class="zwart">Email</td> <td class="zwart"><input name="user_email" type="text" id="user_email" size="50" <?php echo $user_email; ?>></td> </tr> <tr> <td class="zwart"> </td> <td class="zwart"><input type="submit" name="Submit" value="Submit" /></td> </tr> <tr> <?php } ?> </tr> </table></td></tr> </table> </td> </tr> </table>
Error:
Parse error: parse error, unexpected T_ELSE in C:\server\Apache2\htdocs\lala\pages\Mijn profiel.php on line 28
Parse error: parse error, unexpected T_ELSE in C:\server\Apache2\htdocs\lala\pages\Mijn profiel.php on line 28
|