Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. It helps to be as detailed as possible when describing the problem. You still don't need a switch statement, just an array. Use the array to populate the dropdown, then select that key from the array to send the email. IE: <?php $emails = array( 1=>array('name'=>'Boating', 'email'=>'boating@email.com'), 2=>array('name'=>'Camping', 'email'=>'camping@email.com') ); if(isset($_POST['send_to']) && isset($emails[$_POST['send_to']])){ $to_email = $emails[$_POST['send_to']]['email']; } echo '<select name="send_to">'; foreach($emails AS $id=>$info){ echo '<option value="'.$id.'">'.$info['name'].'</option>'; } echo '</select>';
  2. omg no just stop. You don't want to get everything from the database, you just want to get the results which match at least ONE word in the search string right?
  3. Explode the string by the spaces. Edit: Wait, you might just use strpos. Can you post some examples?
  4. Jessica

    PHP My Admin

  5. I like to use a templating system like Smarty, but for some reason you don't want to... So... You could use a HEREDOC to use one echo statement, and get the returned value of cutContent() before the echo's.
  6. Jessica

    PHP My Admin

    Start wampserver, you should see a green W in your start bar by the clock. If you see a RED W, right click it and start it. If you don't see any W go to your programs bar and find the Start Wampserver button. Once the W turns green, open your browser, go to localhost, and you'll see the wampserver dashboard with a link to phpMyAdmin and then your projects once you start them.
  7. Jessica

    PHP My Admin

    Cool. It comes with PHP MyAdmin so you should be set then.
  8. Jessica

    PHP My Admin

    Well you can't run PHP without a web server like apache.
  9. There's no need to use a case statement just a regular array.
  10. The easiest way would be to use implode. Look at the manual for mail, you can send a list of emails.
  11. So, you either need to go study some basic PHP tutorials, or hire someone. Because no. Changing the name of the variable will not make mail accept an array. I gave you the options you have.
  12. *what* error? Is that your actual code? You're missing a quote. Look at the colors in the syntax highlighting. However, the mail function does not accept an array for the $to param. You will either need to loop through the array, implode the array, or use something more advanced like PHP Mailer.
  13. I've never seen a job posting that asked for "evidence", but one can only assume they want to see a portfolio. It's harder to show your work as a developer vs a designer, so you chould include A. screenshots of previous work for other clients, and B. working examples they can visit, and/or even C. actual code.
  14. It sounds like your font simply doesn't have those characters. You'll want to pick a simple font, probably a system one.
  15. Good point. The fact that changing that "fixed" the problem makes me much more sure he has the same '$password' issue in other places, otherwise he should have not been logged in at this point.
  16. Exactly. That's my point. If he's going to (subtly) complain that he doesn't know enough to fix it, I'm explaining how to get better and learn. If you're randomly throwing things at the keyboard your code won't work. There should be a reason for everything you do. It also was a very sincere question about WHY people do this, because it's a newbie thing to do that I just plain don't understand. Literally several times a week someone posts on here and at least part of their problem is a variable in a literal string. For a few weeks I had a rant about it in my signature, it's so prevalent. I want to know *what* site, book, tutorial, etc, is leading people to believe they should a. put variables in strings when they have no other text to add, and b. use single quoted strings for variables. So I can hunt it down and squish it.
  17. How would we know? Besides the fact that single quotes strings are not parsed. You need a username.
  18. Uhm, the problem has NOTHING to do with sessions. You're comparing every password in your DB to '$password'. Which, if your registration code has the same problem... anyone can login with any password. My question was a sincere one. Why did you put a variable inside a string, for no apparent reason? think critically about everything you do. If you can't explain what every single character is for, learn what it does and you'll become better.
  19. http://php.net/manual/en/pdostatement.fetchcolumn.php Read that.
  20. md5('$password'); is the hash of the LITERAL STRING '$password'. Not the value contained in $password. I don't get why this has to be said a dozen times a week. Who is teaching put everything in a string anyway?
  21. As to why it wasn't in there before, probably because STRICT doesn't contain actual errors or warnings about current problems, but messages about standards and possible future problems. "Enable to have PHP suggest changes to your code which will ensure the best interoperability and forward compatibility of your code." I don't see why it would cause the end of the script at that point though.
  22. Jessica

    PHP My Admin

    The actual type of computer doesn't matter. Do you have a server running, like WAMP?
×
×
  • 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.