Ik zoek een script dat ik twee veldjes krijg om een nieuw wachtwoord in te typen. Dus ik bedoel dat het tweede veldje heet eerste veldje controleerd.

Heeft iemand zo'n script, daar zou ik heel erg meegeholpen zijn.

Alvast bedankt
HTML plus een if($_POST['veld1'] == $_POST['veld2']){
tegen woordig zo moelijk....
Bedankt voor de snelle reactie! Ik zit alleen met het volgende probleem en dat is dat ik niet weet hoe ik dat in deze script kan verwerken.

Ben een enorme noob, ik weet het. Kan iemand deze newbie helpen ?

Bedankt.....

Dit is het script dat ik gebruik.

<?php
include("include/connection.php");
include("include/session.php");
$name = $_SESSION['username'];
$pass = $_POST['wachtwoord'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">;
<html style="height:100%;">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="Style Scripts/Main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {font-size: 10px}
body {
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
</head>

<body style="height: 100%; overflow:hidden;" scroll="no" class="Maintext">
<table width="100%" height="100%" border="0" cellspacing="0" class="Maintext">
<tr>
<td width="4%" rowspan="3" valign="top"><img src="Icons/1-113.jpg" width="32" height="32"></td>
<td width="62%" height="2%" valign="top" style="background-repeat:repeat-y; background-position: center; font-weight: bold; color: #FF9900;"class="Maintext">Wachtwoord wijzigen </td>
<td width="4%" height="5">&nbsp;</td>
<td width="30%" height="5">&nbsp;</td>
</tr>
<tr valign="top">
<td width="62%" height="1%" background="/Images/horizontalSeparator.gif" style="background-repeat:repeat-x">&nbsp;</td>
<td width="3%" height="1" class="Maintext">&nbsp;</td>
<td width="30%" height="1">&nbsp;</td>
</tr>
<tr class="Maintext">
<td width="62%" height="75%" rowspan="8" valign="top"><div align="left">
<p>Voer hieronder je nieuwe login wachtwoord in.</p>
<FORM ACTION="changepass.php" METHOD="post" NAME="form3" target="_self">
<table width="100%" border="0" class="Maintext">
<tr>
<td width="33%"><p>Nieuw login wachtwoord:</p>
<p>Nogmaals login wachtwoord:</p></td>
<td width="67%"><p>
<INPUT TYPE="password" NAME="wachtwoord" MAXLENGTH="40">
</p>
<p>
<INPUT TYPE="password" NAME="wachtwoord2" MAXLENGTH="40">
</p></td>
</tr>
</table>
</form>
<p><a href="profiel.php">
<input name="submit" type="submit" value="Wijzig">
</a></p>
<p><a href="profiel.php">Terug</a> naar gebruikersprofiel.</p>
</div></td>
De bedoeling is dus dat ik wil dat gebruikers hier 2 maal een hun wachtwoord moeten invoeren, en dat gecontroleerd wordt of allebei de velden identiek zijn.

Dit is de hele script:

<?php
include("include/connection.php");
include("include/session.php");
$name = $_SESSION['username'];
$pass = $_POST['wachtwoord'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">;
<html style="height:100%;">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="Style Scripts/Main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {font-size: 10px}
body {
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
</head>

<body style="height: 100%; overflow:hidden;" scroll="no" class="Maintext">
<table width="100%" height="100%" border="0" cellspacing="0" class="Maintext">
<tr>
<td width="4%" rowspan="3" valign="top"><img src="Icons/1-113.jpg" width="32" height="32"></td>
<td width="62%" height="2%" valign="top" style="background-repeat:repeat-y; background-position: center; font-weight: bold; color: #FF9900;"class="Maintext">Wachtwoord wijzigen </td>
<td width="4%" height="5">&nbsp;</td>
<td width="30%" height="5">&nbsp;</td>
</tr>
<tr valign="top">
<td width="62%" height="1%" background="/Images/horizontalSeparator.gif" style="background-repeat:repeat-x">&nbsp;</td>
<td width="3%" height="1" class="Maintext">&nbsp;</td>
<td width="30%" height="1">&nbsp;</td>
</tr>
<tr class="Maintext">
<td width="62%" height="75%" rowspan="8" valign="top"><div align="left">
<p>Voer hieronder je nieuwe login wachtwoord in.</p>
<FORM ACTION="changepass.php" METHOD="post" NAME="form3" target="_self">
<table width="100%" border="0" class="Maintext">
<tr>
<td width="33%"><p>Nieuw login wachtwoord:</p>
<p>Nogmaals login wachtwoord:</p></td>
<td width="67%"><p>
<INPUT TYPE="password" NAME="wachtwoord" MAXLENGTH="40">
</p>
<p>
<INPUT TYPE="password" NAME="wachtwoord2" MAXLENGTH="40">
</p></td>
</tr>
</table>
</form>
<p><a href="profiel.php">
<input name="submit" type="submit" value="Wijzig">
</a></p>
<p><a href="profiel.php">Terug</a> naar gebruikersprofiel.</p>
</div></td>

<td width="3%" height="5%" valign="middle" class="Maintext">&nbsp;</td>
<td width="30%" height="5%" class="Maintext">&nbsp;</td>
</tr>
<tr>
<td width="4%" rowspan="7">&nbsp;</td>
<th width="3%" height="5%" valign="middle" class="Maintext">&nbsp;</th>
<td width="30%" height="5%" valign="middle" nowrap class="Maintext">&nbsp;</td>
</tr>
<tr>
<th width="3%" height="5%" valign="middle" class="Maintext">&nbsp;</th>
<td width="30%" height="5%" valign="middle" nowrap class="Maintext">&nbsp;</td>
</tr>
<tr>
<th width="3%" height="5%" valign="middle" class="Maintext">&nbsp;</th>
<td width="30%" height="5%" valign="middle" class="Maintext">&nbsp;</td>
</tr>
<tr>
<th width="3%" height="5%" valign="middle" class="Maintext">&nbsp;</th>
<td width="30%" height="5%" valign="middle" nowrap class="Maintext">&nbsp;</td>
</tr>
<tr>
<th width="3%" height="5%" valign="middle" class="Maintext">&nbsp;</th>
<td width="30%" height="5%" valign="middle" nowrap class="Maintext">&nbsp;</td>
</tr>
<tr>
<th height="5%" valign="middle" class="Maintext"><span class="norepeat"></span></th>
<td width="30%" height="5%" valign="middle" nowrap class="Maintext">&nbsp;</td>
</tr>
<tr>
<td width="4%" height="40%">&nbsp;</td>
<td width="30%" height="40%">&nbsp;</td>
</tr>
<tr>
<td width="4%" height="2%">&nbsp;</td>
<td width="62%" height="2%" background="/Images/horizontalSeparator.gif" style="background-repeat:repeat-x">&nbsp;</td>
<td width="4%" height="2%">&nbsp;</td>
<td width="30%" height="2%">&nbsp;</td>
</tr>
<tr valign="middle">
<td width="4%" height="2%">&nbsp;</td>
<td width="62%" height="5%" valign="top" class="Maintext"><div align="center" class="style1">- Copyright 2004 -</div></td>
<td width="4%" height="2%">&nbsp;</td>
<td width="30%" height="2%">&nbsp;</td>
</tr>
</table>
</body>
</html>
Moet dat nou? Die enorme ellende van onnodige html regels erbij..

Laat me raden..

Frontpage?!
Oh sorry ik dacht dat dit PHP HULP was. Is toch ook voor beginners. Maar sorry dat deze newbie je kostbare tijd verdoet.

Maar is er misschien ook nog een antwoord? Alwetende......
(Gebruik trouwens dreamweaver)
Wist ik :) Dat je dreamweaver gebruikt dan... ;)

Maar goed, je kunt PHP een check laten uitvoeren.
Noem je eerste input "password" en je tweede input "password_again".

Zet dan in je script de volgende regel:

<?php

if ($_POST['password'] != $_POST['password_again']) {
die('De wachtwoorden komen niet overeen. Toets backspace.');
}

?>

PHP leest deze regel, en als de wachtwoorden niet overeen komen stopt ie, en print hij de regel dat de ww's niet overeenkomen.
Anders gaat hij gewoon door.

Groet, Niels

[edit]
!= betekend dus "niet gelijk aan"
Bedankt, duidelijk antwoord! We gaan weer aan de slag...

Reageren