PDA

View Full Version : Need help Hard :(



ZaSz
02-16-2008, 07:42 PM
I need help doing the following :

1. Making an admin script for me in scar that changes php database users.

2. Having people connect to the database.

Thats all i can think of for now

Da 0wner
02-17-2008, 01:55 AM
Erm, you mean you want to make a script that like lets you modify users and stuff that are in a php database on the web? Kind of like RC but from the SCAR window itself? And why would the people be needed to connect to database. Post more details please.

ZaSz
02-17-2008, 02:05 AM
Yes like adding deleting and changing the users statis to "suspended".

Then the user can connect if there not suspended or something.

Garrett
02-18-2008, 07:07 AM
Would you be using mysql for the database?

If so, I would think you need to have your script send in variables for the username and password or whatever. Then, check the user & pass, and after check for suspension, and return a true / false for loggedin/notloggedin.

Now this requires alot of changing of course, but this should give you an idea...
If you need some help doing this, let me know.

Const
Username := 'user';
Password := 'pass';

TheClient := InitializeHTTPClient(False, False);
AddPostVariable(TheClient, 'user', Username);
AddPostVariable(TheClient, 'pass', Password);
GetPage := PostHTTPPageEx(TheClient, 'http://www.mysite.com/usercheck.php');
If GetPage = 'False' Then
WriteLN('Invalid Info or Account Suspended')
Else
WriteLN('Successfully Logged');


<?php
// page : usercheck.php
// Database connection stuff
$user = $_POST['user'];
$pass = $_POST['pass'];
// Check the username + password in database
$suspended = $row['suspended']; // checks the mysql database
If $user == True && $pass == True Then
{
If $suspended != False Then
echo('True');
else
echo('False');
}
else
echo('False');
?>