Jump to content

Installing my User System


boboreo1222

Recommended Posts

Can anyone help me please?  I need to know where to upload the following things to..

 

I will post the codes..

 

Admin.php

 

<?
ob_start();
include("config.php");
if($logged[username] && $logged[level] ==5)
{
//checks to see if the user is logged in, and if their user level
//is 5 (this is administrator)
if($_GET[user])
{
//checks to see if there is a ?user=username variable in the url.
if (!$_POST[update])
{
// the form hasn't been submitted.  We continue...
$user = mysql_query("SELECT * from users where username = '$_GET[user]'");
$user = mysql_fetch_array($user);
//these lines get the user's information and put it in an array.
//we will display the information in the html form
echo("
<div align=\"center\"><form method=\"POST\">
<table width=\"100%\">
<tr>
<td align=\"right\" width=\"25%\">
User Level 
</td>
<td align=\"left\">
<input type=\"tex\t" size=\"25\" maxlength=\"25\" name=\"level\"
value=\"$user[level]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
Location 
</td>
<td align=\"left\">
<input type=\"text\" size=\"25\" maxlength=\"25\" name=\"locate\"
value=\"$user[location]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
MSN Messenger 
</td>
<td align=\"left\">
<input size=\"25\" name=\"msn\" value=\"$user[msn]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
AOL Messenger</td>
<td align=\"left\">
<input size=\"25\" name=\"aim\"  value=\"$user[aim]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
Email Address</td>
<td align=\"left\">
<input size=\"25\"  name=\"email\" value=\"$user[email]\"></td>
</tr>
<tr>
<td align=\"center\">
</td>
<td align=\"left\">
<input type=\"submit\" name=\"update\" value=\"Update\"></td>
</tr>
</table>
</form>
</div>");
//displays the html form
}
else
{
$email = htmlspecialchars($_POST[email]);
$aim = htmlspecialchars($_POST[aim]);
$msn = htmlspecialchars($_POST[msn]);
$locate = htmlspecialchars($_POST[locate]);
$level = htmlspecialchars($_POST[level]);
// the above lines get rid of all html.
echo ("$_GET[user]'s profile has been updated.");
$update = mysql_query("Update users set email = '$email',
msn = '$msn', aim = '$aim',
location = '$locate', level = '$level' where username = '$_GET[user]'");
// updates the information in the database.
}
}
else
{
$getusers = mysql_query("Select * from users order by username asc");
while($users = mysql_fetch_array($getusers))
{
//makes a list of all the users
echo("<a href=\"admin.php?user=$users[username]\">$users[username]</a><br />");
//displays the user's names
}
}
}
else
{
//the user's level is not 5!  They cannot view this page
echo("Sorry, but you are not allowed to view this page!");
}
?>

 

Config.php

 

<?
   ob_start(); // allows you to use cookies
   $conn = mysql_connect("localhost","boboreo","bobby100");
   mysql_select_db(database) or die(mysql_error());
   //fill in the above lines where there are capital letters.
   $logged = MYSQL_QUERY("SELECT * from users WHERE id='$_COOKIE[id]'");
   $logged = mysql_fetch_array($logged);
   //the above lines get the user's information from the database.
?>

 

my login.php and logout.php

 

editprofile.php

members.php

messages.php

online.php

register.php

 

Please help

Link to comment
https://forums.phpfreaks.com/topic/43767-installing-my-user-system/
Share on other sites

well, you should have a webhost that supports PHP. They will assign you a directory with a username and password for FTP access.

 

Upload those files to the webserver and you should be good to go.

 

If this don't answer your question, then please post back with some more information on the problem.

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.