-
Posts
15,067 -
Joined
-
Last visited
-
Days Won
414
Posts posted by requinix
-
-
That's the same thing as Barand posted, except you flipped the condition which then forced you to use that else block.
-
Have you checked your PHP error log for messages? Perhaps a message occurring on
if ($conn->connect_error)
this line?
-
"Simple" string interpolation only allows you to access a single level of an array. If you want multiple levels then use the "complex" syntax with braces:
"value='{$rows[0]['itemName']}'>"
- 1
-
5 minutes ago, Barand said:
This works for me (if I substitute a datetime value over 2 weeks old for $row['date'] )
"Works" in that it outputs this image: ...
-
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.
-
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.
-
Why load the first page at all if you're just going to redirect them immediately anyway?
Don't send them back to the first page. Send them directly to the second page instead.
-
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?
-
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.
-
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.
-
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.
-
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.
-
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?
-
I think you're misusing inheritance and interfaces, but sure, go ahead and try the RFC process if you want.
-
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.
-
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.
-
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.
-
3 hours ago, webdeveloper123 said:
I'm pretty sure that Salt is an extra layer of protection for password_hash, not a method in it self
No, password_hash handles all the work for you. Including salting.
Don't do anything extra.
- 1
-
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.
-
"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.
-
Those are access logs, not error logs.
PHP may be writing its errors (if any) to the same place where IIS's error logs are going.
-
Then it's correct. You can be even more sure by outputting the error_reporting() value in code.
What's the actual and full deprecation message? And have you searched the code itself to see if anything changes the error_reporting value at runtime?
-
2 hours ago, ARP said:
I'm guessing it has to do with
Why are you guessing? Check the server and PHP error logs for why you're getting a 500.
-
And php -i says (at the top) that it's reading /etc/php.ini?
What number is it showing for the error_reporting setting? You can figure out the meaning using this page (you're looking for 22527).
NSFW filter conditionals
in PHP Coding Help
Posted
Checkboxes are only submitted in form data when they are checked.