Jump to content

[SOLVED] Need help with a home made login script.


Corey Maddox

Recommended Posts

Okay pretty much it runs off a data saved text file.

 

This is the script:

 

$cfgLogin[1] = 'corey.maddox';

$cfgPassword[1] = 'japanese';

$cfgUserLevel[1] = '0';

$cfgUserID[1] = '0';

 

I have made a register script that saves Username, Pass, Level and Id to a mysql database

 

I am trying to get the user, pass, level and id to display INTO this witha row fetch like this:

 

<?

$host = "localhost";

$user = "username";

$pass = "pass";

$dbname = "test";

 

$connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>");

mysql_select_db($dbname);

 

$sql = 'SELECT * FROM `data` LIMIT 0, 30 ';

$query = mysql_query($sql);

 

while ($row = mysql_fetch_array($query))

{

echo "$cfgLogin[",$row['id'],"]&nbsp=&nbsp'",$row['name'],"';","<br>"

$cfgLogin[",$row['id'],"]&nbsp=&nbsp'",$row['pass'],"';","<br>"

$cfgLogin[",$row['id'],"]&nbsp=&nbsp'",$row['level'],"';","<br>"

$cfgLogin[",$row['id'],"]&nbsp=&nbsp'",$row['id'];

}

 

?>

 

but it will not display right. I would love any help you can give me ^_^

 

-Corey Maddox

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.