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
Embedding flash object in Else statement
This is my first major project in PHP and I'm having some trouble embedding a flash object in an Else statement. I've googled it several times, and looked at several sites and they all seem to
getAlexaRank($url) function not working
I have made a function to get alexa rankthe site is here: http://mytestsite.rack111.com/1but the Alexa rank is showing up blank and I dont know why can someone please tell me if there is something
How to Handle more than one submit button in single form?
HiI have one PHP file which contains one Form. In this form there are two Submit type Buttons<input type="submit" name="edit" value="save"> <input
Binding 2 UDP sockets on same port, connected to different destinations, 1 receives
Hello,
My query is being run with no results.
I have this.Code: function DropUser($duser_id, $user_email, $user_username) { if(isset($_SESSION['admin_username']) && isset($_SESSION['admin_id']) &&
timed header image rotation
I have a joomla site and I was trying to setup a rotating image based on timing NOT just refreshing the page.I found this code (i didn't write it) which works to load images but does not switch them
Weird problem with SELECT command..Help!
Hi!It seems I'm having a really weird problem with SQL SELECT command....I have table into a mySQL DB wich as 4 entry in it. I created the select command to retrieve the data and only 3 of the 4 entry
Working with popups and such in a class
I've recently started building my applications completely enclosed in classes. I like the fact that I can base everything off one root and work with that, but I'm having a problem with popups
Help With editting and deleting form
Hallo !!So look at this image :http://img194.imageshack.us/img194/8272/snapshot5f.png This table prints the titles of entries from a table in a database.. The code that i use for this table is this
Read from forum
Haven't written anything forever and I would like to get back.What I'm trying to do is getting the data from all the threads in a sub forum.Can someone roughly point out which functions I'll need for