I have made a page that uses 3 forms. 2 of the forms i can catch the post information using the $_POST var. One of my forms however returns an empty $_POST var. I can catch it using the old $_HTTP_POST_VARS
I have matched my form with the other forms and can find no differences. My php version is 5.2.17 neither var_dump($_POST) or print_r($_POST) give me any result.
I eventualy got it working using the $_HTTP_POST_VARS but it keeps on buggling me, since $_POST was made to replace $_HTTP_POST_VARS since php 4.1 (or something close to that)
<p>Wachtwoord wijzigen</p>
<form id='changepwsd' name='changepswd' method='POST' action='".basename($_SERVER['PHP_SELF'])."' enctype='application/x-www-form-urlencoded'>
<label for='old' style='width: 170px; display: inline-block;'>Vorig wachtwoord:</label>
<input type='password' name='old' /><br />
<label for='new' style='width: 170px; display: inline-block;'>Nieuw wachtwoord:</label>
<input type='password' name='new' /><br />
<label for='confirm' style='width: 170px; display: inline-block;'>Bevestig wachtwoord:</label>
<input type='password' name='confirm' /><br />
<input type='submit' value='Wijzig' name='changepwsd' style='width:120px'/>
</form>
<br><br>
the correspondig php:
session_start();
include 'mysql.php';
$mysql = new MySQL;
$now = date("Y-m-d H:i:s");
$mysql->db_connect();
if(!empty($_POST['changepwsd']))
{
$mysql->select_qry('*','users','Name',$_SESSION['User']['Name']);
while($row = $mysql->qry_result->fetch_assoc())
{
$user = $row;
}
if(md5($_POST['old']) == $user['Password'])
{
if($_POST['new'] == $_POST['confirm'])
{
$resultaat = "Uw wachtwoord werd gewijzigd";
$mysql->qry("UPDATE users SET Password='".md5($_POST['new'])."' WHERE Name='".$_SESSION['User']['Name']."'");
}
else
{
$resultaat = "Wachtwoorden komen niet overeen.<br>Uw wachtwoord werd <b>niet</b>gewijzigd.";
}
}
else
{
$resultaat = "Uw oud wachtwoord klopt niet.<br>Uw wachtwoord werd <b>niet</b>gewijzigd.";
}
return $resultaat;
}