Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


maxxd last won the day on June 7

maxxd had the most liked content!

Community Reputation

67 Excellent

About maxxd

  • Rank
    Prolific Member

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling
  • Location
    North Carolina

Recent Profile Visitors

12,812 profile views
  1. It looks like your validation script makes zero sense, but it's hard to tell without braces and/or correct indentation. But it certainly looks like the first thing you do is attempt to assign $_POST['account'] to $acct_subject if and only if $_POST['account'] is empty.
  2. Your while() criteria is incorrect and unnecessary. I haven't tested this code, but give it a shot: $acceptedStates = [ 'Feasibility', 'Measure Up', 'Model Drawing', 'Concept Design', 'Developed Design', 'Resource Consent', 'Construction Documentation', ]; $xml = simplexml_load_string($response); $xml = usort($xml, function($a, $b){ return $a['job_due'] <=> $b['job_due']; }); foreach($xml->Jobs->Job as $item) { if(!in_array((string)$item->State, $acceptedStates)){ continue; } $projects[] = [ 'job_no' => (string)$item->ID, 'job_name' => (string)$item->Name, 'job_due' => date('d/m/Y', strtotime($item->DueDate)), 'job_status' => (string)$item->State, 'job_staff' => (string)$item->Assigned->Staff->Name, ]; }
  3. All that having been said, if you're using $_POST input in a WordPress environment (which obviously I know you are), use some kind of safety features. I'd recommend at least using a WordPress nonce in the form output and data validation routines, and use the wpdb::prepare() method on the query. It's not a prepared statement exactly, but it is a little more responsible than just blindly trusting user-submitted data, especially if you're expanding your user base as you said you were in one of the other threads.
  4. Either of these functions will do what you want, and without you having to recreate the wheel.
  5. Don't let my bad mood scare you off - most people around here are very helpful and nice. Having said that, one of the things that's going to help you learn how to code is to try things. The code you've already seen in this thread uses class-based selectors and dynamic ID and class assignment. So, if you extrapolate the two, you can use the dynamic class/ID assignment you've seen with the appropriate selector method. If you try it and it doesn't work out, then post the code you've tried and we can help you figure out why it didn't work; the important part is to show the work you've done.
  6. It's not. Here. Yes. Here. Admittedly, I'm asking you to think a little when it comes to some of it, but ... really? Beyond that, Barand has been his typical self and gone above and beyond the call of duty to answer your questions in no uncertain terms and with concrete code examples; yet there are more requests to simply do it for you.
  7. I would use grid. Using the data-pos="n" attribute selector in CSS and JS you change the color as you want. You could also just use the IDs in the linked fiddle if that's easier. You could also use the nth-of-type() selector in CSS to cut down on the typing if you want.
  8. Give them different attributes as you create them. What does your code look like so far?
  9. Use get_home_path(). require_once(get_home_path().'wp-admin/includes/class-walker-nav-menu-edit.php');
  10. Try esc_attr() or get_post_field('post_title', $post, 'display')
  11. It looks like you should urlencode($subterms->name). What CMS are you using - knowing this might help you get more specific information about your problem.
  12. There is a way to do both these things. Reading the manual is a great place to start.
  13. This is not how you do a prepared statement. You're still injecting the variable directly into the SQL string. Check the manual for the proper way to use prepare() (note that the link is for PDO, but the concept is the same for mysqli.
  14. There's a part of me that thinks they're developing future PHP specifically to make the kids think they're programming in JavaScript... I mean, I actually really like fat arrow functions in JS, but every time I see an example of it in PHP I have to pause a second and readjust my brain.
  • 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.