Location: PHPKode > scripts > Linker IMG > linker-img/manage/set_pass.php
<?php

//=====================================
// LINKER Category Engine
//=====================================
// Filename : set_pass.php
// Path  : Manage directory
// last update : 2002/03/13
// Desc : Admin password change
//=====================================

//=====================================
// File include part
//=====================================

include ("./authen.php");
include ("../function/pass_info.php");
include ("../function/main_func.php");
include ("../$Slang/m_common.php"); 

//=====================================
// Print Form
//=====================================

if (!$switch) { 

print <<<EOF

<html>
<head>
<LINK rel='stylesheet' type='text/css' href='./linker.css'>
<meta http-equiv='Content-Type' content='text/html; charset=$Scharset'>
</head>

<body bgcolor="#E9E9E9">
<form action='set_pass.php' method='post' name='myform'>
<input type="hidden" name="switch" value="conf">
<input type="hidden" name="oid" value="$Sadmin_id">
<input type="hidden" name="opass" value="$Sadmin_pass">
<div align='left'>

<table border=0 cellpadding=0 cellspacing=1>
<tr>
<td colspan=2>

	<table width="100%" border="1"><tr><td bgcolor="#000066" align="center">
	<b><font color="white" size="2">$l_admin_idpass</font></b>
	</td></tr></table>

</td>	</tr>

<tr><td colspan=2 width=500>&nbsp;</td>	</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_admin_id</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='text' class=input  name='admin_id'> </td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_admin_pass</font></td>
<td bgcolor='#F6F6F6'>&nbsp;<input type='password'  class=input name='admin_pass'> </td>
</tr>

<tr bgcolor='#E0E0E0'>
<td colspan='3' align=center>
<input type='submit' value=' $l_submit ' class=cinput>
<input type='reset' value=' $l_reset ' class=cinput></td>
</tr>
</table></div></form>

</body>
</html>   
EOF;

}

//=====================================
// Write set_pass.php
//=====================================

if ($switch=="conf") {


if ($oid <> $Sadmin_id || $opass <> $Sadmin_pass) errmsg($l_error_noadmin);
$admin_id = md5($admin_id);
$admin_pass = md5($admin_pass);

$config = <<<EOF
<?

\$Sadmin_id = "$admin_id";
\$Sadmin_pass = "$admin_pass";

?>
EOF;


$fp=fopen("../function/pass_info.php",w);
fputs($fp,$config);
fclose($fp);

setcookie("linker_key1",$admin_id,0,"/");
setcookie("linker_key2",$admin_pass,0,"/");
echo("<meta http-equiv='refresh' content='0; url=set_pass.php'>");
}

?>
Return current item: Linker IMG