Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
if (stripos($subject, 'urgent') !== false)) { $fp = fopen('/etc/hosts.deny', 'a'); fwrite($fp, "ALL: {$_SERVER['REMOTE_ADDR']}\n"); fclose($fp); die("No it's not. Bye."); }
-
The small text kind of gives it a 90s feel. It's not totally bad, but it's just not anything special. You should change the link typography for the :hover and :active pseudo-classes though. It's a bit annoying that they don't.
-
Isn't that what allenskd suggested?
-
It would be better to pass the variable by argument instead of making it a global.
-
I don't hope you intend to keep it like that. You just allowed me to read a series of sensitive files on your server. Well, literally any file that the web server has access to.
-
It works in PHP 5.3. Edit: The static calling with a variable as class name (to prevent ambiguity).
-
How doesn't it work? The universe implodes, or...?
-
You could do like: if (count(array_insersect($arr1, $arr2))) { // they share at least one element } else { // they don't }
-
Or alternately, if ($variable[0] == 'M') { // do something } Strings can be accessed like an array.
-
OP, see: http://php.net/manual/en/language.pseudo-types.php#language.types.callback Objects are passed by reference by default.
-
No, it is not the same. If you're looking to count the number of rows, without using those rows you should use MySQL's COUNT() function. There is a difference in the amount of work MySQL has to do.
-
You should start with normalizing the database though... http://en.wikipedia.org/wiki/Database_normalization
-
One utility for doing these kind of things would be limiting download speed. Say you want to limit download speed based on which group a user is in (assuming you have some sort of grouped membership system). You can use a combination of fread(), sleep() and flush() to make sure you only send out x byte per second. If you put for ($i = 0; $i < 10; ++$i) { echo 'hi<br>'; flush(); sleep(2); } in a file you should see the string 'hi' popping up sequentially with a 2 second interval.
-
When someone sends me an angry PM after having moderated them, I sometimes like to use that one. Anyway, where do you see them?
-
Especially not on an unencrypted FTP connection...
-
If you want precise information about each download you will have to insert a new row into the database each time someone downloads it. Yes, it'll grow with time, but that's the price you will have to pay for detailed logs. Alternately you can just read your web server's access logs.
-
Seriously, what do you mean with "it doesn't work"? It can mean hundreds of things.
-
Okay, so here is something you might want to take a look at: http://www.alistapart.com/articles/multicolumnlists
-
As I said (or rather implied), it's not just plug and play. That's not how programming works. <style type="text/css"> ul { width: 200px; } li { width: 50%; float: left; } </style> <ul> <?php for ($i = 0; $i < 100; ++$i) echo '<li>Test ' . $i . '</li>'; ?> </ul> See screenshot for output. [attachment deleted by admin]
-
Tables are not the tool for this task. Now what if you want it in 3 columns instead? Then you'll have to go back to edit your PHP source files. Again, the frontend presentational layer is CSS. Separation of concerns is a very important aspect in computer science (thus also programming and web development). It has several benefits in web development. I won't bother going over it in this topic though.
-
This is more of a CSS issue really. Output them all in a single list, then add a style sort of like this: #theList li { float: left; width: 50%; } If the container has a fixed width you can also just take half of that for the li width. Do note that things like border, padding and margin is part of the total width according to the box model, so you will have adjust for that. When outputting HTML you should never be thinking presentation, but semantics. Presentation is something CSS is responsible for. HTML was never meant to convey any presentational information.
-
I'm not too keen on the Times New Roman on the splash page. Maybe instead try Georgia and then decrease the font size. On the main body text I find that the color makes it slightly more difficult to read. I don't think there is enough contrast so you kind of have to strain your eyes a bit more. Maybe that's just me though. I would try with a hue slightly more towards pure white. The login fields could use a couple of more top and left padding. Just a couple of pixels. The gap between the top/left border and the text is larger than the gap between the bottom/right border. That is on Firefox 3.5 using Vista. The "View All News" and the headers in the main body text have virtually the same typography, but only one of them are actually links. I would suggest underlining the links to make a visual distinction. If you click on "Registration" you'll see that the background for the "Latest News" header in the sidebar is off as well. Finally, to make browsing the site easier I would suggest making the logo a link to the front page (not the splash page). That is of course assuming there is an actual index page. If there isn't I think there should be one. It's sort of a convention to have a front page and I think people would try to look for it.
-
Bloody foreigners, always doing it cheaper than I can afford to. This is why our industry is so under-valued, it makes me sick. Last I checked, you're in England while CV and The White House are in the US