Jump to content

seandisanti

Members
  • Posts

    60
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://seandisanti.com

Profile Information

  • Gender
    Male
  • Location
    Las Vegas, Nv
  • Interests
    Learning and teaching, all things computer.

seandisanti's Achievements

Newbie

Newbie (1/5)

4

Reputation

  1. assuming this is for a homework assignment or something, what directions does it give you for implementation?
  2. Then it sounds like a permission issue, like your apache user may not have write access where you're trying to put the backup. Again I'd like to point out that regular maintenance tasks like backups are typically delegated to cron jobs or scheduled tasks, which would not typically require browser interaction,
  3. Another $.02 on the named values vs ?'s. If another person is ever going to look at your code (that includes "Future You" who invariably ends up refactoring your stuff just because he thinks he knows better), then it's typically best not to make assumptions about their contextual wherewithal no matter how intuitive your code seems while you're writing it.
  4. also don't add comments on same line as code except for comedic effect because it make the line grossly long and makes code tougher to read, but comments easier to miss (talking about what i did in example to be funny, nothing you did)
  5. a few things... 1) you're hardcoding 'right' as the div id for each pass through the loop, so using the same id for multiple div's. That's a bad idea, and can result in unpredictable behavior at best 2) Inline styling, even when automated, should be avoided. That goes exponentially for every duplicated style you're adding 3) reverse your single and double quote usage habits and you'll save yourself a ton of headaches. always use double quotes for parameter and attribute values in HTML, and use single quotes for php strings, and concatenate your variables in. That way you avoid using the literal string '$nickname' as the title for example. echo '<td><img src="./img/' . $element . '.png' height="20" width="20" title="' . $nickname . '"></td>'; //and seriously move that styling into a stylesheet or <style> block outside of your loop
  6. You've gotten 2 relatively easy to implement suggestions in this thread. It sounds like the 'help' you're looking for is someone to just do it for you
  7. Benanamen beat me to it. I would say to go with pdo http://php.net/pdo https://www.youtube.com/watch?v=dF8hoPj-1bc is a good quick video to help explain it. Once that's done, you should attack your issue in the opposite order. #2 first, and then #1. It will be easiest to code your login bypass if you're able to assume that the user is already logged in, and once that's done and you begin working on the login, you'll know when it's working because it'll send you through via the passthrough you will already know works.
  8. That is quick and dirty approach using a few easy to implement functions, I'm sure that a better approach exists, but it sounds like you're looking for a single use script
  9. This really wouldn't be a very tough script, assuming you're just looking to run it from command line against a code base. Read in a file into a string, explode the string on 'http://' and then step through the resulting array exploding on \" and the first element of THAT array will be the full url to have your way with.
  10. Ok, here's what I think I'm reading in your request... You have a list of messages on an admin page and you would like the ability to select some of them, and respond to them all at once from your chosen email client, is that correct? Before I try to answer that, there are a few things you should do either way. 1) use code tags [ code] and [ /code] (without spaces) around your code to make it easier to read 2) look into using PDO or mysqli_ instead of deprecated mysql extension. Assuming you take care of both of those, that still leaves your main problem. One way to kind of achieve that, would be to write an ajax call that returns a delimited list of email addresses based on the checked checkboxes which can be thrown into a 'mailto' link, and a new window opened with that link. Depending on how you have your system configured, specifically regarding default apps and behaviors, that could open a new mail message in outlook with the addresses already entered. I would consider that approach far less than optimal though as it's not guaranteed to work on every (or any) system you may use. A better approach I think would be to scrap the idea of opening it in a local client to compose the mail, and just write the response functionality yourself. You could do a simple message form in a jquery modal dialog, have the recipients populated based on checked checkboxes, then a text field to type your message in and a button each to send or cancel. Then have the server send the message either with a site email, or whatever email account you configure.
  11. That's a perfect moment to learn! Rather than copying the one that seems to be working, compare the two implementations to see what's different. It may add a little more time, but it will give you a better understanding of the output you're receiving and the functions that you're trying to use. If you can't spot the differences or make sense of it yourself, paste the snippets here (minus credentials of course) and there are plenty of people happy to help.
  12. The functions in your code are actually wordpress functions. https://developer.wordpress.org/reference/functions/get_option/ has a listing of the source for get_option if you want to see the other wordpress functions they call behind the scenes so you can repurpose them. There may very well be a wordpress function to do exactly what you're looking for, but finding it will take more than the minute or two I have free right now. I will research further if you're not able to find anything.
  13. That also helps avoid the situation where a user with a valid link tries to manipulate values in their link to find another pdf.
  14. You're closer than you think, but there is still some work to do. 1) mysql_ extension is officially deprecated and actually even removed from php 7. Switch to PDO or at the very least mysqli. 2) typically you want to pass a GET parameter of 'page' or something to that effect so you can set your $start with $_GET['page'] * $_GET['per_page'] ***edit*** removed quote that I didn't even reference
×
×
  • 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.