Problema redirect continuu cu header()
Scris: Mie Dec 11, 2013
Buna tuturor,
am o problema cu aceasta pagina care functioneaza (schimba parola si trimite mailul de confirmare) insa nu redirectioneaza corect, se formeaza o bucla. Nu sunt de meserie, este doar o pasiune si-mi pare rau nu reusesc sa gasesc greseala. Poate ma ajutati voi.
Raman disponibil cu orice alte detalii ce pot ajuta la rezolvare. Toate cele bune!
am o problema cu aceasta pagina care functioneaza (schimba parola si trimite mailul de confirmare) insa nu redirectioneaza corect, se formeaza o bucla. Nu sunt de meserie, este doar o pasiune si-mi pare rau nu reusesc sa gasesc greseala. Poate ma ajutati voi.
Raman disponibil cu orice alte detalii ce pot ajuta la rezolvare. Toate cele bune!
Cod: Selectaţi tot
<?
require_once('config/includes.php');
if(!$login->checkLogin() && !isset($_GET['done'])) { header('Location: '.$CALE_VIRTUALA_SERVER.'autentificare/'); die(); }
if(isset($_POST['SubmitSchimba']))
{
$modificata = $login->changePassword($_POST['old'],$_POST['new'],$_POST['renew']);
if($modificata)
{ header('Location: '.$CALE_VIRTUALA_SERVER.'logout.php?redirect=modifica-parola/?done'); die(); }
else
{ $mesaj_schimba = $login->message; }
}
?>
<!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"><!-- InstanceBegin template="/Templates/temp.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Schimba parola - <?=Functii::getSetare('TITLU_SITE')?></title>
<!-- InstanceEndEditable -->
<base href="<?=$CALE_VIRTUALA_SERVER?>" />
<link type="text/css" rel="stylesheet" href="style.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<script language="javascript" type="text/javascript" src="scripts/functii.js"></script>
<!-- InstanceBeginEditable name="head" -->
<script src="scripts/password_strenght.js" type="text/javascript"></script>
<!-- InstanceEndEditable -->
<meta name="keywords" content=""/>
<meta name="description" content=""/>
</head>
<body bgcolor="<?=$bgcolor?>">
<? require_once('box/header.php');?>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0" class="shadow">
<tr><td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" class="table_color">
<tr>
<td width="636" align="left" valign="top"><!-- InstanceBeginEditable name="content" -->
<h1>SCHIMBA PAROLA</h1>
<div class="hr"></div>
<br />
<?
if(isset($_GET['done']))
{
?>
<p align="center">Parola a fost modificata cu succes. Va rugam sa va logati cu noua parola.</p>
<p align="center"><a href="autentificare/"><b>Click aici</b> pentru a va loga</a></p>
<?
}
else
{
if($mesaj_schimba != "" )
{
?><p align="center" class="error"><?=$mesaj_schimba?></p><?
}
?>
<form action="" method="post">
<table width="500" border="0" align="center" cellpadding="3" cellspacing="3" style="padding-top: 20px;">
<tr>
<td align="right"></td>
<td align="left" style="padding-left: 6px;"><h2><?=$login->getUsername();?></h2></td>
</tr>
<tr><td height="10"></td></tr>
<tr>
<td align="right">Parola actuala*</td>
<td colspan="2" align="left"><input name="old" type="password" class="inputcol" id="user" value="<?=$_POST['old']?>" /></td>
</tr>
<tr>
<td align="right">Parola noua*</td>
<td align="left"><input name="new" type="password" class="inputcol" id="new" onkeyup="runPassword(this.value, 'parola');" value="<?=$_POST['new']?>"/></td>
<td align="left"><div style="width: 100px;">
<div id="parola_text" style="font-size: 10px;"></div>
<div id="parola_bar" style="font-size: 1px; height: 2px; width: 0px; border: 0px solid white;"></div>
</div></td>
</tr>
<tr>
<td align="right">Reintroduceti noua parola*</td>
<td colspan="2" align="left"><input name="renew" type="password" class="inputcol" id="renew" value="<?=$_POST['renew']?>" /></td>
</tr>
<tr>
<td align="left"> </td>
<td height="40" colspan="2" align="left"> <input name="SubmitSchimba" type="submit" class="buton" id="SubmitSchimba" value="Schimba parola" /></td>
</tr>
</table>
</form>
<?
}
?>
<!-- InstanceEndEditable --></td>
<td width="316" align="right" valign="top">
<? require_once('box/box_noutati.php');?>
<? require_once('box/box_banners.php');?>
</td>
</tr>
</table>
<? require_once('box/footer.php');?>
</td></tr></table>
</body>
<!-- InstanceEnd --></html>