Jump to content

php_guy

Members
  • Posts

    62
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

php_guy's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, sorry I missed that about the exit; statement. I added that in. How is my code deemed reasonably secure when using $_SESSION??
  2. Wow I never knew that! I just did a little sample to test this... header('Location: login.php'); $db->execute_statement("insert into test_table values('my value')"); And it inserted a value into the DB So what should I put after header() to end it there? I can't do die() because it will just stop executing the code and not actually redirect... I could just put the main body of my code into the else block. So: session_start(); if(!isset($_SESSION['myusername'])){ header("Location:login.php"); } else { $username = $_SESSION['myusername']; // Remainder of code goes here } Would that suffice?
  3. As I understand, using a header() redirect acts as an implicit exit statement, doesn't it? If not, could I just put a die() statement?
  4. I have parts of my webpage protected with the following session_start(); if(!isset($_SESSION['myusername'])){ header("Location:login.php"); } else { $username = $_SESSION['myusername']; } How secure is this? The goal is so people who don't have access to the page (don't have a login account) cannot get access Thanks for any tips
×
×
  • 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.