Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. Hmm, I dunno. Dreamweaver can do that for me, but it's shitty.
  2. Yup. There's no reason to do that. If the username/password is invalid, it fails - there's nothing else to sanitize.
  3. case insensitive (simple match) $haystack^=$needle (starts with) $haystack$=$needle (ends with) case sensitive (exact) $haystack^==$needle (starts with) $haystack$==$needle (ends with) No, I don't like that. That is just confusing given the syntax for identical comparison operators. And I think introducing another "variant" is just going to make operators unnecessarily complex. Operators are supposed to be simple. Now that is a great idea.
  4. A semi-colon isn't required in that case but I still put one there anyway. It's just habit I guess.
  5. There isn't case-sensitive and case-insensitive comparison operators of other types, so why would there be here?
  6. You images (??) have everything duplicated, so no! They are side-by-side representations of text vs no text....
  7. This is how it looks with the min-height: And without it: Is that what you wanted? <style type="text/css">dd { min-height:20px; }</style> <dl> <dt>Joined:</dt> <dd></dd> <dt>Location:</dt> <dd></dd> <dt>Posts:</dt> <dd></dd> </dl>
  8. Maybe use a minimum height for the dd's?
  9. Make sure to use the proper directory/file permissions and make sure to thoroughly check any user-submitted file uploads. Also, make sure to properly sanitize any user input when using a script that creates files based on user input.
  10. You have this bit in there right? RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f This will exclude files and directories that physically exist from being rewritten. Also, make sure you are using absolute paths to the CSS file including the domain name.
  11. In this case, mysql_error. EDIT: But instead of doing it that way, you might want to set a custom error handler and use trigger_error when the query fails. This way your handling code is in one spot and not spread 6 ways from sunday throughout your application.
  12. The field is named "cuts" and not "cut".
  13. You should take a screenshot of your everyday setup.
  14. Really?! You asked me the EXACT same question a month and a half ago and I provided you a link to the manual explaining that. http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing Okay, thanks again! I'm not buying the excuse that "I'm just learning so I can't be expected to remember everything" because you've been at this for years and if I can specifically remember that you had asked that and I had provided an answer out of the thousands of posts I have made, I think I should expect you to at least remember that you had asked a similar question and go find the answer yourself. I'm don't expect anyone to remember everything, but I expect them to understand enough that they can find the solution on their own the next time. How about "I never saw your response..." So you quoted it saying, "Okay, thanks again!"?
  15. This works for me: .htaccess Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^pretty/([0-9]+)$ pretty.php?id=$1 [L] pretty.php <?php echo $_GET['id']; http://example.com/pretty/54 Gives the output: 54
  16. I wasn't sure if you had to type out the defaults... Here's a hint: when an argument is in square brackets in the function definition it means that argument is optional, and the value shown in the manual is the default if you do not supply that argument. string number_format ( float $number [, int $decimals = 0 ] ) Therefore you only need to use the first parameter if you want to keep the defaults.
  17. Since calculate returns a value you have to echo it. <?php echo calculate($TotalSqFt, $price); ?>
  18. I really cannot fathom how the code you posted would generate 6 anchored list items, unless the entire snippet is in a loop. I guess you'll have to wait until someone replies who knows the dark arts.
  19. You can actually throw PHP variables right into the Javascript source. <?php $foo = 'bar'; ?> <script type="text/javascript"> alert("<?php echo $foo; ?>"); </script>
  20. Sorry, but this is not good advice. Neither of the second conditions should even be run if birthYear is empty. And the second two conditions can be run in one condition, there is no reason for two separate if statements here. In my opinion, this is better: if (!empty($trimmed['birthYear'])) { if ($trimmed['birthYear'] >= $oldestYear && $trimmed['birthYear'] <= $newestYear) { // ... } else { $errors['birthYear'] = 'Birth Year must be between ' . $oldestYear . ' and ' . $newestYear; } } else { $errors['birthYear'] = 'Please enter a birth year between x and y'; } Since you are using "birthYear" as the $errors index you can only have one error associated with that condition anyway. So you might as well save the overhead of unnecessarily running conditionals. These days I do NOT trust anything I write. I am in such awe and fear of Web Development and the Internet, and I have been so humbled here in how little I know sometimes, that I think I'd need to verify if I turned on the lights if they really were on!!! Sorry, but these final days of me testing my code and re-visiting old code and testing it, and looking for *security* issues, is really making realize how fricking complicated this stuff is, and has me freaked out to no end... And in most cases you are over-exaggerating the risk. You should be focusing on completing the task AND THEN profile it and unit test it and penetration test it and so forth.
  21. All that work for missing brackets... Oh, and as a side note: you don't need to (and shouldn't) run mysql_close(). PHP will automatically close the MySQL connection for you.
  22. Hah, yeah. When they roll out PHP7.0 there will be a lot of pissed off newbies.
  23. If it works then wouldn't it stand to reason that the logic is correct?
  24. Test it.
  25. You need to remove a "dealt" card from the array of available cards. Look at unset.
×
×
  • 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.