Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
E-Mail confirmation on Login System Registration?
Daniel0 replied to lopes_andre's topic in PHP Coding Help
Just generate a new one and send them the new password. Hashing algorithms are one-way so it's impossible to get the plaintext value without brute-force. -
Just tested. Seems like you're right. That's nice
-
Can you provide a link or perhaps better define how it "doesn't work"?
-
I don't like your color scheme. I think the yellow colors take too much focus so to speak.
-
Jeff, it looks really good. Much better and sleeker than the old one, in my opinion. I don't think that the nav buttons should have the hover effect when hovering over the button reflections. It seems more natural to me that the hover effect is only activated when you hover over the button itself. It might be slightly more complicated to code though.
-
Not what you need to? What do you mean? file_get_contents() is just a convenience function doing all the fopen(), fread() and fclose() in one function...
-
E-Mail confirmation on Login System Registration?
Daniel0 replied to lopes_andre's topic in PHP Coding Help
Not really that much related to MySQL specifically... To create a random string you can just do e.g. md5(microtime()); or you could write a function: function generateRandomString($length = 50) { $chars = array_merge(range('a', 'z'), range(0, 9)); $charsMax = count($chars); $string = null; for ($i = 0; $i < $length; $i++) { $string .= $chars[rand(0, $charsMax)]; } return $string; } Anyway, just create a two fields: is_activated (tinyint(1) default 0) and activation_code (char (length=whatever you want)) So put the activation code in the row and send the code to their email. Then they can verify using that and you can set is_activated to 1. When logging in you just need to check if is_activated=1. -
zend framework session: assign value without declaring key
Daniel0 replied to robb73's topic in Frameworks
Why would you try to do that in the first place? -
You can do window.status='foo'; but I hate websites that change the value of my status bar.
-
Try to give the content and nav divs 100% width and give content overflow:auto;.
-
Just use file_get_contents to read the data.
-
Maybe I'm stupid, but I've never seen the need for an enum.
-
Yes you can. That's no problem at all. Here is an excerpt from the HTML 4.01 Strict DTD: <!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON"> <!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;"> <!ELEMENT LABEL - - (%inline;)* -(LABEL) -- form field label text -->
-
It's this one: http://custom.simplemachines.org/mods/index.php?mod=1111
-
I find it easier to use aptitude. One command instead of multiple apt-* commands.
-
Take a hammer, hit yourself on your left index finger and wait three days. Now it'll work in all browsers.
-
What you are doing is /game/-football.htm to /game?name=football If you want the other you'll have to do RewriteRule /game/(.*) /game?name=$1
-
Do you understand what my function does and why it works? It copies the array so it has the original. Then it makes all items in the original array lowercase (so that there is no difference in case). Then I used asort() to sort the array, but still preserve the index associativity. Because all items have the same index it's just a matter of looking up the original string from the copy array and put it back in. You can use more or less the same technique for what you require with the descriptions assuming they are in the same order that the filename array originally was. So... something like this perhaps: <?php $descriptions = array(/* something */); $filenames = asorti($filenames); $descCopy = $descriptions; $descriptions = array(); foreach(array_keys($filenames) as $index) { $descriptions[$index] = $descCopy[$index]; } Now $descriptions should have the same key order as $filenames does.
-
You can use GD for that.
-
Consider this: Your name is Google. You serve millions of pages every day. Now imagine that you started to use the full URL instead of just the path on all links, images, etc. The size difference could easily amount of several terabytes per month. The unnoticeableness only applies to a single request taken out of context.
-
Strictly speaking, http://www.domain.com/images/logo.gif should take longer than /images/logo.gif because you're sending 21 more bytes. It's negligible though and by no means noticeable.
-
"NULL" is a string, NULL isn't. You need to check if it's empty and set it to "NULL" yourself.
-
Try this: <?php /** * Sorts an associative array case-insensitively * * @author Daniel Egeberg * @param array $array * @return array * @license Released to public domain */ function asorti(array $array) { $copy = $array; $array = array_map('strtolower', $array); asort($array); foreach ($array as $index => $value) { $array[$index] = $copy[$index]; } return $array; } ?> I didn't test it, but it should work.
-
Not if your workplace's/school's IT dept says otherwise.