
nankoweap
Members-
Posts
113 -
Joined
-
Last visited
Everything posted by nankoweap
-
no need for an API key when using V3.
-
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.
-
I need one more advise of a good coding practice for Page Controler
nankoweap replied to simplyi's topic in PHP Coding Help
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 -
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.
-
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>
-
[SOLVED] How to create a function to protect database.
nankoweap replied to redarrow's topic in PHP Coding Help
what errors are you getting? -
Run PHP Script at Certain Time on Windows Server Via Database
nankoweap replied to mfgoalie's topic in PHP Coding Help
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. -
[SOLVED] How to create a function to protect database.
nankoweap replied to redarrow's topic in PHP Coding Help
mysql_real_esape_string is spelled incorrectly. it's mysql_real_escape_string. -
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
-
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.
-
have you considered letting the database perform the calculations?
-
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
-
[SOLVED] if else...the bain of my existance! Grrr....hehe
nankoweap replied to NoDoze's topic in PHP Coding Help
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. -
[SOLVED] if else...the bain of my existance! Grrr....hehe
nankoweap replied to NoDoze's topic in PHP Coding Help
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 { ... } -
[SOLVED] Using current month as variable?
nankoweap replied to Skipjackrick's topic in PHP Coding Help
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 -
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.
-
[SOLVED] registration, sending a validation mail
nankoweap replied to Yeodan's topic in PHP Coding Help
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 -
PHP concatination with year month day and MYSQL
nankoweap replied to austin6118's topic in PHP Coding Help
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. -
is your localhost's webserver up and running on port 80?
-
or... <?php if (your condition) { ?> <table> ... <?php } ?> jason
-
hmmm... i reckon that's possible. uuuuhhhhggg!
-
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
-
hehe. i was assuming he was validating the update with a query from the command line or something.
-
and the problem was?
-
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