Location: PHPKode > scripts > Banner Rotator with admin panel > banner-rotator-with-admin-panel/chpass2.php
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 7 December 2008), see www.w3.org">
<title>Banner rotator Control Panel</title>
<link rel="stylesheet" href="stylecp.css" type="text/css" media=
"screen">
</head>
<body>
<div id="page">
<div id="header"></div>
<div id="menulinks"><a href="chpass.php">Change password</a>
<a href="chbanner.php">Banner images</a> <a href="chadsense.php">Banner link URLs</a> <a href=
"banneroveral.php">Main page</a></div>

<div id="mainarea">
<div id="contentarea"><br>
<br>
<?php

function SnimiPromenljivu($prom)
{
$handle=fopen("podaci.dat","wb");

$text="password=".$prom."\n";

if (fwrite($handle, $text)==FALSE) {
        echo "Cant write in podaci.dat";
        }

        
fclose($handle);


}

function CitajPromenljivu($prom)
{
$handle=fopen("podaci.dat","r");

while(!feof($handle))
{
        $text=fgets($handle);

        $pos=stripos($text,$prom);
        
        if (!($pos===false))
        {
        $rez=substr($text,strpos($text,"=")+1, strlen($text)-strpos($text,"="));
        }
}

return $rez;
fclose($handle);
}

//******************************************************

$trsifra=CitajPromenljivu("password");

if ($trsifra==($_REQUEST["oldpass"]."\n"))
{
        if ($_REQUEST["newpass1"]==$_REQUEST["newpass2"])
        {
 
        SnimiPromenljivu($_REQUEST["newpass1"]);
        echo "You have changed your password <br />";
        echo "Click <a href='start.html'> here </a> to continue to control panel <br />";
        }
        else
        {
        echo "You did not enter the same value for your new password in both fields. <br />";
        echo "Click <a href='chpass.php'> here </a> to try again <br />";
        }
}
else
{
echo "You did not enter correct value for current password </br >";
echo "Click <a href='chpass.php'> here </a> to try again <br />";
}



 



?></div>
</div>
<div id="footer">
<p></p>
</div>
</div>
</body>
</html>
Return current item: Banner Rotator with admin panel