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
array_diff weirdness
I'm using the following bit of code$diff = array_diff($pids, $pidlist); $diff = array_values($diff); //reindex array to remove empties//output to $discrepancyprint_r($diff);exit;Both $pids and
WORDPRESS - Multiple Loops Only Going to One Post?
I have various pages with multiple loops and i need them to be individual to all other categories.2 columns.Left column shows 4 posts from category news just with the date and some custom
Multiple Options for a Single Page
For this example I want to use the Handlers option which is under Fed Admin and all the related coding to the handlers option is found on the handlers.php page which includes a list of handlers with a
Removing Title From database problem
Hi again ! i am having an issue with updating database. When i update any price of a title it remove the title from database please can somebody help me what i am missing in my code. here it is:Code:
onclick problem
I have <input type="text" name="message"><a href=page2.php>click here</a> Can i parse the value whatever written in the textbox on url
PHP Captcha Error help - replace the "die" command
Hi All,I am after a bit of help with a Captcha spam protection box.The site gave me instructions, and all is well, apart from if the user give the wrong Captcha information...The highlighted code is
how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are two buttons. ob clicking first button i want to save user's provided data to the database display the
Coding Critique
I was hoping someone could take a second and look down my code and see if they see any problems with how it was written before I continue on.Code: <?php require
Tree Menu
Hi guys,Can anyone help me making a tree navigation system? I have a site where I'm allowing users to upload their files to share with each other. They can create folders, but I'm having real
foreach and array need help combining
Hi guys.Here's the codeCode: array( 'tag' => 'code', 'type' => 'unparsed_content', 'content' => '<div