-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
You have multiple versions of PHP installed. One will be from apt, but the other is probably a manual install or something you got from another repository. Or maybe you installed from apt once, did something with your system setup, and then installed another. The easiest thing to do will be to remove all of your PHP and Apache stuff completely, make sure you're set up to be able to install the version of PHP you need, then install just that one. You should have one directory with all the extensions and they should be all available without having to edit any INI files.
-
Here is an introduction on how to use Composer.
-
kicken already did that in his code. What problems are you having with trying to use it?
-
I don't suppose you're trying to run that composer command from within a checkout of PHPMailer itself, are you?
-
You cannot mix PHP and Javascript like this: PHP runs on the server and has finished running by the time your browser starts to execute any of your Javascript. If you want the length of the string then you can get that in Javascript easily. What are you actually trying to do with this code?
-
Throwing syntax at the function and seeing if it does what you want isn't a very efficient way of programming. Do you understand how those regular expressions work? What the various symbols mean? Again: one step at a time. This ~(\bhttps?://\S+)(?:\s+\[([^]]+)\])?~i is a good enough regular expression that will match these: http://www.google.com https://www.google.com http://www.google.com [Link text here] https://www.google.com [Link text here] Did you know about the [text] bit at the end? Do you want that?
-
Take it one step at a time. Do you have a regular expression that can match "www.google.com"? Do you have a regular expression that can match "google.com"? Do you have a regular expression that can match "person@gmail.com"?
-
Don't use mail(). Do use PHPMailer or SwiftMailer, which understand how to do the sorts of encryption stuff that your server apparently (and fortunately) requires.
-
What do you think? No really: do you think it's single or double?
-
Meaning what? Giving us a single sentence of description and dumping a bunch of code doesn't go very far towards persuading us to help with a problem. Including an actual description, like of what you want to do and what you tried and how it seems to be (not) working, does help.
-
That is also very, very much the more appropriate solution than creating dynamically-named variables. So that's great 👍
-
How do i make a page of user like:
requinix replied to CaraDoPastelDaSuaRua's topic in PHP Coding Help
First create the /user/index.php (or whatever you want to call it) like ginerjm suggested, then use URL rewriting to take a request that looks like /user/X and rewrite it to /user/index.php?id=X. -
The correct solution is to use something set up in the server configuration to let you do URL rewriting - without having to resort to anything to do with 404 pages. Have you tried asking the people who run the server what they can offer you in the form of URL rewriting? It's an extremely common behavior for websites so it's hard to believe they aren't providing you a way to do it.
-
[SQL QUERY] I don't know what I'm doing wrong with PHP 8.2.0
requinix replied to Chessica's topic in PHP Coding Help
The first thing to fix is the error page you see when there's a problem. "This page has a problem" is not useful for you to fix anything. What you need are error messages about specific problems. Edit the PHP configuration file, put these two settings at the very bottom of the file, and restart Apache: error_reporting = -1 display_errors = on Then try running your PHP script and query again. I think you'll see at least one warning. Then put your mysqli_report line back, and/or try the query using ' quotes, and see what PHP says. -
[SQL QUERY] I don't know what I'm doing wrong with PHP 8.2.0
requinix replied to Chessica's topic in PHP Coding Help
It would be helpful if you explained what it does do, rather than just what it does not do. Like what kind of error messages you may be getting. And you should be getting error messages because you're using mysqli::execute_query incorrectly. If you aren't seeing messages then fix that before you fix the code. -
What you're trying to do doesn't make any sense at all. Perhaps you'll have a better time learning OOP if you aim your efforts in a more sane direction?
-
1. Don't use mysqli_multi_query because you're running the three queries by themselves individually already. 2. Don't create queries where you put $_POST values directly into the SQL. It's extremely unsafe. Use prepared statements instead.
-
Not entirely sure it is possible. What about downgrading the system openssl to 2.x?
-
get new value of type='date' field in its onchange event
requinix replied to ginerjm's topic in Javascript Help
Why is this thread still going? <input type="date" onchange="alert(this.valueAsDate.getUTCDate());"> -
PHPExcel read TRUE or FALSE as text and not logical operator
requinix replied to vikaspa's topic in PHP Coding Help
If the value in the cell is a logical true/false then there's no amount of PHP code you can write which will suddenly make it be text. But you can go into the sheet and mark that cell/column as text - that might work. Of course, if the value is true/false and you want "true"/"false" then you could simply handle that. Perhaps with a ternary, like "$variable = $cell ? 'TRUE' : 'FALSE'". -
implementing polymorphism and inheritance
requinix replied to bernardnthiwa's topic in PHP Coding Help
You can't. There will have to be some conditional statement somewhere. OOP is a technique to solve a problem. It is not a solution to a problem. What's the rest of your design, and we can see if OOP is going to help with this particular task. -
Showing page name and not the token name as it should with my code
requinix replied to hendrikbez's topic in PHP Coding Help
Okay. But what is the URL, what "slug value" are you seeing, and what do you want to see?