Jump to content

requinix

Administrators
  • Posts

    15,274
  • Joined

  • Last visited

  • Days Won

    432

Everything posted by requinix

  1. The whole point of an HttpOnly-flagged cookie is that you cannot read or write to it in code. It's right there in the name.
  2. Unless someone here has specific knowledge about the sort of thing you're trying to do, we're not going to be able to tell you what's wrong unless you can describe what you're seeing. First thing to do is get more information. If you can't tell whether you can connect or not, that sounds like a good place to start. Maybe try some other, simpler cPanel operation to prove that the code is valid? Also see if you can get any logging or error messages that could indicate what's going wrong.
  3. One of those two will work and the other will not. What will happen is, if you do the correct method then it will work, and if you do the incorrect method then it will not work.
  4. As both error messages clearly state, you cannot change session settings after you've already started the session. It should logically follow that if you want to change settings then you have to do it before the session is started.
  5. Forget everything you know about IIS and C#.NET applications, forget all those common practices about shared memory on the server, and start learning PHP from the very beginning. Because trying to apply your C#.NET experience to PHP will cause you lots of problems. The answer you're looking for is probably sessions.
  6. Mobile apps don't care what technology you have running on your server. You can definitely use PHP to send notifications.
  7. Then this isn't a datatables problem. It's a session problem. Increasing the session duration is the answer, but there are multiple settings to consider. What does phpinfo() say your session.* values are?
  8. First things first: confirm whether the session timeout is the problem. Because it sounds like you're not entirely sure that's the case. Should be easy enough to confirm: wait 30 minutes, then try browsing the site and see if you've been logged out. Or more precisely, and especially if you have some Remember Me-type functionality, see if the session ID changes.
  9. Your whole argument is "there's a 'class' in the URL but it isn't a class". That's stupid. Actually it is. I think it's clear that you're complaining about stuff you don't understand. Let me know when you want to start climbing down off Mt. Stupid.
  10. If you think that "reading the documentation" means looking at the URL then you're definitely going to have problems.
  11. I asked what those two lines of code were doing. I know what you want to do, and I know you aren't sure of whether it's right. You start off with addHeight=200. The first time it addHeight += 200 (so it's now 400) and adds that to the current height. The second time it addHeight += 200 (now 600) and it adds that to the current height. If you start with a height of 100 then it becomes 100+(200+200) = 500 on the first time, then 500+(400+200) = 1100 the second time, then 1100+(600+200) = 1900 the third time...
  12. addHeight += 200; var divHeight = $('#grid-items').height() + addHeight; Think about what these two lines are doing. What happens the first time? What happens the second time?
  13. The reason would be that there is no such file or directory. The explanation would be somewhere in your code. The solution is
  14. Make $file be a non-JPEG image. Because $im is a resource and if you want to echo it out then PHP needs to do something. Remove the @ and look for error messages.
  15. 1. Don't use @. 2. $im will never be a string. It does not make sense to compare it to a string. Don't do that either. Read the documentation to find out exactly what imagecreatefromjpeg does.
  16. Post code and error messages.
  17. RewriteConds only apply to the single next RewriteRule. They are not being applied to the second one. You can combine both RewriteRules by making the trailing slash optional, as in /? Why use a _FUNC constant? Just require each file inside the switch and be done with it. if(isset($_POST['user']) != 'lung'){ Copy/paste fail? isset() returns true or false. It does not return the value so comparing it to 'lung' does not work. Make the !isset check be first, then change this check to use a regular comparison. echo json_encode($error);die(); If you are sending JSON then you need to include a Content-Type header with the value of "application/json". Additionally, if you want to include a HTTP status code like 422 or 401 then you should actually send a HTTP response code.
  18. Could what be on Linux? Windows computers can find Windows computers via a method that is not DNS. I don't believe Linux supports that mechanism. So if you want Windows->Windows to work with http://computername then that should happen for you. If either of them is Linux then you'll need either a hosts file entry (for each computer wanting to access it) or an intranet DNS server.
  19. Best way to do what? Is that a question? Because no, I don't believe you have to install anything to use exec(): it's part of the core PHP and it's not something Linux distros separate out into installable packages (as opposed to stuff like JSON, which is "core" but often separated).
  20. That's very much not correct. Go back to what I posted. You might be encountering file permission problems. 1. Decide what directory you want to put the thumbnails in. If you're using upload/ then I suggest either (a) upload/thumbnails or (b) changing the filenames to be like example.jpg for the original and example.thumb.jpg for the resized version, and they both go in upload/. 2. If you want a subdirectory, create it and then chmod 0777 it - or do whatever it is you did with upload/ to allow copying the file there. Because I'm 80% certain you did have to do something. Also, checking if the $_FILES "name" isn't empty is not enough. Look at the "error" and make sure it has the value UPLOAD_ERR_OK. If not then maybe there was no file (UPLOAD_ERR_NO_FILE) or there was some other problem during the upload.
  21. Couple issues here. First is the matter of putting variables into strings. "{['filename']}" is just not going to work at all. I mean, there's gotta be a $ somewhere. Second is that you have to use the right values for convert. Because of the move_uploaded_file, you need to convert $targetFilePath. Not whatever "filename" was supposed to be. Then, just like with variables in SQL queries, you need to make sure that the $targetFilePath doesn't cause problems with the convert command. There is no "prepared commands" concept like SQL has so you have to escape it yourself - fortunately there's a built-in function to do that. $targetFilePathArg = escapeshellarg($targetFilePath); exec("convert $targetFilePathArg -resize 300x200 ./Thumbnails/testphp.jpg");
  22. That statement doesn't really make sense. Are you using password_hash when storing the password? Because you need to be: not just because it's the correct thing to do, but because that is the counterpart to the password_verify you're currently using when checking the password. Gotta have both of them for this to work.
  23. What's the code for saving the passwords into the table in the first place? It uses password_hash, right? Also, don't put variables into queries like you're doing with $userid. Learn about prepared statements and start using them immediately.
  24. You can't mix HTML strings and HTML elements together like that. Construct the HTML as a string if you wish, if that's easier to do, but you'll have to .append fn and whatever into it separately. For example, var row = $("<div class='row'>...</div>"); row.find("label[for='basic-url'] + div").append(fn); $(".content").append(row);
×
×
  • 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.