Bustergut
04-06-06, 06:48
I really shouldn't be allowed to play with such stuff, but can somebody advise what to do here. I downloaded a PHP/MYSQL FAQ system called FAQring. It appears to be what I want, but I fell at the first hurdle. I need to set the admin password by altering this script. Could you tell me how by pasting PASSWORDHERE into the following where I need to enter my password. I think it's near the values statement, but don't understand the syntax.
<?ob_start();
include("top.php");
include("topinstallmenu.php");
include "dataaccess1.php" ;
session_start();
if(session_is_registered("whossession")){
if (($_SESSION['who'])=="admin"){
if (!empty($_POST['password']))
{
$password =$_POST['password'];
dbConnect();
$result = mysql_query("delete from ".$tbladmin." where name='admin'" . mysql_error());
if (!$result) {
die('Invalid query: ' . mysql_error());
}
$result = mysql_query("insert into ".$tbladmin." (name,password) values('admin','" . $password . "')" . mysql_error());
if (!$result) {
die('Invalid query: ' . mysql_error());
}
header('location:admin.php');
}
<?ob_start();
include("top.php");
include("topinstallmenu.php");
include "dataaccess1.php" ;
session_start();
if(session_is_registered("whossession")){
if (($_SESSION['who'])=="admin"){
if (!empty($_POST['password']))
{
$password =$_POST['password'];
dbConnect();
$result = mysql_query("delete from ".$tbladmin." where name='admin'" . mysql_error());
if (!$result) {
die('Invalid query: ' . mysql_error());
}
$result = mysql_query("insert into ".$tbladmin." (name,password) values('admin','" . $password . "')" . mysql_error());
if (!$result) {
die('Invalid query: ' . mysql_error());
}
header('location:admin.php');
}