when I load the page nothing happenes, heres the script:
What its supposed to do is create a sql query and put it in the pending database, for later use.
PHP:
<?php
include '../../Includes/DBconnect.php';
session_start();
$sql = 'select * from '.$DBusers.' where uname="'.$_SESSION['usrnm'].'" and pword="'.$_SESSION['pwcd'].'" limit 1';
mysql_connect($DBhostname,$DBusername,$DBpassword);
mysql_select_db($DBname);
$result = mysql_query($sql) or die($sql);
mysql_close();
$num = mysql_num_rows($result);
if($num == 0){
header("Location: http://www.yarrt.com/badlogin.php
");
}
if(!$_SESSION['admincode'] == "67896789"){
header("Location: http://www.yarrt.com/admin/badlogin.php
");
}
if($_GET['act']=='delusr'){
$sqlcode = 'DELETE FROM members_1 WHERE uname="'.$_GET['user'].'";';
$sql2 = 'insert into admin_pending values("'.$sqlcode.'","'.$_SESSION['usrnm'].'")';
}
if($_POST['act']=='changeinfo'){
$sqlcode = '';
if(!$_POST['newinfo']=='' && !$_POST['newpassword']==''){
$sqlcode = 'UPDATE members_1 SET myinfo="'.$_POST['newinfo'].'",pword="'.$_POST['newpassword'].'" WHERE uname="'.$_POST['olduname'].'";';
}
if($_POST['newinfo']=='' && !$_POST['newpassword']==''){
$sqlcode = 'UPDATE members_1 SET pword="'.$_POST['newpassword'].'" WHERE uname="'.$_POST['olduname'].'";';
}
if(!$_POST['newinfo']=='' && $_POST['newpassword']==''){
$sqlcode = 'UPDATE members_1 SET myinfo="'.$_POST['newinfo'].'" WHERE uname="'.$_POST['olduname'].'";';
}
$sql2 = 'insert into admin_pending values("'.$sqlcode.'","'.$_SESSION['usrnm'].'")';
}
if($_GET['act']=='delcont'){
$sqlcode = 'DELETE FROM content_1 WHERE page="'.$_GET['page'].'" and title="'.$_GET['title'].'";';
$sql2 = 'insert into admin_pending values("'.$sqlcode.'","'.$_SESSION['uname'].'")';
}
if($_GET['act']=='addcont'){
$sqlcode = 'INSERT INTO content_1 VALUES("thompson","'.$_POST['contt'].'","'.$_POST['contb'].'");';
$sql2 = 'insert into admin_pending values("'.$sqlcode.'","'.$_SESSION['uname'].'")';
}
mysql_connect($DBhostname,$DBusername,$DBpassword);
mysql_select_db($DBname);
mysql_query($sql2) or die($sql2);
mysql_close();
header("Location: http://yarrt.com/members/admin/index.php");
What its supposed to do is create a sql query and put it in the pending database, for later use.







