-
Posts
15,274 -
Joined
-
Last visited
-
Days Won
432
Everything posted by requinix
-
CORS and Sandboxing User Javascript, and Cookies
requinix replied to Heretic86's topic in PHP Coding Help
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. -
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.
-
Applicable ways to store state on the server using PHP
requinix replied to Sunless's topic in PHP Coding Help
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. -
Datatable - Requested Unknown Parameter after User Inactivity
requinix replied to roshan_zaid's topic in Applications
What about the other settings? -
PHP, Could it push notification to Andriod and ISO APP?
requinix replied to nitiphone2021's topic in PHP Coding Help
Mobile apps don't care what technology you have running on your server. You can definitely use PHP to send notifications. -
Datatable - Requested Unknown Parameter after User Inactivity
requinix replied to roshan_zaid's topic in Applications
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? -
Datatable - Requested Unknown Parameter after User Inactivity
requinix replied to roshan_zaid's topic in Applications
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. -
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.
-
If you think that "reading the documentation" means looking at the URL then you're definitely going to have problems.
-
Stopping the ever increasing gaps between DIVs
requinix replied to CSS-Regex's topic in Javascript Help
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... -
Stopping the ever increasing gaps between DIVs
requinix replied to CSS-Regex's topic in Javascript Help
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? -
The reason would be that there is no such file or directory. The explanation would be somewhere in your code. The solution is
-
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.
-
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.
-
Post code and error messages.
-
Create PHP for Rest API concept. Need someone review my coding
requinix replied to nitiphone2021's topic in PHP Coding Help
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.- 1 reply
-
- 1
-
-
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.
-
Using the EXEC() function to contain an IMageMagick Command
requinix replied to Fishcakes's topic in PHP Coding Help
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). -
Using the EXEC() function to contain an IMageMagick Command
requinix replied to Fishcakes's topic in PHP Coding Help
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. -
Using the EXEC() function to contain an IMageMagick Command
requinix replied to Fishcakes's topic in PHP Coding Help
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"); -
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.
-
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.
-
Move an input with Jquery after setting as a variable
requinix replied to Adamhumbug's topic in Javascript Help
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);