1 - do i use this code at the top of each of my page i wish to only alow access if there as been a session
Code: <?php
include_once 'Connect.php';
if (!is_authed()) 
{
     die ('You are not permitted to view this page, <a href="index.php">click here</a> to go back.');
}
?>
connect.php i use to conect to database this also does a included to functions.php
this is part of my functions.php
Code: function user_login($username, $password)
     // Now encrypt the data to be stored in the session
     $encrypted_id = md5($user['id']);
     $encrypted_name = md5($user['username']);
     // Store the data in the session
     $_SESSION['id'] = $id;
     $_SESSION['username'] = $username;
     $_SESSION['encrypted_id'] = $encrypted_id;
     $_SESSION['encrypted_name'] = $encrypted_name;
}
function is_authed()
{
     // Check if the encrypted username is the same
     // as the unencrypted one, if it is, it hasn't been changed
     if (isset($_SESSION['username']) && (md5($_SESSION['username']) == $_SESSION['encrypted_name']))
     {
          return true;
     }
     else
     {
          return false;
     }
}
lastly if i want do display info from the database where it matches the session being used
What code would if any would i use to compliment the code in the first question and what code would i enter into the table below
Code: <html>
<head></head>
<body>
<table> 
  <tr>
    <td>feild1 from database here</td>
    <td>feild2 from database here</td>
    <td>feild3 from database here</td>
  </tr>
</table>
</body>
</html>
Creating a custom API
I'm creating a site, and I need to create a basic API. Unfortunately I have no idea where to start.My site will basically keep track of errors from other users' ASP.NET sites, and they can filter
Help with Hyperlink
Hi,What I am trying to do may be simple, I just can't get it to work. Ok...I am using Zend and so the database connect that I need for this is a simple call to it like Code:
making web pages for accounts
Hello, I would like to make pages for accounts on my website im making (its not a real website..im just making a website of accounts and stuff so i can learn PHP/mysql as i go along)I would like to
Data type mismatch
Hi, I am migrating data from algol to c.I mapped real datatype in algol to double datatype in c.real has 6 bytes storage.i got one formula in unisys manual which is about the internal representation
Post, not working, please help
The error is:Method Not AllowedThe requested method POST is not allowed for the URL /students/06/php/index.--------------------------------------------------------------------------------Apache/1.3.33
AUTONUMBER PROBLEM
Hello Everyone,
recrawling
Can anyone suggest me how may i know a page is updated before it is being downloaded, so that i can recrawl it.although i have used page info but that is not reliable.
image upload, resize THEN submit form
Ok so I have a form that requires the user to upload an image, and then do something with that image (using some ajax scripts), then fill out the rest of the form and submit. I have the upload script
mr8m - reverse document
Friends,
Why do I get this error?
Error:Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/runevid/public_html/Quests/finished_tutorial.php on line