Jump to content

trg86

Members
  • Posts

    64
  • Joined

  • Last visited

Everything posted by trg86

  1. Nope, no backed up data, just need to be able to move it to an 'archived' page, from the main page, if the user selects the option. I'm just not quite sure where to start...
  2. Hey guys, me again. I want to thank you again for helping resolve the issue I had earlier today with the php sessions. You all rock! I have approached an issue that I am not quite sure how to do exactly. In reference to the same content of my previous post, I have a form that, when filled out by a user, adds it's contents to a MySQL database and displays them in a very nice interface I have designed. Along with all of this, my system automatically adds 'options' to each display of input, i.e. 'edit' 'delete', etc. These work flawlessly. My question is, I am wanting to add a couple of new features that would require for the displayed information to be removed from the main page then moved and displayed on it's new page, consider this an option like 'Archive' What would be the best way for me to do this, code wise? Thanks again in advance for your assistance, this community is definitely very helpful.
  3. Alrighty, it looks like I have it working now, a pretty simple change actually at the hands of your suggestions! This is my updated code for handling the session variables across all of the pages. <?php session_start(); $username = $_SESSION['username']; //Username if (!isset($_SESSION['username']) || (trim($_SESSION['username'])=='')) { exit(); } ?>
  4. Thanks again for your reply David. I definitely ran the password variable through an MD5 encryption, but it did not occur to me to run an escape on the username, thank you very much for that tip!! Let me go ahead and make some changes to my code and I will let you know where I stand from there. Thanks!! This definitely seems like a very helpful community.
  5. Hey guys, sorry for my belated response, I was AFK for a while. For reference, here is the code that processes the login form from the login page, feel free to point out any errors you may see here that may be causing the issue. Thanks!!! <?php //Database Information $dbhost = "DELETED INFO FOR THIS POST"; //Host Name $dbname = "DELETED INFO FOR THIS POST"; //Database Name $dbuser = "DELETED INFO FOR THIS POST"; //Database Username $dbpass = "DELETED INFO FOR THIS POST"; //Database Password //Connect To Database mysql_connect($dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error()); mysql_select_db($dbname) or die(mysql_error()); //User Session session_start(); $username = $_POST['username']; //Username $password = md5($_POST['password']); //Password $query = "SELECT * FROM users WHERE username='$username' AND password='$password'"; $result = mysql_query($query); if (mysql_num_rows($result) != 1) { $error = "Bad Login"; include "login.html"; } else { $_SESSION['username'] = $username; include "main_interface.php"; } ?>
  6. Hi David, thanks for your reply. I do have error reporting turned on, but I do not receive an error, on any page. I am pretty new with the sessions thing, what would be the best way for me to apply your suggestion? Thanks!
  7. Hmm. Mind-boggling for me at the moment. Here is the code snippet for how I am displaying the username. <b>Welcome</b> <?php echo('<font color="#0092c8">'.$username.'</font>');?>!
  8. Thanks for your quick reply Beeeeney! I went ahead and applied your suggestion, now when loading the page, it loads just a blank white page, with text at the top that says: string(10) "trg86"
  9. Hi there guys, how is everyone today? I am having a minor issue with a session. I have a database I am working on that, of course, carries across multiple pages. The problem I am having is with the display of the logged in user's username, i.e. 'Welcome (username)!, Logout' This works fine upon the initial log in, but once I execute a different page (where the username is not displayed) and am re-directed back to the original page where the username is displayed, it seems to not show up, i.e. 'Welcome (blank space)!, Logout' I have tried a few things but I can't seem to resolve this minor issue. I do appreciate your help ahead of time, thanks! I have posted my session code below, this is the exact session code that starts each of the pages that I need to carry the data across. <?php session_start(); $username = $_POST['username']; //Username if (!isset($_SESSION['username'])) { exit(); } ?> Thank you for your help guys!!!
×
×
  • 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.