Jump to content

nankoweap

Members
  • Posts

    113
  • Joined

  • Last visited

Everything posted by nankoweap

  1. in a word, yes. exploits for other crypto functions are in the ether too. the mysql docs expressly mention not using the password function in your application. instead, consider using sha2 with a high bit length. all of this and more is covered here: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html Mr Hyde makes a good point too, though. your app is as secure as its weakest link. if you're passing passwords in clear text, then using the password function is overkill.
  2. the mvc pattern doesn't mandate a physical separation of the layers. when developing in php i choose to physically combine the controller and view and implement the model in a set of classes. for instance, a simple registration process might utilize the following physical files: register.php - this is the view/controller for the registration process. UserManager.php - this is a class that contains the implementation of all user-related functionality. it is used by all view/controllers as well as other manager objects that need access to user-related functionality. hope that helps. jason
  3. don't do that. i'm not sure exactly what you're attempting to accomplish in the end, but consider this... chain the calls... for instance, if class3 extends class2 extends class1 and the function you're overriding is someFunc, then class3's someFunc() implementation calls parent::someFunc(). likewise, class2's someFunc implementation calls parent::someFunc(). and lastly, class1's someFunc implementation does whatever it does.
  4. you're going to render the calendar each time a month is clicked. this gives you ample opportunity to customize the weekday links. something like: /* you should always get a month parameter. i'd take the time to default this to the current month, but I can't remember how to do that off the top of my head */ $month = 'January'; if (isset($_REQUEST['month']) { $month = $_REQUEST['month']; } ... /* now you can use $month to customize the day links: */ <a href="?month=<?= $month; ?>&day=Monday>Monday</a> <a href="?month=<?= $month; ?>&day=Tuesday>Tuesday</a>
  5. you could use the windows scheduler to run a php script at any interval. the script would scan whatever table(s) and send email when required.
  6. mysql_real_esape_string is spelled incorrectly. it's mysql_real_escape_string.
  7. i performed a cursory search of the site and didn't find anything. i'm wondering if the "other" timezones found here: http://us3.php.net/manual/en/timezones.others.php are mapped to their more up-to-date counterparts since all but UTC appear to be deprecated? thanks. jason
  8. if i understand what you're asking, there's no reason you can't. just use $_REQUEST (rather than $_GET) to access the form's variables. of course, you could change the method of the form to GET and just use $_GET or $_REQUEST.
  9. have you considered letting the database perform the calculations?
  10. it's important to note that if you're processing a form that has been defined with method="post", these values are only accessible via _POST and _REQUEST. jason
  11. yep. just re-read the man page for empty. sum-bitch. been coding redundancy into my first php app already. thanks for the info. gonna have to fix that in the next iteration.
  12. as ken2k7 noted, as long as you select the column $rows['murl'] will always be set. you need to know its value. try using is_null and empty. something like... if (is_null($row['murl']) || empty($row['murl'])) { ... } else { ... }
  13. dude... $year = date('Y'); $month = date('m'); $day = date('d'); edit... meant to post a link to the manual... http://www.php.net/manual/en/function.date.php
  14. it's normal. an ampersand is used to separate one parameter/value pair from another. i'm pretty sure you can encode the value, though, and allow it to pass through.
  15. i do something similar in my apps - only one that i've ported to php, though, but still the same idea. the first registration page asks the user for his/her email address. when they submit that form, a unique authorization code is generated, then stored in the database along with the email address and an expiration date as well as a is_used flag. then a message is emailed to the email address that allows them to continue the registration process which doesn't include the ability to update their email address. when the url is clicked, i validate the authorization code exists, hasn't been used and hasn't expired. if the validation succeeds, then i update the is_used flag and the registration process begins. jason
  16. i do the same thing in some pages... it's as simple as: $reminderDate = $_REQUEST['year'] . '-' . $_REQUEST['month'] . '-' . $_REQUEST['day']; and then using that value in your SQL. be sure to set the values of the month and day dropdowns to zero-padded values. for instance, january is 01, february is 02, etc.
  17. is your localhost's webserver up and running on port 80?
  18. or... <?php if (your condition) { ?> <table> ... <?php } ?> jason
  19. hmmm... i reckon that's possible. uuuuhhhhggg!
  20. given the code you posted, that colon doesn't matter cuz it's failing before that bit of code is parsed. can't have two else's. and something has to be done with that colon too unless that's some php code i'm not familiar with. jason
  21. hehe. i was assuming he was validating the update with a query from the command line or something.
  22. this may be a stupid question, but you connected to the database, right? why not pass that resource link in your query statement so there are no assumptions? what about the id column? how are you obtaining the appropriate ID value to update? what's the value returned from mysql_num_rows after the update is performed? jason
×
×
  • 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.