Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. You're not using the same variable that you defined. $fnameField = $_POST['fname']; $lnameField = $_POST['lname']; $emailField = $_POST['email']; $body = <<<EOD <br><hr><br> First Name: $fname <br> Last Name: $lname <br> Email: $email <br> EOD;You should be developing with error reporting on, and you would have seen something like this. Put this at the top of your script before anything else:ini_set('display_errors', 1); error_reporting(-1);
  2. To add initials in multiple places you just need to select more elements. var el = document.getElementById('initials');This is selecting an element with an id of "initials". In my example, we have <div id="initials"></div>, so this is the element that will be selected. So you can either create more elements with different ID's, and use multiple document.getElementById() calls, or, you can use a different selector such as a class selector. In that case you would just have multiple elements with the same class, and your initials would be added to each one. Here's an example of that: http://jsfiddle.net/22p32vj2/1/
  3. Probably a file permission issue. Turn error reporting on at the top of your script, before anything else. ini_set('display_errors', 1); error_reporting(-1);
  4. What is DB_Connect?
  5. I've heard MAMP is good, to get your environment going. As for a text editor, in order to "correct" the syntax it will need intellisense. Usually simple text editors don't have that, and you'd need an IDE. Personally I use PHPStorm and recommend it over anything else, but it does have a cost associated (well worth it in my opinion). Usually they don't actually correct the syntax, but will generally let you know if there is a problem (trying to use an undefined variable/function/class/method, syntactical errors like missing $, semicolon, brackets, etc, incorrect arguments for functions, stuff like that).
  6. Why do you want to add the page title as the image alt? The alt is supposed to be a textual representation of the image in case it fails to load. You said you just copied code from some other part of the system that worked and tried it here. That's not necessarily going to work. Is $ds defined in this context? Does it contain the right data? What is not working? Are you getting errors?
  7. I don't know what you mean by "trigger a session var". There's nothing special about a session variable, it's just an associative array like any other. $_SESSION['user_id'] = $someUserId; $_SESSION['logged_in'] = true;
  8. Eh. I'd go the other way, change your $link_id to be $mysqli. That's more standard and you'd immediately know by looking at the code that $mysqli is probably a MYSQLI object.
  9. There's no problem, but make sure you pass true as the first argument so that the previous session gets removed immediately. session_regenerate_id(true);
  10. Well, you could put an ORDER clause on your query. That way your results would already be ordered from least time -> most time, or vice versa. SELECT ... ORDER BY rider_time
  11. Javascript can't save files to your computer - that would be a huge security concern. But it seems there are some ways to simulate such an effect using iframes. I stumbled upon this jQuery plugin: http://johnculviner.com/jquery-file-download-plugin-for-ajax-like-feature-rich-file-downloads/ Demo here: http://jqueryfiledownload.apphb.com/ Seems to be pretty neat.
  12. I'm not sure what you mean by "not accessible". Using sometihng like Chrome Developer Tools is going to be the best way. I've attached a screenshot of what an error looks like in the console. I purposefully tried to reference a variable that didn't exist, which creates an error. With a real error, it would show the file and line number on the right hand side, and if you click it it takes you right to that file and line. Also, you're not using the correct tags to post your code here in the forum. If you're using the WYSIWYG editor (the default), just click the little <> icon and then add your code. Otherwise, you need to use square brackets instead of angle brackets. code here
  13. There's no reference of Topic::getByCategory() in the file you posted.
  14. So on line 15 of "C:\xampp\htdocs\talkingspace\topics.php", you're trying to call a method that doesn't exist. Either you didn't include the class file, you have a typo, or something else. Since you didn't show us the code we can't really help.
  15. I just call it code. The compiled code you're thinking of is more specifically called "machine code", not just "code".
  16. The function is part of the PHP GD library, which needs to be installed. I don't believe it is a default package, not sure. Has nothing to do with Windows or Linux.
  17. Not really sure what you want us to click on in your demo. I can't find anything broken. Are you getting any JS errors? How do you know the PHP works, what is the response you're getting?
  18. Your HTML is rendered before the Javascript is loaded. So at the time of onclick="rollDice()", the JS has not loaded yet and so the function does not exist. Easy solution: Load your JS files just before the closing body tag. <script src="DiceRoll.js"> </script> </body>EDIT: Actually, that was not accurate - you only have to load at the end of the body if you want JS to access DOM elements that otherwise wouldn't have existed yet. I had that backwards. As it turns out, in your case you still have to load it before the closing body tag, though, since you are looking for DOM elements that otherwise won't exist. Your function was "not defined" because you have a whole bunch of syntax errors that are terminating the script. Have a look at the error console while loading your page, and try to work through them. You can access the developer console in Chrome by hitting CTRL+SHIFT+I, or going to the hamburger menu on the top right and then Tools -> Developer Tools. Also, it is in your best interest to format your code properly - use proper indentation and line spacing. It's an illegible mess at the moment, so it's easy to make mistakes. Run it through this to see what I mean: http://jsbeautifier.org/
  19. Linux! Ha! Just kidding. I agree with Ch0cu3r; setting up email servers sucks. There's lots of very affordable SMTP services these days, like Gmail, that can get you up and running with no problem.
  20. You can disable XDebug in the php configuration. It's either going to be in the php.ini, or in another config inside conf.d
  21. There aren't errors, the value is just set to an empty string. Any non-numbers are considered invalid input and the whole thing just ends up being an empty string.
  22. I would probably look for an existing OCR solution. But, you can get pixel data using imagecolorat().
  23. That would be part of the HTTP server, not PHP - so Apache2 or Nginx or whatever you're using. There is a bunch of config values in Apache for determining how many concurrent connections can be handled. It's basically directly limited by how much memory your server has. It's a bit of an art to get it tuned properly. But, I'd wait until you actually run into problems first.
  24. type="number" only allows numbers to be entered.
  25. You can't download a file with AJAX. You should use Javascript to "redirect" to the download link instead.
×
×
  • 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.