Jump to content

requinix

Administrators
  • Posts

    15,067
  • Joined

  • Last visited

  • Days Won

    414

Posts posted by requinix

  1. Okay yeah no, you're missing the point.

    Look at this:

    <a class="color_black" id="btn" href="?dashboard=user&page=member&tab=viewmember&action=view&member_id=<?php echo esc_attr($retrieved_data->ID)?>">

    You know what URL you want the user to go to. After all, it's right there in the link.

    So if you know what the URL is, why even bother having this page at all? Why give the user some HTML page when all you're going to do is trigger some Javascript that immediately sends them somewhere else? It's wasteful.

    Instead of giving them this page, do the redirect.

    In case you weren't aware, you can do it with some PHP code. Maybe that was the missing piece in this puzzle? It looks like this:

    $url = "?dashboard=user&page=member&tab=viewmember&action=view&member_id=" . esc_attr($retrieved_data->ID);
    header("Location: $url");

    You execute that code before making any output at all. None at all. Then you stop executing after that - so no output after it either.

    And that's how you do a redirect from within PHP. One that doesn't require any HTML or Javascript.

  2. I mean

    2 hours ago, MushMX said:

    Hi i need to perform an automatic redirect. sp when the page loads, automatically redirect to another one by using a special function:

    That page. The one you're talking about "when it loads".

    I'm saying, don't load that page. Ones before it fine, but instead of "when the page loads I want them to redirect somewhere else" you should do "don't load that page and instead do the redirect at that moment".

    If that's not making sense, and there's a good chance it doesn't, then please explain more about what "pages" you're talking about.

  3. If you're using LAMP then everything should be set up for you. You don't need to tinker with any configuration to make PHP work. So undo the changes you made and get yourself back to the original setup that, at least, had Apache up and running.

    With that addressed, a quick question: what is the URL you see in your browser's address bar when you try to run one of your scripts?

  4. 3 hours ago, LeonLatex said:

    requinix, the problem is that the username/email does not match the specified size in the CSS document. The password field does, but not the username field. I know that this is probably a trivial issue, but I can't seem to spot the triviality. There might be an extra letter or one missing altogether.

    You're right, it is a trivial thing that you're missing. (At least, as far as I understand what's going on...)

    This is probably a good place for the rubber duck approach:
    Imagine someone is sitting next to you (or find an actual person you can talk to) and explain to "them", in detail, about your username/email input and about the CSS. Pretend "they" don't know much about CSS or HTML. Tell "them" about how the CSS works and how it knows to resize that input. Point out the relevant code to "them" as you go.

    It should take you a few minutes to do this exercise - any faster means you're rushing through it.

  5. 1 hour ago, geatzo said:

    ive tried making a folder called profile and adding all the images into it which works but then all the links on the page changes to /profile/login.php etc ??

    So you tried doing something more difficult and awkward and it created more problems than it solved, right? Then don't do that.

  6. I don't know what you mean by "change size", but I can't help but notice that you have CSS for type=email and type=password inputs and not for type=text inputs.

    I'm also going to assume you're already aware that the type=submit rules aren't going to apply to your submit button.

  7. When you use URLs like "sub.png", for images or CSS or basically anything at all, the browser will look them up according to the "directory" in the page's URL.

    Before the rewriting, your URL was like /profile.php?profile=123 so "sub.png" would mean /sub.png.
    After the rewriting, your URL is now /profile/123 so "sub.png" means /profile/sub.png.

    Use absolute URLs for these sorts of things: that's with a leading slash, and starting from the root of your website. As in "/sub.png", which will always mean /sub.png regardless of what page you're on.

  8. I like how the comment says "i" but the code says "s".

    So you dumped out the value of the ID from the form, and it says like string(3) "123", and then you looked in your "crud" table and found a row with id=123?

    And your code is running successfully, making it to that echo statement, except it doesn't show a value there - and instead PHP actually gives you a one or more warning messages about $result and/or $r and/or the "name" key?

  9. :psychic:

    You've given basically zero details about what any of this is about, or what the application does, or really even what you mean by "certificate".

    And no, there is virtually never any documentation on how to build the application you want to build. Because it's your application, and you're the only one who knows what it's supposed to be.

  10. You cannot catch with type intersection - only a type union, which isn't really a union but more like a syntax meaning "or".

    If you want a type intersection then use a named class. But in your case, kicken's right: all you actually care about is the Err and its getExitCode method anyway.

  11. 5 hours ago, LeonLatex said:

    Barand, i cant make it work wit Æ, Ø or Å. They won't save to the database. All other letters is saved in the database. Is the problem in the hashing of the password?

    A password hash will always consist of alphanumeric ASCII characters. You will always be able to save that in your database.

    The fact that you're saying "if the password has non-alphanumeric ASCII characters then I can't save it in the database" means you're doing something wrong.

  12. 7 hours ago, Adamhumbug said:

    when i echo what is being fed to this function i see 2023-09-04 18:01:04

    You mean $time_stamp is that string value? Well, there's your problem.

    Also, the code you have there just isn't very good. Barand's solution(s) are simpler and make more sense.

    7 hours ago, Adamhumbug said:

    Could an admin please close this as it is not a helpful post.

    Might not be helpful to you, but it could be helpful to someone else in the future who has a similar problem.

  13. "window" is an object. window.close closes the current window because that's what the variable means. If you have a variable for a different window, like one returned by open(), then you can call close() on it.

×
×
  • 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.