Jump to content

LemonInflux

Members
  • Posts

    944
  • Joined

  • Last visited

    Never

Everything posted by LemonInflux

  1. I'd also like to point out that, because you're not completely reloading the page, AJAX does cut down on bandwidth, both for the server and the user, by a fraction. JavaScript and AJAX are also very useful for making things flow more easily. Think of Google Maps. Can you imagine how tedious that would be if every time you moved the map with your mouse, you had to reload the page? EDIT: On the disabled thing, I have firefox, but I also use NoScripts. NoScripts, by default, disables javaScript for several security/general reasons. It's always very annoying for me when I have to go to 'temporarily allow' just because someone couldn't be bothered to design their site in a compatible way.
  2. Just a quick question - is this my version, or is it the same for everyone? class whatever { public $var; } Not the best of examples, but PHPDoc won't recognise the var. If it was var $var it would, but public $var, or private $var, or protected $var, etc. doesn't work. Does anyone know why?
  3. ..You mean a straight forward include() would work?
  4. Hold on, I've just realised that the 0-9 range isn't needed. So.. [pre]/\A[a-z]\.[a-z]\z/i[/pre] Is that right? \d is digits? ---------------- Now playing: Guns N' Roses - Welcome To The Jungle via FoxyTunes
  5. It's a path, but with dot notation. For example: If 'topFolder.bottomFile' is matched, it will go to topFolder/bottomFile.php. I can work out the .php bit, and the / bit, but it's the validation I'm struggling with :S ---------------- Now playing: Get Cape. Wear Cape. Fly - Could've Seen It All via FoxyTunes
  6. Oooh hang on, I see, it wouldn't be needed because there's nowhere they could go? ---------------- Now playing: Get Cape. Wear Cape. Fly - Could've Seen It All via FoxyTunes
  7. No underscores, just words. However, these will be in camel case if more than one word is needed, so would I need: [pre]/\A[A-Za-z\d]\.[A-Za-z\d]\z/i[/pre] And how would I add the %\.\./% in? ---------------- Now playing: Get Cape. Wear Cape. Fly - Better Things via FoxyTunes
  8. Although that still doesn't solve the problem that it also has to match word.word. How would I incorporate that into it? ---------------- Now playing: Get Cape. Wear Cape. Fly - Keep Singing Out via FoxyTunes
  9. Just to clarify, it would be if(preg_match('%\.\./%', $string) { /* Do action if unsafe */ } else { /* Action if safe */ } ? ---------------- Now playing: Get Cape. Wear Cape. Fly - The Children Are (The Consumers Of) The Future via FoxyTunes
  10. What they mean is, the first value of $array is $array[0], the second is $array[1] etc. etc. Basically, the first is 0, not 1 ---------------- Now playing: Dance Gavin Dance - The Backwards Pumpkin Song via FoxyTunes
  11. As said above, you'd need $child = new c_child; and call from that.
  12. Awesome, thanks That solves the problem anyway topic solved
  13. Using multiple files can be useful if you want a quick, efficient way of editing code (say, if you have a database file, an authorization file and an error file, you can make changes to each section without having to look through a long code). But really, using multiple files is for organization. If that's not important, make it all one file.
  14. For a start, you should really (if possible) be using a full url, for example 'http://www.mysite.com/ManagePhotos.php'. However, you might find the problem is you didn't have a space between : and M. Try this: header("Location: ManagePhotos.php"); Also, please don't use text language. I find it annoying (as do many others), and I'm sure many other people would really appreciate it if you spoke proper English (especially seeing as people who aren't native to English will struggle to read text language).
  15. <?php class parent { var $child; function parent() { $this->child = new child; } } class child extends parent { var $var; } ?> Normally, I'd call parent->child->var to get the child var. However, I want to be able to include a file, in which I can use $this->var to call the var. I don't mean include a file containing the class, I mean include a separate file that can be treated as if it is in the child. Is there a way to do this? I'm sorry if this is badly explained, but I can't think of a clear way to do this. I think the zend framework uses something like this, because you set things as $this->view->var and retrieve them in the view as $this->var. But I couldn't work out how they did it Any help is appreciated. Thanks in advance, Tom
  16. I'm in a situation where I get the user's desired page via a $_GET variable. The only problem is that, of course, this means that they could quite easily use directory traversal to view pages they shouldn't be able to. What I want is to check that the user's page doesn't contain anything but letters/numbers and a '.' in the middle, e.g. folder.file, but not folder.../file I've been looking at various sites, and I came to ([A-Za-z0-9-]+)\.([A-Za-z0-9-]+) Is this ok? Also, is there any way of shortening it? I know you can use \w to match words, but these don't contain numbers right? Thanks in advance ---------------- Now playing: Dance Gavin Dance - It's Safe to Say You Dig the Backseat via FoxyTunes
  17. Student from the UK, doing Unit 2 on the atain course? Haha, great fun (not).
  18. 2 quick questions for this one - 1. Does mkdir() need a full file path, or can I just use the relative path? 2. What would you say is the best CHMOD value for an upload directory that holds any file, and can be accessed by all users? ---------------- Now playing: Augustana - Sweet and Low (Alternate Version) via FoxyTunes
  19. Ok, so you're saying it's nothing to worry about?
  20. Where/how would I do this?
  21. I've been doing a project in my localhost for quite a while. By default, one of its functions is to log the IPs of any visitors. Of course, this has been 127.0.0.1 every time, as I am the only visitor. However, when I checked this morning, I got this IP logged: 192.168.1.45 Using who.is, I traced it back to iana.org. Their website says it's perfectly normal to see traffic from their site, and it doesn't mean I'm under any threat. However, they managed to get into my localhost (using XAMPP btw). Does this mean anyone could? Or is this nothing to worry about? Thanks.
  22. For a start, don't solely rely on the user having AJAX-supporting browsers. By default, my javascript is turned off (noScripts), and it's always quite annoying to visit a site that messes up because it relies on javascript. ---------------- Now playing: Enter Shikari - Today Won't Go Down In History via FoxyTunes
  23. Hello. I'm doing a project where I have a table like this: ID | IP | VISITS ------------------ 1 | 127.0.0.1 | 2 2 | 127.0.0.1 | 3 Basically what happens is when a user views a page, the code looks in another table to see if the page has an ID (if it doesn't, it creates a new row to assign said page an ID). Then in this table, a new row is added containing the page id, the user IP, and the number of times the IP visits that page ID (of course, this will be updated by the script). Now what I want to do is work out how many unique visitors have gone on my site. To do this I'll need to select every row that doesn't contain the same IP as a row selected before. How is this done? Thanks ---------------- Now playing: Enter Shikari - Today Won't Go Down In History via FoxyTunes
  24. ---------------- Now playing: Enter Shikari - Mothership via FoxyTunes
×
×
  • 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.