-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Clearly you have something on the server generating this file for you. Perhaps cPanel? Is there some tool you should be using to modify this file instead of doing it yourself manually?
-
CORS and Sandboxing User Javascript, and Cookies
requinix replied to Heretic86's topic in PHP Coding Help
I'll ask once again because I'm pretty sure the correct answer is not what you've been saying: Is the Javascript code running from a document context of www.webucate.me or something else? Are you perhaps running it as a local file? -
CORS and Sandboxing User Javascript, and Cookies
requinix replied to Heretic86's topic in PHP Coding Help
iframe or not, if your code is running on the same domain you're trying to send a request to then you don't "need" CORS, and the default behavior of browsers and servers should be fine... The same request and response you posted. That's the OPTIONS and, presumably, its reply, right? Because they say that the allowed origin is the exact same thing that the error message is complaining is not present. What are the headers from a failed AJAX request and response? -
CORS and Sandboxing User Javascript, and Cookies
requinix replied to Heretic86's topic in PHP Coding Help
Now I'm lost because I thought this was a CORS question. The Javascript code that is running and sending AJAX requests. Is it doing so from a document context of www.webucate.me or some other domain? -
CORS and Sandboxing User Javascript, and Cookies
requinix replied to Heretic86's topic in PHP Coding Help
You can't set the Origin, that's protected, so if it's sending "null" then that probably means you're not running from a suitable location. That aside, the cookie is SameSite=Strict, so if you're not running from www.webucate.me then you can't use it. -
CORS and Sandboxing User Javascript, and Cookies
requinix replied to Heretic86's topic in PHP Coding Help
If you don't need to access the cookie in code and only care that it gets sent through the AJAX request, then yes: withCredentials would do it. Should be pretty easy to figure out whether that solves your problem. Without error messages or a set of failing request and response headers, there's not much else to do but guess at what's wrong... -
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.