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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.