Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Log out

General discussions related to php

Moderators: macek, egami, gesf

Log out

Postby qim » Sun Mar 24, 2013 2:46 pm

I picked up some code online but I seem to have missed something:

I created a file called logout.php which I placed in the main folder

<?php
session_start();
//*****session_destroy() will destroy the session
session_destroy();
?>

and in the index.html I added

<A HREF = Pinto/logout.php>Log out</A><A HREF = index.html</A>

which I know is wrong! I just want to press the button, destry and return to the main page.

help

qim
qim
New php-forum User
New php-forum User
 
Posts: 7
Joined: Sat Mar 23, 2013 10:39 am

Re: Log out

Postby chrisranjana.com » Sun Mar 24, 2013 8:15 pm

Do you want to add a php header LOCATION to return to the main page after session_destroy ?
chrisranjana.com
New php-forum User
New php-forum User
 
Posts: 8
Joined: Sat Dec 07, 2002 6:47 pm
Location: Chennai , Tamil Nadu , India

Re: Log out

Postby qim » Mon Mar 25, 2013 12:47 am

I'm trying to build a site that looks like a site, rather than the final thing, when I will have to worry about securuity and lots of other stuff.

I only have two pages at the moment. The login page is also the front page. I will place "Logout" buttons in all pages, but right now I want to make the button in the main (Login) page to kill the session and stay on that very page.

I am new to this and cannot answer your question if it is a php header that I need.

Also I need to sort out the code inside the main page where the button is.

Thank you for your interest, and sorry I only replied now (it is 8.30 am here)
qim
New php-forum User
New php-forum User
 
Posts: 7
Joined: Sat Mar 23, 2013 10:39 am


Return to PHP General

Who is online

Users browsing this forum: Alexa [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.