This is to the above posts where you were talking about cookie auth.
Don't query the database every time the page loads to check if the cookie is valid though. With lots of users it can potentially slow stuff down. When a user logs in, set cookies with username and hash key (maybe part of their password, some numbers, etc.) and a session key with their username (and if needed, their user id). Then when you are checking if the user exists, check session first, if there is no session keys then check cookies. Then if a cookie is set, check that against your database and then set the session username (and user id). It really speeds things up instead of querying the database each time a user loads a page.
My projects twice in the OP? That'd be the first time for a WAYWO thread! Thanks! :)
[editline]04:44PM[/editline]
As to my game, it's stood still for quite a while, but recently started again. Added some more graphics, a menu, and fixed plenty of bugs.
(The menu isn't always blurry like this. It blurs every 10th second through a little cycle that takes about a second)
[img]http://www.jalsoedesign.net/garnageextreme/newscreen1.jpg[/img]
New grass added (images instead of vector, due to resource use), and a texture on the green.
[img]http://www.jalsoedesign.net/garnageextreme/newscreen2.jpg[/img]
Car gets dark when it explodes, and has smoke emitting out of it.
[img]http://www.jalsoedesign.net/garnageextreme/newscreen3.jpg[/img]
Apparently cookies don't like different directories in your website.
Think I should try setrawcookie() :ohdear:
You guys might be interested in my state-of-the-art login system:
[php]<?php
function isAdmin($name, $access, $cookies = true)
{
$acc['admin'] = 'test';
$nameC = isset($_COOKIE['name']) ? $_COOKIE['name'] : false;
$accessC = isset($_COOKIE['access']) ? $_COOKIE['access'] : false;
if ($cookies)
{
if (($nameC && $accessC) && md5($acc[$nameC]) == $accessC)
return true;
else
return false;
}
else
{
if (($name && $access) && $acc[$name] == $access)
return true;
else
return false;
}
}
?>[/php]
I haven't been really working on anything (besides something for garry) due to exams. Sorry.
Why is your MD5 function @'ed? Why would it fail, and even if it does, you should add some error handling instead of just ignoring it.
[QUOTE=h2ooooooo;21964022]Why is your MD5 function @'ed? Why would it fail, and even if it does, you should add some error handling instead of just ignoring it.[/QUOTE]
Better?
[url=http://victi.webs.com/mypage.html]My friend asked me why his site wasn't working and if I could fix it up for him.[/url]
[b]It was one big jpg and he was positioning divs over it, among CSS errors and other problems[/b]
[url=http://costeira.com/victi/]So I fixed it up, and for once, something I made isn't terrible[/url]
cool gif, I was taking stuff from tf2 and tf2maps' websites while I was making it, so now I'm moving them to mine
may i ask what the broken images are going to be?
refresh and see, they're thumbnails of some random maps on tf2maps.net. Just placeholders for real thumbs of his maps
Edit: [url=http://downforeveryoneorjustme.com/tf2maps.net]It looks like tf2maps.net are down now[/url]
ah i see
-Snip- nvm found it
[QUOTE=nick10510;21961684]Apparently cookies don't like different directories in your website.
Think I should try setrawcookie() :ohdear:[/QUOTE]
Read up on setcookie() on the PHP manual first, because it clearly shows you how to set the directory.
setcookie( name, value, time, directory, etc ) (off the top of my head, order might be wrong)
[QUOTE=Erp;21960948]This is to the above posts where you were talking about cookie auth.
Don't query the database every time the page loads to check if the cookie is valid though. With lots of users it can potentially slow stuff down. When a user logs in, set cookies with username and hash key (maybe part of their password, some numbers, etc.) and a session key with their username (and if needed, their user id). Then when you are checking if the user exists, check session first, if there is no session keys then check cookies. Then if a cookie is set, check that against your database and then set the session username (and user id). It really speeds things up instead of querying the database each time a user loads a page.[/QUOTE]
I only ever check against the database when loading a page that requires login, or making an action which requires login. Things like the 'logged in as' is simply cookie based, so people can 'fake' login as any username, it just won't let them do anything.
[QUOTE='-[ Fizzadar ]-;21969250']
I only ever check against the database when loading a page that requires login, or making an action which requires login. Things like the 'logged in as' is simply cookie based, so people can 'fake' login as any username, it just won't let them do anything.[/QUOTE]Hmm, I didn't think of that, but that's a good idea.
Thinking of working on building a framework that mocks the way vBulletin's core stuff works, it's very good.
[QUOTE='-[ Fizzadar ]-;21969250']Read up on setcookie() on the PHP manual first, because it clearly shows you how to set the directory.
setcookie( name, value, time, directory, etc ) (off the top of my head, order might be wrong)
[/QUOTE]
I've learned everything I have off of google, w3schools, and a few friends. Every single one said that setcookie() could only do name, value, and time. :colbert:
[QUOTE=nick10510;21971616]I've learned everything I have off of google, w3schools, and a few friends. Every single one said that setcookie() could only do name, value, and time. :colbert:[/QUOTE]
I like to say that I have a 12 inch cock but that doesn't make it so.
bool [b]setcookie[/b] ( string $name [, string $value [, int $expire = 0 [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]]]] )
[url]http://www.php.net/manual/en/function.setcookie.php[/url]
[QUOTE=hdalv;21971667]I like to say that I have a 12 inch cock but that doesn't make it so.
bool [b]setcookie[/b] ( string $name [, string $value [, int $expire = 0 [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]]]] )
[url]http://ro2.php.net/manual/en/function.setcookie.php[/url][/QUOTE]
I wasn't saying he was wrong. I was just mentioning that all my sources apparently lied to me..
[editline]06:34PM[/editline]
Tried using the format you gave, didn't really seem to work..
[php]
setcookie("auth",$auth,time()+60*120,"/pba","http://bellminator.com");
setcookie("username",$_POST['uname'],time()+60*120,"/pba","http://bellminator.com");
mysql_query("UPDATE PBA_users SET auth='" . $auth . "'");
$nerror="Welcome " . $_POST[uname] . "! You are now logged in!<br />";[/php]
[QUOTE=nick10510;21971738]I wasn't saying he was wrong. I was just mentioning that all my sources apparently lied to me..
[editline]06:34PM[/editline]
Tried using the format you gave, didn't really seem to work..
[php]
setcookie("auth",$auth,time()+60*120,"/pba","http://bellminator.com");
setcookie("username",$_POST['uname'],time()+60*120,"/pba","http://bellminator.com");
mysql_query("UPDATE PBA_users SET auth='" . $auth . "'");
$nerror="Welcome " . $_POST[uname] . "! You are now logged in!<br />";[/php][/QUOTE]
Why isn't it working?
Additionally:
[url]http://bellminator.com/viewpost.php?post=5%20OR%20%3C/title%3E%3C/head%3E%3Ch1%20style=color:white%3EESCAPING%20FAIL%3C/h1%3E%3Cplaintext%3E[/url]
:saddowns:
Oh and
[url]http://bellminator.com/viewpost.php?post=5%20OR%201[/url]
Also you don't have to specify the path and domain unless you want something special done with it, it fills it out automatically.
turb_ have you considered adding a progress bar for uploads on anyhub? Something like [url]http://www.uploadify.com/[/url] would only take a few minutes to implement and would greatly enhance the user experience.
[QUOTE=compwhizii;21971338]Thinking of working on building a framework that mocks the way vBulletin's core stuff works, it's very good.[/QUOTE]
Working on this right now.
[QUOTE=HTF;21974807]turb_ have you considered adding a progress bar for uploads on anyhub? Something like [url]http://www.uploadify.com/[/url] would only take a few minutes to implement and would greatly enhance the user experience.[/QUOTE]
No, it requires Flash.
When I can do it with pure Javascript, I will. No flash.
[QUOTE=nick10510;21971616]I've learned everything I have off of google, w3schools, and a few friends. Every single one said that setcookie() could only do name, value, and time. :colbert:[/QUOTE]
Use the PHP manual always, its simply amazing.
[QUOTE=turb_;21974846]No, it requires Flash.
When I can do it with pure Javascript, I will. No flash.[/QUOTE]
[del][url]http://www.php.net/manual/en/features.file-upload.php#71564[/url]
What did you write your site in? I'm guessing php but I might be wrong[/del]
Asp.net
oh... um [url]http://mattberseth.com/blog/2008/07/aspnet_file_upload_with_realti_1.html[/url] ?
I don't know, I tried writing asp.net a while ago but [url=http://readyhosting.com]my host[/url] is terrible. I also couldn't figure out how to make it work,
I'd choose to publish via ftp but then I'd get errors when I went to the site. It was a long time ago, I don't really remember
[QUOTE=turb_;21974846]No, it requires Flash.
When I can do it with pure Javascript, I will. No flash.[/QUOTE]
That is a shame, it is not like it is a huge flash dialog or something (you don't even see that it is flash as the user) and you can have it rollback to a regular form when there is no flash.
As you switched to ASP.net you could always use a control for it like: [URL="http://www.brettle.com/neatupload"]This[/URL] or [URL="http://url.htf.me/zxkbc"]This[/URL].
Not sure if the second one likes mono though, the first defo does. Both require more effort that the flash way of doing it but the benefit is no flash.
Edit: I got the links from that article but I was not fast enough
What would also be cool is a favicon so anyhub will look pretty on my bookmark toolbar
Sorry, you need to Log In to post a reply to this thread.