Also, you made an error here.. You forgot to close the tag.
Edited by Invent (Forum Moderator): Fixed original post :)Code:
<?php
session_start();
session_destroy();
die("You have successfully logged out. <a href='login.php'>Login</a>");
?>
Printable View
Also, you made an error here.. You forgot to close the tag.
Edited by Invent (Forum Moderator): Fixed original post :)Code:
<?php
session_start();
session_destroy();
die("You have successfully logged out. <a href='login.php'>Login</a>");
?>
Great tutorial!
Any chance of an editprofile code coming up soon pls? :P
Lol I'll do it now ;)
Ew, couldn't edit post :)
I can't do the edit profile script right now, as I am quite busy plus it would require me actually adding fields for the user to change :P therefore, me changing the register script too.
First of all go on your mysql database, click the SQL tab and drop this code in:
ALTER TABLE `users` (
`id` int(10) NOT NULL auto_increment,
`email` varchar(30) NOT NULL default '',
`habbo` varchar(30) NOT NULL default '',
`password ` varchar(30) NOT NULL default ",
PRIMARY KEY (`id`)
) TYPE=MyISAM;
Then call this file edit.php and put in this (not sure if it works, haven't tested it):
PHP Code:<?php
session_start();
include 'config.php';
if (isset($_SESSION[logged_in])) {
if (isset($_POST[update])) {
$email = addslashes(htmlspecialchars($_POST[email]));
$habbo = addslashes(htmlspecialchars($_POST[habbo]));
$password = md5($_POST[password]);
$upd = mysql_query("UPDATE users SET email = '$email', habbo = '$habbo', password = '$password' WHERE username = '$username'");
echo "Profile updated!";
}
} else {
echo "<form method='post' action='edit.php?edit'>
Email:<br>
<input type='text' name='email' size='20'><br>
Habbo name:<br>
<input type='text' name='habbo' size='20'><br>
Password:<br>
<input type='password' name='password' size='20'><br>
<input type='submit' name='update' value='Update'>";
}
?>
Cheers ;)
See, as if by magic one appeared.
No problem :) If theres some other files that need doing I'm sure me and luke will work together to put them in here :)
Of course ;)
One problem.. When I'm logged out I can see it, but when I'm not logged in it's just a blank page.