Jump to content


  • Posts

  • Joined

  • Last visited

Kon-Tiki's Achievements


Newbie (1/7)



  1. I dunno if this is the right place, especially as it's not development-wise.I like to play Flash games now and then to fill up an empty half an hour. A problem I frequently have, though, is that when I move the character around (cursor keys or mouse, depending on the game), it often kinda goes tilt and keeps walking in one direction, or seems as if it's controlled by somebody else, walking all over the place without me giving any input (especially happens when pressing one direction for a few seconds, to make it walk in that direction for a bit). That half an hour of relaxing during an empty time quickly becomes half an hour of stress and frustration because of that. I got it with quite alot of games, spread over different sites (although some seem to have it worse than others). I use Firefox, and had it in both the latest version and some previous versions. Dunno if it does that in IE, as I haven't tried there.Anybody here knows what causes this and what I can do 'bout it? It makes so many games near-impossible to play.
  2. Kon-Tiki

    $_files Question

    What happens with a $_FILES variable after the page changes/is closed if you don't copy it somewhere? Does it remain in a tmp-dir indefinitely?
  3. Hey,I got some numbers to perform some basic maths on. Little problem with it, is that some numbers are regular ints, while others look like this: "1,234". If I do those maths on the latter type, they'll lose everything after the comma. I want to keep everything behind the comma as well, though.Also, they have leading zeroes. How can I keep those as well?Thanks in advance,Kon-Tiki
  4. A site of mine often got hits from Google Translator, people who wanted to read my reviews in Italian or such. You can build such a thing into the way your site links, see how the translator's URL's parameters work and play with that in your <a href>-tags. Please do keep in mind that you want to allow your users to switch that off without much hassle. If I'm on vacation in, say, Greece, and want to quickly check your site, I don't want to read it in Greece.
  5. Do two tests (you can do them at the same time):1) Echo a var_dump of $page on the page2) Make the page it has to include echo a simple "Page 1", "Page 2", etc.This way, you can easily see where things go wrong: It can be that $page doesn't get an acceptable value, could be that something's wrong in the different pages' code, or, as FirefoxRocks said, could be that your pages' contents is the same. Could also be that there's something wrong in the way it includes the pages. The two tests described above will help you see where the error is.
  6. Kon-Tiki


    That's what that if-block and that session var are for. The session var keeps in mind that that person is logged in at that moment. It'll end once he closes the browser.The if-block sees whether or not that person is logged in. If they aren't, they just won't get through that block.
  7. Kon-Tiki


    Do the following:When the user arrives at the site, show the login page.If the user logs in, check and clean the input.Check database for matching login/password combo.If the returning result is 1 (shouldn't be able to have any more matches than just 1!), set a session var containing the login name / login ID (whichever works best for you)If not, call the login page (function is easiest if you code like me, but it's down to personal style) again with an error.My login code usually looks like this:if (!isset($_SESSION["login"])) login(); // Contains the login form, with either a call to processing the input in the beginning, or just processes the input before placing the formelse {// All other code/function calls here}
  8. Kon-Tiki


    Hey, the site I got now's finished, so I wanted to add some polish to it by adding user-friendly URLs (which might help solving a small Javascript-detection related imperfection and a minor bug that comes along with it). I know how to do mod-rewrites (got a clean example file from the time I figured it out), but this is less a technical issue.In short, I have near to none experience with mod-rewrite. I figured out how it works, technically, and used it once on a previous site I made. Purely the technical part's no problem, as I got the example file and there's plenty of regex references online. What the problem is, though, is the following.The site itself's main focus is on projects. In the current URL, the projects are listed by ID, not project name. This has two reasons:1) It's just easier and cleaner to put an ID in an URL parameter (whitespace, special chars, etc issue is gone)2) Laziness from my part (turning the way the site handles these things around to use project name instead of ID)As far as user-friendly URLs go, putting just the ID in isn't exactly useful. Who knows what project they'll come to when they go to http://www.mysite.com/en/42 ? It'd be alot more userfriendly to be http://www.mysite.com/en/someproject (the EN being language).So, the main questions are these:1) Is there a user-friendly way to use the ID?2) If not using the ID, is there a way to cleanly and elegantly handle whitespaces, special chars, etc? (meaning that people don't have to fill in http://www.mysite.com/en/some%20project, for example)Thanks in advance,Kon-Tiki
  9. I'm working on the non-Javascript compatibility of my site, and am stumped on one part.Right now, I need to choose one out of two functions to call, depending on whether or not Javascript is enabled. The problem is... I can't find a way to know that in PHP.I know of the noscript-tags, but a simple test like this doesn't work: <?php$javascript = true;?><noscript><?php $javascript = false; ?></noscript> Here, $javascript will always return false, so this isn't an option.Another way's by setting a hidden field in a form, altering it with Javascript, then checking its value in PHP. Problem with that is that I need to know without resending the page, so this isn't an option either.Third possibility that I found, was the get_browser() function. Only thing with that, is that it shows whether or not Javascript is possible on that browser, not if it's curently enabled or not.So... I'm stumped. Does anybody know how to do this?
  10. Hurray! Found this, and after some fiddling about, I finally got it to work Now to get it to play nice with the Mootools gallery, and make it so that that gallery works without Javascript as well.Aaaaalmost there Edit: OH FOR COITUS' SAKE! It's either that Jquery scroll menu OR that Mootools gallery... Time to find a gallery like that using Jquery.
  11. Thanks, that's pretty much what I'm looking for (except them being submenu's). Only problem with that, is that it's not free. Can't find the code there, as the part that I need, is obfuscated.I found a free script for horizontal scrolling here, but I can't get it to work vertically instead of horizontally
  12. Hey,I need to make a menu where, if you go with your mouse to the top, the contents of the menu will scroll up, and if you move the mouse down, the contents will go down. I got code for it ready, but it doesn't play nice with doctypes, which means the entire rest of the site's messed up if I use it and make it work. With a proper doctype, the thing works in IE, but not in Firefox.My main question now is if anybody here knows of some script that does this and actually works without messing the entire site up.Thanks in advance,Kon-Tiki
  13. Hey,I've gotten pretty good at coding over the years, but it always takes some time. I know it'd go alot faster if I get some notions of software architecture, so I can make and adjust everything alot more efficiently. I've heard of the MVC model, but got no idea how to even begin writing it (unless I use stuff like Joomla or Drupal, which I'm not too fond of. Seen too many good coders struggle to get their site to work without stupid flaws coming from those frameworks). I got some database-management functions (like a function that takes a query as string and passes an object with data back), some input-handling functions (like one that cleans GET/POST-variables) and some layout functions (like for the headers/static banner part, and for the menu). That's as far as I am, and I think it might be good to use those. I just don't know where to look to learn how to do the architecture well, let alone how to use these bricks to make a house.Can anybody give me some pointers, please?Thanks in advance,Kon-Tiki
  • Create New...