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
Change snippet to use CURDATE
I am using time() in the snippet below, I would like to use CURDATE() and have the database setup for date. My problem is, I am not sure how to change the PHP coding, I keep getting errors just adding
Converting numbers to months
The porgram works -just need the last function(month_convert_ to convert numbers to months -thanks.
Custom CMS
This is a big custom CMS script I'd like to develop and would like some help atleast figuring out where the best place to start would be.Website PagesBackstage 2 provides website pages for the
extract content from a website
i have written a code that will grab the content from the index page..i would like to know how can i leech completely thru the site (index,contact, news pages) and grab specific content only like
Need understanding of this bit of code
Code: <?php // WHERE clause filters $arrSQLFilters = array(); // whether or not zip codes table needs to be included $boolIncludeZipCodes = false; // Zipcode filter
Count of reciepients in php mailer
How can i sent a mail to large no of reciepients say 10,00,00 Using PHP MAILER
Turning Data into URLs?
This may seem very basic to you, but I'm having a hard time figuring out how to do this since I don't even know what the proper term for it is:Background info:Animals Table - animalid, name, photo,
tell csv import script to ignore blank rows?
Hi i have the below script but i get an error if a row is blank ie a return in the csv file at the end i need to somehow tell it to skip the rows that have nothing on them:Code: <?php // define
How could I do this?
Ive got a simple lottery game, and am using an sql database to keep track of the numbers bought. But, when the person comes to buy the ticket, I have to replay to my process page which ticket they
Strange PHP/mySQL error ... am I just tired?
Code: <?## CONNECT TO DB FUNCTION!function ConnectTo($db2con){ $hostName = "localhost"; $dbName = "people_".$db2con; $userName = "people_main"; $password =