Jump to content

plasmagames

Members
  • Posts

    63
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

plasmagames's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. then tell me why when i post in that thread it doesn't post it. I ahve posted twice there and they didn't show so i started a knew thread for it. I want to get this problem solved so i can get started on my next project. Getting this fixed will allow me to get my site going
  2. Quote: Maq to answer your question. in the config.php file(included with all pages) there are some renaming of $logged variables $uId = $logged['id']; $uName = $logged['username']; $uEmail = $logged['email']; $uMsn = $logged['msn']; $uIp = $logged['ip']; $uSignup = $logged['signup']; $uLevel = $logged['level']; $uGtalk = $logged['gtalk']; $uMsn = $logged['msn']; $uAim = $logged['aim']; $uLocation = $logged['location']; $uBio = $logged['bio']; $uGroup = $logged['gid']; $uMembergroup = $logged['membergroup']; and membergroup is the field in the database as are location, id etc. so yes it is in the database so to speak
  3. this is a continuation of my previous thread http://www.phpfreaks.com/forums/index.php/topic,228741.0.html for some reason the thread "was solved" when it wasn't
  4. again....................................... Hello?
  5. i know that. heres the code that has it <?php ob_start(); //Allows us to use cookies on all of the pages //Get some additional functions include ('functions.php'); include ('defs.php'); //*********************************************// //Length Of Time Cookie Lasts - 1 week default $cookieTime = time() + 7 * 86400; //***********************************************// //Path to index.php file , no following slash //Eg, if the index file were located at http://iscripting.net/isus/index.php - you would enter http://iscripting.net/isus $siteurl = SITE_PATH; //Your Website name, not the <title> $sitename = SITE_NAME; //The default membergroup when someone registers. $defaultmembergroup = "user"; //**********************************************// //Connect to the database $connect = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if (!$connect) echo 'There was an error connecting to the database'; mysql_select_db(DB_NAME); // Get and authenticate their cookie information. $u1 = secure($_COOKIE['username']); $p1 = secure($_COOKIE['password']); //Check theyre logged in. $logged = mysql_query("SELECT * FROM `users` WHERE username = '$u1' AND password = '$p1'"); $logged = mysql_fetch_array($logged, MYSQL_ASSOC); //Rename some of the $logged['variables'] with easier names. $uId = $logged['id']; $uName = $logged['username']; $uEmail = $logged['email']; $uMsn = $logged['msn']; $uIp = $logged['ip']; $uSignup = $logged['signup']; $uLevel = $logged['level']; $uGtalk = $logged['gtalk']; $uMsn = $logged['msn']; $uAim = $logged['aim']; $uLocation = $logged['location']; $uBio = $logged['bio']; $uGroup = $logged['gid']; $uMembergroup = $logged['membergroup']; //If the user isn't logged in, we'll set their name to guest and membergroup to guest as well so they don't screw anything up if (!$uName) { $uName = guest; $uMembergroup = guest; } //Get the permissions sorted out. $permquery1 = mysql_query("SELECT * FROM `permissions` WHERE mg_name = '$uMembergroup' "); $uCan = mysql_fetch_assoc($permquery1); $action = secure($_GET['action']); $sa = secure($_GET['sa']); $ssa = secure($_GET['ssa']); ?> which btw is included with all pages
  6. ok heres the files login.php <BR><STRONG><img src="theme/<?php echo $theme;?>/i/key.png"> Login</STRONG> <?php ob_start(); session_start(); if ($uId) { //If they are logged in, they don't need to be here header("Location: " . SITE_PATH . "/index.php"); } else { if (!isset($_POST['login'])) { //If the post hasn't been submitted, then show the forms echo '<BR><p><form method="post" action="index.php?action=login"> <b>Username:</b><input class="field" type="text" name="username"><br /> <br /> <b>Password:</b><input class="field" type="password" name="password"><br /> <input class="submit" type="submit" name="login" value="Login"><p> </form> <br> <a href="index.php?action=forgot">Forgot Password?</a> | <a href="index.php?action=register">Register</a>'; } else { //secure the input $username = secure($_POST['username']); $password = secure($_POST['password']); //make sure the fields arn't empty if (!$username | !$password) { echo 'You left a field empty'; } else { //make sure the user exists $user = mysql_query("SELECT * FROM `users` WHERE username = '$username'"); if (($usez = mysql_num_rows($user)) == 0) { echo 'user doesnt exist'; } else { //Encrypt the password to check with the encrypted one currently in the database $encpass = md5($password . SALT); //Find the user $superquery = mysql_query("SELECT * FROM `users` WHERE username = '$username' AND password = '$encpass'"); if (mysql_num_rows($superquery) == 1) { //If the user is found, set the cookies setcookie("username", $username, $cookieTime); setcookie("password", $encpass, $cookieTime); echo 'Success, you are now logged in.'; header("Location: " . SITE_PATH . "/index.php"); } else { echo 'Failure'; } } } } } ?> nav.php <?php if ($uId) { if ($uCan) echo "Hey! <STRONG>$uName</STRONG>"; // hello member! echo '<p>'; echo '<strong>User Menu</strong>'; echo '<br>'; echo '<br>'; echo "<a href=\"index.php?action=editprofile\">Edit Profile</a> <br>"; echo "<a href=\"index.php?action=memberlist\">View Members</a> <br>"; echo "<a href=\"index.php?action=logout\">Logout</a> <br>"; echo '</p>'; echo "<BR>"; if($_SESSION["admin"]==1) // Checks for Admin { print '<strong>Admin</strong>'; print '<br />'; print '<br />'; print '<a href="index.php?action=theme">Change Theme</a> <br>'; print '<a href="index.php?action=news">Edit News</a> <br>'; print '<a href="index.php?action=general">General Settings</a> <br>'; } } else { // if this isn't a member then echo "<br>"; include ('login.php'); echo "Welcome, <STRONG>$uName</STRONG>!"; echo '<p>'; echo "<br>"; echo "<a href=\"index.php?action=login\">Login</a>"; echo "<br>"; echo "<a href=\"index.php?action=register\">Sign up</a>"; echo '</p>'; } echo "<BR>"; //break echo "<BR>"; // break echo '<img src="theme/'.$theme.'/i/blah.png" alt=\"Bubble\"><STRONG>Partners</STRONG>'; // to enable please remvoe the comments // include('partners.php'); include('other.php'); ?>
  7. could i see some code and then i might be able to help
  8. ya but who uses an old browser eveyone at least uses IE 6 or FF2
  9. try using transitional instead of strict Or go to http://validator.w3.org/ and use the Validate by direct input.
  10. First, yes i use sessions and second the page that i put the source code for is nav.php which is included in index.php along with some others. and all pages load within a switch statement. and you create a admin user when your install the script just like smf and all the others. the variable for the membergroup is $uMembergroup and i tried $uMembergroup = "admin" and that didn't work
  11. I am using a script that has became "obsolete" and there is no support for it. So i'm asking here how to get the script to check for an admin. heres the page i want to check for admin status <?php if ($uId) { if ($uCan) echo "Hey! <STRONG>$uName</STRONG>"; // hello member! echo '<p>'; echo '<strong>User Menu</strong>'; echo '<br>'; echo '<br>'; echo "<a href=\"index.php?action=editprofile\">Edit Profile</a> <br>"; echo "<a href=\"index.php?action=memberlist\">View Members</a> <br>"; echo "<a href=\"index.php?action=logout\">Logout</a> <br>"; echo '</p>'; echo "<BR>"; if ($admin = '2'); echo '<strong>Admin</strong>'; echo '<br />'; echo '<br />'; echo '<a href="index.php?action=theme">Change Theme</a> <br>'; echo '<a href="index.php?action=news">Edit News</a> <br>'; echo '<a href="index.php?action=general">General Settings</a> <br>'; } else { // if this isn't a member then echo "<br>"; include ('login.php'); echo "Welcome, <STRONG>$uName</STRONG>!"; echo '<p>'; echo "<br>"; echo "<a href=\"index.php?action=login\">Login</a>"; echo "<br>"; echo "<a href=\"index.php?action=register\">Sign up</a>"; echo '</p>'; } echo "<BR>"; //break echo "<BR>"; // break echo '<img src="theme/'.$theme.'/i/blah.png" alt=\"Bubble\"><STRONG>Partners</STRONG>'; // to enable please remvoe the comments // include('partners.php'); include('other.php'); ?>
  12. could i change the { your usual site content } to { header( 'Location: http://plasmasteelgames.net ) ; } and put all your code in a php file and include it in the config.php file
×
×
  • 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.