Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

requinix last won the day on November 12

requinix had the most liked content!

About requinix

Profile Information

  • Gender
    Not Telling
  • Location
    America/Los_Angeles

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

requinix's Achievements

Prolific Member

Prolific Member (5/5)

1.2k

Reputation

371

Community Answers

  1. Where is the printer? Is it connected to the client or to the server? If it's connected to the client then the only thing you can do is present a print dialog. The user will have to choose the printer (potentially) and hit the button to print. If it's connected to the server then you can use a library to have PHP print the page. The details of that depend on what you're printing...
  2. The simple answer is probably also obvious: if you don't want to show the form under certain conditions (like after the form was submitted successfully) then don't show the form under those conditions. There's a bunch of different ways to go about it, but the one thing they all have in common is that there's an if statement that checks whether or not you want to show the form, and if you do then it shows the form. For example, if (/* show the form */) { ?> (the form) <?php }
  3. (foreach isn't a function) It'd be easier to show if you posted the rest of the code instead of just a couple lines, but basically, replace the while loop with a foreach loop, and then add into it a little logic for $errMess. If that still doesn't make sense, post what you came up with (as well as the original code) so we can see what happened and not have to guess about it.
  4. You commented out the SetEnv?
  5. That was a great, detailed answer that gave me a lot more information to work with than what you first posted. Knowing what you're doing with the session, more than just "start a session and set session variables for different things", tells me about the sorts of practices you might be following, how they might work and might not work, and gives me a good foundation I can use to ask you questions that will make more sense. Knowing that you're trying to understand the developer tools but still aren't quite able to work with them, more than just "How x 3", means I feel more invested in helping you to learn. Like I said before, those tools are invaluable when it comes to a lot of web development work, and there's a high likelihood that those tools will be able to explain what's going wrong. But knowing that you've tried this with Firefox and that it doesn't work no matter what is the best part. Web browsers don't just randomly decide how they will work. If Firefox doesn't work but Chrome might, that strongly suggests something is wrong with what you're doing - and I mean that in a very general sense of "you are doing a thing and there's a problem with it", as opposed to "you are doing a thing and Chrome isn't working correctly". 1. If you haven't done it yet, the first thing to check is the console in the developer tools. I believe F12 on any browser will pull them up. It should give you some sort of collection of tools or tabs, and one them should be clearly marked as Console. Have the tools open as you log into the admin (like in Firefox). Do you see any errors or warnings? 2. There's also a Network tab. If there's no messages then (that's surprising, but) you'll have to look a little closer at what's happening. Provided the tools were open when you logged in, the tab should show a request to your login page or AJAX endpoint or whatever. That's where cookies may have changed. Open up the information for the request and check the Response headers. What does it say for a Set-Cookie? 3. It might not have anything. That's fine. Now check the Storage tab and look for your site's cookies. One of them will be the session cookie, probably named like PHPSESSID. What are the settings for it? (Specifically, the path.) Also, what are the URLs for your login and admin pages? (Specifically, the path portion.)
  6. If you're asking, does that mean you tried what I said and couldn't find an answer and decided to not mention that? Or does it mean you saw my answer and decided you didn't like it and wanted something else instead?
  7. Use your browser's developer tools. If you're not sure how, spend some time getting familiar with them because they're invaluable for web development.
  8. PHP doesn't care what browser or operating system you're using to view pages. Your problem is going to be either (a) settings in the Ubuntu browser that prevents it from accepting the session cookie, or (b) a problem with the session cookie where the Windows browser is accepting it incorrectly but the Ubuntu browser is rejecting it correctly. Actually there's a third possibility: a difference between how you're using the two browsers that is important but you don't know about and/or aren't mentioning. Such as a different hostname, source IP address that somehow matters, some sort of Windows authentication mechanism... 1. Check the network responses and confirm you're receiving a Set-Cookie on at least the first visit 2. Check that the cookie is being remembered by the browser/not being rejected for some error that should have been logged somewhere/isn't immediately expiring/something else 3. Check that the cookie is being sent in additional page requests 99% of the time the problem will show up in one of those three steps.
  9. Did you press the Logs button to view error logs? Or check the Windows Event Viewer for more clues?
  10. I don't remember if Intelephense provided the feature or not. In fact I might not even have tried it with PHP - maybe it was another language. But I assume the concept works the same way everywhere. But yeah, the hover or autocomplete list has always been sufficient for me. Oh well, whatever works best for each person.
  11. It might work a little more cleanly in PHPStorm, but when I tried it in VS Code, I found it much more complicated to try to select text or read through code when the editor was injecting those things into the view. Maybe if they weren't inline, though I can't imagine how not, they might be nicer for me... But I'm also a proponent of the idea that you should be able to tell what the parameter is, be that through a variable name or an obvious literal value (or a constant...), and if you can't tell then you should do something about that. // this is obvious on what the parameters are password_verify($password, $hashedPassword) // this is not password_verify($value, $row[1])
  12. That said, how the heck do you know what "6" means? Use column names instead.
  13. The code you posted is not using alert(). Is it possible that the code you posted is meant to return a message to display? And since you're returning a message that looks like HTML, it is alert()ing that HTML? If so then the code you need to fix isn't what you posted...
  14. There's nothing in here that should show a normal Javascript alert()...
  15. And where is that? I'm guessing that you're expecting to see those two events in your version of the code but, according to that one screenshot, are not. Without seeing code or data, I'm also guessing it's going to be one or more of: - You don't have the data for the events - The data for the events is present but incorrect - The query to retrieve the data is incorrect - The query is correct but the code to display the data is incorrect
×
×
  • 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.