otoz mam plik haslo.php ktory zewiera formularz zmiany hasła i plik zm_haslo.php ktory sie wykonuje po wcisnieciu zmien w formularzu...
no i chce uzyskac taki efekt, ze wprowadzeniu zlego hasla, lub nie podaniu starego, lub nowego hasla to wyswietla komuniakt bledu..... ale... no wlasnie jest takie ale, ze chce to zrobic tak, aby najpierw po prostu przekierowalo mnie jakby spowrotmen na strone hasło (czyli zwykle przeładowanie stony) i potem wlasnie dopiero tam zeby sie pokazał komunikat o bledzie... juz po przeladowaniu strony
oto moje pliki:
haslo.php
Kod
<?
ob_start();
session_start();
$s_id = session_id();
require('my_db_connect.php');
require('wer_pass.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<link rel="Stylesheet" href="style.css" type="text/css">
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-2" />
</head>
<body>
<table border="0" cellpadding="5" cellspacing="0" width="100%" height="20">
<tr>
<td valign="top" class="admin"><b>Administracja/galria zdjec/zmiana danych</b></td>
</tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" width="100%" height="20">
<tr>
<td valign="top" width="200"><? include("menu.php"); ?></td>
<td>
<table border="0" cellpadding="5" cellspacing="2" width="100%" height="20">
<tr>
<td class="tytul_adm_cen"><b>Zmiana starego hasła</b></td>
</tr>
</table>
<table border="0" cellpadding="5" cellspacing="2" width="100%" height="20">
<tr>
<td valign="top" class="adm_cen">
<table border="0" cellpadding="5" cellspacing="0" width="100%" height="20" bgcolor="#000000">
<tr>
<td class="adm_cen_tresc" height="10"></td>
</tr>
<tr>
<td valign="top" class="adm_cen_tresc">
<form action="zm_haslo.php" method="post" enctype="multipart/form-data">
<b>Podaj stare hasło:</b>
<input type="password" name="st_haslo" size="40" maxlength="50"/><br/>
<input type="hidden" name="PHPSESSID" value="<? echo $s_id;?>"><br/>
<b>Podaj nowe hasło:<b>
<input type="password" name="nw_haslo" size="40" maxlength="50">
<br/>
<input type="submit" value="Zmień">
<br/>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
ob_start();
session_start();
$s_id = session_id();
require('my_db_connect.php');
require('wer_pass.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<link rel="Stylesheet" href="style.css" type="text/css">
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-2" />
</head>
<body>
<table border="0" cellpadding="5" cellspacing="0" width="100%" height="20">
<tr>
<td valign="top" class="admin"><b>Administracja/galria zdjec/zmiana danych</b></td>
</tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" width="100%" height="20">
<tr>
<td valign="top" width="200"><? include("menu.php"); ?></td>
<td>
<table border="0" cellpadding="5" cellspacing="2" width="100%" height="20">
<tr>
<td class="tytul_adm_cen"><b>Zmiana starego hasła</b></td>
</tr>
</table>
<table border="0" cellpadding="5" cellspacing="2" width="100%" height="20">
<tr>
<td valign="top" class="adm_cen">
<table border="0" cellpadding="5" cellspacing="0" width="100%" height="20" bgcolor="#000000">
<tr>
<td class="adm_cen_tresc" height="10"></td>
</tr>
<tr>
<td valign="top" class="adm_cen_tresc">
<form action="zm_haslo.php" method="post" enctype="multipart/form-data">
<b>Podaj stare hasło:</b>
<input type="password" name="st_haslo" size="40" maxlength="50"/><br/>
<input type="hidden" name="PHPSESSID" value="<? echo $s_id;?>"><br/>
<b>Podaj nowe hasło:<b>
<input type="password" name="nw_haslo" size="40" maxlength="50">
<br/>
<input type="submit" value="Zmień">
<br/>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
i zm_haslo.php
Kod
<?
session_start();
$s_id = session_id();
require('my_db_connect.php');
if ($_POST['st_haslo']){
$st_h = md5($_POST['st_haslo']);
$spr_starego_hasla = mysql_query("SELECT haslo FROM user WHERE haslo='$st_h'");
$licz1=mysql_num_rows($spr_starego_hasla);
if ($_POST['nw_haslo']){
if ($licz1 > 0){
$nw_h = md5($_POST['nw_haslo']);
$zmien=mysql_query("UPDATE user SET haslo='$nw_h' WHERE haslo='$st_h'");
$_SESSION["userpass"]= $nw_h;
$sid=session_id();
echo "haslo zostalo zminione";
} else {
header("Location: haslo.php?PHPSESSID=$s_id");
}
} else {
echo "Nie wpisano nowego hasła";
}
} else {
echo "Nie wpisano starego hasła";
}
?>
session_start();
$s_id = session_id();
require('my_db_connect.php');
if ($_POST['st_haslo']){
$st_h = md5($_POST['st_haslo']);
$spr_starego_hasla = mysql_query("SELECT haslo FROM user WHERE haslo='$st_h'");
$licz1=mysql_num_rows($spr_starego_hasla);
if ($_POST['nw_haslo']){
if ($licz1 > 0){
$nw_h = md5($_POST['nw_haslo']);
$zmien=mysql_query("UPDATE user SET haslo='$nw_h' WHERE haslo='$st_h'");
$_SESSION["userpass"]= $nw_h;
$sid=session_id();
echo "haslo zostalo zminione";
} else {
header("Location: haslo.php?PHPSESSID=$s_id");
}
} else {
echo "Nie wpisano nowego hasła";
}
} else {
echo "Nie wpisano starego hasła";
}
?>
no bo teraz jest zwykle "echo" co powoduje przejscie na czysta strone z komunikatem...
a mi sie to nie podoba:( i mysle ze to malo profesjonalnie

ps: dokładnie rzecz biorąc chodzi mi o cos takiego, jak stosuje sie podczas skryptow rejestracji itp, czyli po wcisnieciu rejsetruj jest przeladowanie i jesli jakas dana jest nie wpisana to pod polem formularza (itp) lub na dole... otrzymujemy komunikat o braku wprowadzenia takich danych
