new to php
I have a simple login and am trying to write a logout.
I set a $_SESSION var to 1 if they are logged in:
if(isset($_POST['logname']))
{
$UserArr = chk_lgn($_POST['logname'],$_POST['passwd']);
$_SESSION['iden'] = $UserArr['UserId'];
$_SESSION['logname'] = $UserArr['logname'];
}
if($_SESSION['iden'] !=0)
{
$_SESSION['auth'] = 1;
header('location:../UserPage/index.php');
}
elseif($_SESSION['iden'] == 0)
{
$_SESSION['auth'] = 0;
if($_POST){echo "Try Again.";}
}
In a include file I have this function:
function log_out()
{
if($_GET[auth==0])
{
session_unset();
session_destroy();
}
}
At the top(of index) I call the function, fallowed this in the html:
<p><a href="../index.php?auth=0">LogOut</a></p>
When I click logout I am still able to navigate to member pages.
Shouldn't auth=0 in the url be stored in $_GET and be available for logout?
Thanks
Storing user data help?
Hey Guys, I'm not use if this question is to broad but I can always give you more information if needed.I have a website where users can login which uses mysql anyway I have a little form asking some
Filtering Tables
Hello Thanks for any help any one can give Im very new to PHP..I need to pull data for clients that share 2 diff services into one table.mysql_select_db($database_pull, $pull);$query_Recordset1 =
extending tidy
I have problem with type-hinting and extending tidy. This code creates error:Code: class cMyTidy extends tidy{ public $tralala;}$oMyTidy = new cMyTidy();doSomething($oMyTidy);function
PEAR Email Attachment w/ $gpg
I have no issues with this code if I take out the attachement section and include the info in the email body instead. However, I want the info to be in an email attachment. I do receive the email,
help with variable
I've got a problem, i want to echo some images depending on the $id, however for me to get that id i have to extract it from a query. So i've done that, but i want to extract all id's (not just 1), so
Target costs on Process orders not calculating
Hi All,
how to transport the Query and insfoset
Hi
error checking breaking my code
Hi there, OK first of all, big apologies for what I assume is really fundamental errors in the structure of my code. I'm really new at this and still learning, but I'm almost at the stage of giving up
redirect standard error and assert (how to?)
How do you redirect standard error and assert?---(Why? I am creating an web app and assert does not show on the webpage. I do not think standard error does either. Not sure, but fairly certain.
need a script for 3 pages
I have a customer who wants me to set up a site with a number of pages with the following requirements:Page A - which resides in a private directory so only he as access to it (this part is set up,