Jump to content

Strider64

Members
  • Content Count

    271
  • Joined

  • Last visited

  • Days Won

    1

Strider64 last won the day on April 28 2014

Strider64 had the most liked content!

Community Reputation

15 Neutral

About Strider64

  • Rank
    Advanced Member
  • Birthday 08/28/1964

Contact Methods

  • Website URL
    http://www.pepster.com

Profile Information

  • Gender
    Male
  • Location
    A burb of Detroit, MI

Recent Profile Visitors

5,457 profile views
  1. Throw that in file 13 and look for a safe secure login using PDO (My Suggestion) or mysqli. I did a Google search and found this https://levelup.gitconnected.com/how-to-build-a-secure-login-page-in-php-954f51d08701 and I am sure there are many others out there.
  2. Checkout https://www.php.net/manual/en/datetime.format.php it should get you on the right track.
  3. This can also be achieved by simply using HTML and CSS. I have done it plenty of times and you don't even need javascript though using javascript you could give some flare to it.
  4. What's the purpose of having a form if there's no submit button?
  5. Another nice 3rd Party email is Swiftmailer Swiftmailer I personally found it easier to setup though PHPMailer is just a good.
  6. Well, when the user first visit a website the token is generated and stored in sessions then when he/she submits his information in a form the token is sent along with the info. That way it has to be her/him that enter the data from that browser and the only way it can theoretically happen to be another user would be that user would have to use the same browser on that computer. For more info check out -> https://owasp.org/www-community/attacks/csrf
  7. You're still trying to paddle upstream without a paddle. My suggestion would to be look at a CURRENT tutorial on adding, updating, and deleting data to a database table. I would also suggest PDO instead of mysqli as I feel it's more robust, but that is a personal preference. I like this PDO tutorial as they do a nice job explaining how PDO works : https://phpdelusions.net/pdo
  8. I probably should had explain better. I would just take a range of dates (for example of week in an array) and loop through the dates. Unless it's important to save the data (which I personally don't there would be) then just store that data in another database table.
  9. If I was tackling the problem I would do something like this: $stmt = static::pdo()->prepare("SELECT count(user_id) FROM users WHERE joined_date = ?"); $stmt->execute(['joined_date']); $result = $stmt->fetchColumn(); return $result; then I would either cycle through the database table with some kind of loop or set up a daily maintenance routine where I store the results. Of course you can do averages or what have you as it's just simple math in either case. The first option is what I would do as I wouldn't have to go about storing and settin
  10. I find sending NON-HTML emails have a better chance of getting through spam filters than HTML emails. Sure they don't look as flashy, but it's the content that matters. 😉
  11. I personally would make the flow a little easier to follow: here's my example: /* * Database Connection * I would have the PDO database connection in a separate file (Something like inc.pdoConnect.php) * and then call it something like require_once "includes/inc.pdoConnect.php"; */ $db_options = [ /* important! use actual prepared statements (default: emulate prepared statements) */ PDO::ATTR_EMULATE_PREPARES => false /* throw exceptions on errors (default: stay silent) */ , PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION /* fetch associative arrays (default:
  12. Make sure you have error reporting on - ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); If that isn't working then your local server isn't set up right. To test if you local server is working properly create a php info file. <?php // Show all information, defaults to INFO_ALL phpinfo();
  13. I use SwiftMailer, but I don't bother to send the email and going through all the hassle of sending the email until I verify the user with Google's recaptcha. /* The Following to get response back from Google recaptcha */ $url = "https://www.google.com/recaptcha/api/siteverify"; $remoteServer = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_SANITIZE_URL); $response = file_get_contents($url . "?secret=" . PRIVATE_KEY . "&response=" . \htmlspecialchars($_POST['g-recaptcha-response']) . "&remoteip=" . $remoteServer); $reca
  14. Personally I would just populate the table and if you want people to edit the comments use a HTML anchor tag: You can then either redirect the edit to another HTML page and/or use some form of Javascript/Ajax on the anchor tag. That's what I did with my small blog that I wrote for my website: <?php foreach ($journal as $cms) { ?> <div class="article"> <h2><?= $cms->heading; ?> <span class="subheading">by <?= $cms->author ?> on <?= $cms->date_added ?></span></h2> <
  15. I personally switched back to vanilla javascript as it really isn't all that much harder to write and it doesn't use a library. Nothing wrong in with jQuery, but I was always wondering about the javascript equivalent when it came to certain coding. Now I don't have to wonder. I do say people who are just learning javascript should learn vanilla javascript before tackling jQuery as it will make life much simpler if you ever need just to use vanilla javascript. That was my problem as I really didn't learn vanilla js before I tackled jQuery.
×
×
  • 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.