# Feel Retarded: PHP, Password, etc.



## gethedge (Jan 21, 2002)

I am taking over mastering a website, and have hit a couple bumps. I know some very basic PHP, and am currently trying to get better but I'd like a quick solution to my current problem. I need to enable myself as one of the people that can log into the maintenance area. Can anyone help me? Sorry, I feel so inept

Some code from the index.php file:

```
<?php
	$title = 'Maintenance Area';
	include('/public_html/include/layout.inc');
	echo('

User logged in: '); 
	$mysql_connection = mysql_connect('localhost', 'me', 'mypass');
	mysql_select_db('maint');
	$result = mysql_query('select * from users where userid = \''.$_SERVER['PHP_AUTH_USER'].'\'');
	$line = mysql_fetch_array($result, MYSQL_NUM);
	echo($line[1].' '.$line[2]);
	echo(' ('.$_SERVER['PHP_AUTH_USER'].')

');
	mysql_free_result($result);
	mysql_close($mysql_connection);
?>
```
The .htaccess file:


> AuthType Basic
> AuthName "Maintenance Area"
> AuthUserFile /.htpasswds/maint/passwd
> 
> require valid-user


----------



## Fuse (Jun 20, 2004)

it its using mySQL you need to edit the user list in there or the .htaccess file and add urself.


----------



## gethedge (Jan 21, 2002)

I'm really new to database stuff... can you tell me or link me to something that can tell me how to access and edit the DB?


----------



## Squashman (Apr 4, 2003)

From a shell prompt type:

The syntax is:
htpasswd password_file username password

Example
htpasswd /.htpasswds/maint/passwd Squashman thisismypassword


----------



## gethedge (Jan 21, 2002)

It is telling me "htpasswd: command not found"


----------



## Fuse (Jun 20, 2004)

try htaccess


----------



## Fuse (Jun 20, 2004)

and if ur taking over mastering a site and you dont know how to code it I think you might be in a little over your head..... No Offense at all


----------



## gethedge (Jan 21, 2002)

Fuse said:


> try htaccess


I tried, to the same result



Fuse said:


> and if ur taking over mastering a site and you dont know how to code it I think you might be in a little over your head..... No Offense at all


Thank you for your concern. This is certainly the most complicated site I have mastered, and the only dynamic site. I know HTML very well and basic PHP, and intend to learn a lot about PHP and DB stuff to better be able to do things like this later on. The site is pretty self sufficient, so I have very few immediate duties.


----------



## Fuse (Jun 20, 2004)

Well i guess thats the best way to learn, and you found a good forum to find help if you need it.


----------



## Squashman (Apr 4, 2003)

Hmmm, I would hope they are not using clear text passwords. Open up the password file and see if they are using clear text passwords or if they are encrypted.


----------



## Fuse (Jun 20, 2004)

Should be encrypted if its using MYSql


----------



## gethedge (Jan 21, 2002)

They are encrypted (else I would have solved this problem immediately, then worked on the problem that allowed me to)


----------



## Fuse (Jun 20, 2004)

Thats what i thought...


----------



## Squashman (Apr 4, 2003)

I really did not think you could use AuthType basic if they are using MySql.


----------



## Fuse (Jun 20, 2004)

BTW what is your web address? im bored wanna check it out


----------



## gethedge (Jan 21, 2002)

http://www.aggieruf.org/


----------



## Fuse (Jun 20, 2004)

Checked it out, pretty basic stuff but looks clean. Thats the new look tho, hi-tech flash sites and such are out and clean cut HTML sites are in.


----------

