Jump to content

maxxd

Gurus
  • Posts

    1,718
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by maxxd

  1. There are a lot of possible places this is going wrong - from putting the code in the wrong file to never queuing it in your WordPress theme to never actually outputting the built strings. Are you using a theme you bought/downloaded, are you creating a theme yourself, where is the listed code found (what files, where are they located, etc.), what relevant code is in the functions file, and so on. Giving us a fuller picture might help point someone in the right direction to help.
  2. From the Codex: wp_get_attachment_image_src(). $returnValue[1] = width, [2] = height.
  3. Typically WYSIWYG editors like TinyMCE are JavaScript, not php. I'd check to make sure that you've got the JS set up correctly to initialize and display the editor on the form.
  4. You are correct, sir.
  5. OK - there's a couple things I see right off the bat. First, your form doesn't have fields named 'name' or 'id', so those aren't getting passed via $_POST. You're checking $_GET['id'], then assigning $_REQUEST['id'] to $id, then overwriting that value with an apparently non-existent value: $_POST['name']. Where you've got the output checks for $_GET['id'] right before your form, add the following: print(empty($id) ? "\$id is empty or null" : "This is \$id: {$id}"); and that should output '$id is empty or null'. You're submitting the form to the same page via $_POST. Because you've specifically given the form an 'action' parameter, that means any $_GET variables aren't being carried over - check the location bar before and after you hit the submit button. You'll need to create a hidden input field and assign the value of 'id' to that field. Right after your opening form tag, insert this: <input type='hidden' name='id' value='<?= htmlentities($_GET['id']); ?>' /> Assuming that there's a value in $_GET['id'], when you submit the form from that page, you can access the value using $id = $_POST['id']; Now, if you omit the 'action' parameter of the form, it'll post to itself by default - the interesting thing here is that it means the URL will still be intact including your $_GET variables. So, if you remove the "action='createworkorder.php'" parameter from your opening form tag, things should work as expected right up until the point where you overwrite the value with $_POST['name'], which (as stated above) doesn't actually exist.
  6. I think I see what you're saying now. *I think*. So, you're saying the initial two blocks of code in your original post are on the page with the form output, and the third block of code is on the processing page (the value of the form action property), correct? My question is, where in the script are $date, $installer, $salesman, $category, and $status set and how? Are the values passed from the form via _POST or _GET? The id value should be in there, assuming it's in the form somewhere (this is usually done with a hidden field in the form itself or pulled directly from a session variable). Perhaps it would help if you posted a bit more code, like the form itself and the code before the "if($valid){" line.
  7. You're mixing and matching SQL approaches. Replace this bit: $sql = "INSERT INTO workorder (name, date, installer, salesman, category, status) values('$id', ?, ?, ?, ?, ?);"; $q = $pdo->prepare($sql); $q->execute(array($date,$installer,$salesman,$category,$status)); with this: $sql = "INSERT INTO workorder (name, date, installer, salesman, category, status) values(?, ?, ?, ?, ?, ?);"; $q = $pdo->prepare($sql); $q->execute(array($id,$date,$installer,$salesman,$category,$status)); And it should work. As an aside, why are you checking the id value in _GET and then assigning it from _REQUEST? If somehow there's an 'id' index in both _GET and _POST, one of them is going to overwrite the other. If the value is set in _GET, pull it from _GET.
  8. You can shorten it a bit like so: <?php if( is_single() || is_home() || is_page() ): ?> <div class='container'></div> <?php endif; ?> Or you can just put the div in the template pages controlling those particular pages. I think (off the top of my head, so check the template hierarchy on the WordPress site), you'd be looking at index.php for the blog (home) page, single.php or page.php for the other two. I haven't had my second cup of coffee yet and just logged on at work, so I may be mistaken about which files you'll need to target.
  9. If you Google 'javascript password strength meter' you'll find several things already in development. I've not used any of them, but this one looks like it could work well...
  10. This is untested, but should work: $parms = array( array( ':id', $idnr, PDO::PARAM_INT ), array( ':name', $name1, PDO::PARAM_STR ) ); Of course, whether it's actually shorter or not is up for debate....
  11. maxxd

    footer placer

    I use this or this technique depending. Typically I've used Ryan Fait's in the past, but I just found the second and haven't tested it as thoroughly - where I have tested it, though, it's worked wonderfully.
  12. Well that doesn't help anybody... Does it override error_reporting(-1), though? Because I'm fairly certain the code above should be throwing some errors - if nothing else than for trying to grab values from the apparently undefined $data array. It's been forever since I built development Ubuntu server and I can't remember if I had to modify the php.ini for error display.
  13. Honestly, I can't see how this is working even on your local host. You're using mysql_real_escape_string() with mysqli() functions, which I'm pretty sure won't work. Admittedly, I could be wrong about that, but you really should be using prepared statements and avoiding the issue entirely. You're already halfway there by using mysqli() instead of mysql(), so why not go the extra step and save yourself work in the long run? Also, you're trying to pull array values from $date which isn't defined in the code you posted. You just try to grab a value from it on line 19. In addition, it's a bit misleading to call a variable $date when it includes student id and last login date - this obviously won't stop your script from running, but it will make life harder when you inevitably revisit the code later on. Maybe $student_login_info would be a better name for the array? Finally, do you have error reporting and display turned on, and what are the specs of the two servers?
  14. http://php.net/ChangeLog-5.php#5.6.0 Also this: http://us1.php.net/migration56
  15. OK - Looks the the SECURE constant is undefined. What's the purpose of it - I don't see where you've used it anywhere else in the code.
  16. You stated this in reply #7: Then the next age thatdisplays calls the login_check function which is shown below and at the point the session variables have no values. I'm assuming a bit of a typo on 'the next age thatdisplays' that was meant to read 'the next page that displays'. If you're redirecting, are you restarting the session on the target page with session_start()? If not, usually php will throw an error, but if your error reporting is off you'll never know that. Insert the lines jazzman1 suggests on the page to which you redirect and see if it give you an error about undefined variable $_SESSION. If so, start the session again and let us know what happens.
×
×
  • 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.