Dag allemaal,
Ik schreef zo net een php script om gebruikers hun wachtwoord te laten wijzigen.
Het script werkt, maar wanneer ik de pagina open krijg ik meteen volgende error: "Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 5 in /home/a255rap/public_html/rapunzelbase/admin_wijzigwachtwoord.php on line 33"
Iemand een idee hoe ik de syntax error kan oplossen?
Bedankt
Ik schreef zo net een php script om gebruikers hun wachtwoord te laten wijzigen.
Het script werkt, maar wanneer ik de pagina open krijg ik meteen volgende error: "Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 5 in /home/a255rap/public_html/rapunzelbase/admin_wijzigwachtwoord.php on line 33"
PHP:
<?php
require_once('auth.php');
include('dbconnect.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">
<head>
<title>Rapunzelbase | Webapplication</title>
<div id="pagetitle">Wijzig je wachtwoord</div>
<div id="content">
<?php
$gGebruikersnaam = $_POST['gGebruikersnaam'];
$gWachtwoord = $_POST['gWachtwoord'];
$newgWachtwoord = $_POST['newgWachtwoord'];
$confirmnewgWachtwoord = $_POST['confirmnewgWachtwoord'];
$result = mysql_query("SELECT gWachtwoord FROM gebruiker WHERE gGebruikersnaam='$gGebruikersnaam'");
if(!$result)
{
echo "The gebruikersnaam die je ingaf bestaat niet";
}
else
if($gWachtwoord!= mysql_result($result, 0))
{
echo "Het huidig wachtwoord is incorrect";
}
if($newgWachtwoord=$confirmnewgWachtwoord)
$sql=mysql_query("UPDATE gebruiker SET gWachtwoord='$newgWachtwoord' where gGebruikersnaam='$gGebruikersnaam'");
if($sql)
{
print('<p class="gelukt">Wachtwoord is gewijzigd!</p>');
}
else
{
echo "Het nieuwe wachtwoord en het bevestigwachtwoord moeten hetzelfde zijn";
}
?>
<!--hier begint de inhoud van de pagina-->
<form id="wijzigWachtwoord" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<table width="279" border="0" align="center">
<tr>
<td align="right">Gebruikersnaam:</td>
<td align="right"><input type="text" name="gGebruikersnaam" id="gGebruikersnaam" /></td>
</tr>
<tr>
<td align="right">Huidig wachtwoord:</td>
<td align="right"><input type="text" name="gWachtwoord" id="gWachtwoord" /></td>
</tr>
<tr>
<td align="right">Nieuw wachtwoord:</td>
<td align="right"><input type="text" name="newgWachtwoord" id="newgWachtwoord" /></td>
</tr>
<tr>
<td align="right">Bevestig nieuw wachtwoord:</td>
<td align="right"><input type="text" name="confirmnewgWachtwoord" id="confirmnewgWachtwoord" /></td>
</tr>
<tr>
<td> </td>
<td align="center"><input type ="submit" id="submit" name="submit" value="Wijzig wachtwoord" /></td>
</tr>
</table>
</form>
</div>
<!--hier eindigt inhoud-->
</div>
</div>
</body>
</html>
Iemand een idee hoe ik de syntax error kan oplossen?
Bedankt
Laatst bewerkt: