Jump to content

Bramme

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Everything posted by Bramme

  1. come to think of it, i think it'd be best if you ask your question here: http://www.phpfreaks.com/forums/index.php/board,7.0.html or maybe ask a mod to move it...
  2. tried that, no difference... the cookies get set, but not read, nor deleted...
  3. <?php function split($string, $chr = " ") { //.chr is the character you want to add, not necessary there's a space added automatically $c = strlen($string); $m = ceil($c / 2); $a = substr($string, 0, $m); $b = substr($string, $m, $c); // i'm guessing $b = substr($string, $m); would be enough $string = $a.$chr.$b; return $string; } ?> something like that should do the trick
  4. http://www.bramme.net/cosmoswars/log/out/ there you go... apparently he sees only one, however: (it's dutch, but you can still see the two cookies...)
  5. nope, doesn't work either, they just remain there... i'll upload all the files used, so if anyone would have some spare time, they could have a look at it... edit: http://bramme.net/cosmosw/ those are the files you can see it live here: http://bramme.net/cosmoswars/ the username and password are both "demo"
  6. i wouldn't worry too much about what someone said to you... if you're not getting shitloads of spam, you don't use your script for any vital information sharing, and you're still getting all the mails sent through it, I think it works just fine...
  7. can't really think of anything... I've always been using wamp, however, i see the file goes looking for DLL's in c:\program files\php... is this actually where you installed it? or did you change locations maybe?
  8. //removing quotes from inputs function quote($value) { if (get_magic_quotes_gpc()) { $value = stripslashes($value); } if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } return $value; } this is a function i once got from somebody else, preventing people to try and get information from your database tables by entering ''s and what not... (there's a specific term for this, but i forgot it )
  9. add ob_start(); to the very first line of your page (within <?php ?> tags offcourse) and ob_end_flush(); to your last line... that should solve it.
  10. did you install php apache an mysql seperatly? I don't know if it's usefull to you, but I'm using WAMP... it's apache and mysql in one... quite handy, I must say...
  11. nope... didn't do anything, doesn't even delete the cookies when logging out...
  12. Okay, so I'm working on a little project, and I've got a little loginbox, it has a checkbox, just like vbulletin, to keep you logged in(set a cookie) or just use a $_SESSION... So here's how my login script looks: <?php // Log in $loginname = isset($_POST['usname']) ? $_POST['usname'] : ""; $loginpass = isset($_POST['passw']) ? $_POST['passw'] : ""; $loginpass = md5($loginpass); $remember = isset($_POST['remember']); if(!empty($loginname) && !empty($loginpass)) { $c = mysql_num_rows(mysql_query("SELECT * FROM accounts WHERE name = '$loginname' AND password = '$loginpass'")); if($c > 0) { if($remember == TRUE) { setcookie("usname", $loginname, time()+(7*86400)); setcookie("pass", $loginpass, time()+(7*86400)); } else { $_SESSION['loggedin'] = $loginname; } } } header("Location: /play/game/"); ?> Now, I soon noticed that i wasn't logging in when using cookies (session works fine), so I decided to echo the cookies in my index.php // Log in check: if(isset($_SESSION['loggedin']) || isset($_COOKIE['usname'])) { ... //i've tried combinations of isset and !empty, no difference } // testing if they are set in index.php echo 'usname: '.@$_COOKIE['usname'].'<br />'; echo 'pass: '.@$_COOKIE['pass'].'<br />'; echo 'session: '.@$_SESSION['loggedin'].'<br />'; and the cookies all return zip... So i thought there must be something wrong with the way i'm setting these cookies... However, when i had a look at my cookies (with mozilla firefox) i soon saw that they were perfectly set... I've got a cookie usname, with the username, and a cookie pass, but the website doesn't recognize them for some reason... other way around, when I log out <?php // Logout setcookie("usname",""); setcookie("pass",""); session_destroy(); header("Location: /read/home/"); ?> the cookies stay, right were they are... I haven't got a clue what's going on... I first thought it had something to do with the way I included my login page, but I've tried different things and none work...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.