Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. You would want to use sessions, not cookies. Otherwise it would be trivial to cheat it. Cookies are stored with the user, session data is stored on the server.
  2. How doesn't it work. You might want to show the code that comes before this as well.
  3. $theChartData = array_map('intval', $theChartData); When you split a string it'll still be a string. PHP can't possibly know that you want the string "60" to be an integer, so if you want it to know it you'll have to tell it.
  4. There is no one-to-one correspondence between a MySQL database and a set of HTML checkboxes. How you would want to store it depends on the nature of the data.
  5. It is actually called a T_DOUBLE_ARROW internally in PHP ("T" for token).
  6. Well, did you check that it exists? Where have you put the font file?
  7. In analytical geometry you see geometrical objects and elements as a set of points. In this case we are working in the euclidian plane which is the 2-space [imath]\mathbb{R}^2[/imath]. Thus all the points on the periphery of a circle is given this set: [math]\left\{ (x,y) \in \mathbb{R}^2 | \left(x-x_1\right)^2 + \left(y-y_1\right)^2 = r_1^2 \right\}[/math] for some constants [imath]x_1,y_1 \in \mathbb{R}[/imath] and [imath]r_1 \in \mathbb{R}_+[/imath]. So one [imath](x,y)[/imath] is in this case just one point on the periphery. The point [imath](x_1,y_1)[/imath] is a fixed point, the center of the circle. A point has no width, height or area, but seeing as there are infinitely many points in this set that are infinitely close to each other, you get a perfect line forming a circle. Consider for instance the circle given by [imath]x^2+y^2=1[/imath]. That's the unit circle, the circle with center in the origin and radius 1. If we have two more circles given by [imath](x-1)^2 + (y-1)^2=0.5^2[/imath] and [imath](x-1.25)^2 + (y-0.25)^2=0.25^2[/imath]. If we plot these (see attachment) and give them the colors red, green and blue then green and red intersect, but blue intersects with neither. If you want me to explain exactly why the equation for a circle looks like that, I can try to do so as well, but otherwise I'll just leave it; it's not so important for your particular problem. Essentially, you have two circles represented by: [imath]C_1(x_1,y_1)[/imath], [imath]r_1[/imath] and [imath]C_1(x_2,y_2)[/imath], [imath]r_2[/imath]. A [imath]C_n[/imath] represents the center of circle [imath]n[/imath] and similarly [imath]r_n[/imath] represents the radius of circle [imath]n[/imath]. Calculating the distance between two points in [imath]\mathbb{R}^2[/imath] is easy (it's easy even in [imath]\mathbb{R}^n[/imath] actually, but that's irrelevant in this case). The distance between [imath]C_1(x_1,y_1)[/imath] and [imath]C_1(x_2,y_2)[/imath], also denoted by [imath]|C_1C_2|[/imath], is given by: [math]|C_1C_2| = \sqrt{\left(x_2 - x_1\right)^2 + \left(y_2 - y_1\right)^2}[/math] Specifically for [imath]\mathbb{R}^2[/imath], you can verify that this is true using the Pythagorean theorem. If this distance is less than the sum of the radii then the circles must obviously intersect. If we take our red and green circles from before then the distance between their centers are: [math]d = \sqrt{\left(1-0\right)^2 + \left(1-0\right)^2} = \sqrt{2} \approx 1.414[/math] The sum of their radii is [imath]1+0.5=1.5[/imath] and seeing as [imath]1.414 < 1.5[/imath], the two circles intersect. This is of course easily seen by looking at the plot, but using this you can calculate whether or not two arbitrary circles intersect. This means that if you represent a person's area of influence as a circle (where the person is in the middle), you can calculate if another circle/person is influenced by a certain action. [attachment deleted by admin]
  8. Compiling PHP --without-pear just means that make install won't install PEAR. This is irrelevant when you're using a package manager.
  9. If you don't need a GUI, virtually any Linux distro should be able to run with those specs.
  10. It's the same thing. Really you could inject any HTML to an XSS vulnerable page, but injecting Javascript is the by far most common attack vector. Say for instance a login page was vulnerable. You could use XSS to harvest credentials by adding an onsubmit event to the form that submits the form data to an external script that logs it. You could also steal people's cookies unless they're set to HTTP only.
  11. Essentially XSS involves injecting arbitrary Javascript that can be executed on the client into a webpage. This allows you to make requests pretending to be the client.
  12. A quick search on Google gives this: http://cronw.sourceforge.net/ I've never tried it though.
  13. No, but then again, iptables doesn't work on Windows either. I was mostly talking about alternatives for the *nix people seeing as PeerBlock is only for Windows.
  14. PeerBlock would be easy to emulate using iptables and a cron job to update regularly.
  15. The right-most will override the others. Edit: That is for array_merge(). When using + it'll be like MrAdam said.
  16. I think there might be something you've fundamentally misunderstood. Advertisements are typically not used for decoration. In fact, many people find them really annoying, hence the reason why ad blockers exist. Having annoying elements on a web page is counter-productive when trying to attract new members to an otherwise entirely empty website.
  17. If I were to make a guess, I would say it's because it's never the case that both $req == '1' and $value == '' evaluate to true at the same time. Without proving more info, it's difficult making a better guess than that.
  18. I know this doesn't solve your problem, but why do you want to display ads if you have no users? I'll guarantee you won't get any profit.
  19. It's funny, I keep hearing things like that, but never in my life have I experienced an ISP here with dynamic IP address allocation if we disregard the dial up era.
  20. In this case, you can change eregi_replace('<br[[:space:]]*/?[[:space:]]*>', "\n", $messageText); to preg_replace('#<br\s*/?\s*>#', "\n", $messageText);
  21. And to illustrate the difference quite clearly: 1.1 + 1.1 + 1.1 + 1.1 + 1.1 = 5.5 ≈ 6 1.1 ≈ 1 1 + 1 + 1 + 1 + 1 = 5
  22. You might also want to read Migrating from PHP 5.2.x to PHP 5.3.x in the manual.
  23. Is that study available somewhere? Preferably with the chemistry gibberish.
  24. If you want advanced stuff, you have to move away from PHP book and buy books that deal with general programming stuff. Programming is not just "programming" though. There are many different things you might want to focus on. You could read about algorithms and make your stuff run fast. You could read about things like semantics and lambda calculus to get a better idea of what exactly a programming language is. Maybe things like computability would be interesting, i.e. what is it possible to compute, and can it be done within reasonable time (has a lot to do with algorithms as well). Maybe you would find concurrency and making things run in parallel interesting. Or you might be interested in how to make well designed applications, or how to manage programming projects. There are so many things to programming that it's difficult suggesting an "advanced" book. I might suggest Introduction to Algorithms, but if algorithms aren't really your thing, you might find The Pragmatic Programmer more interesting. Both books can be said to be related to programming, but they are very different books.
  25. Nothing is wrong with learning how to do it, but you shouldn't use other people's projects and budgets as a guinea pig. Also, you actually acknowledged that it was amateurish in your original post:
×
×
  • 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.