-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Make a normal link to invoice.php and have the script do the redirect.
-
How to change seconds into Days, Hours, Minutes, Seconds
requinix replied to Lux05's topic in PHP Coding Help
-
Use one <a>. If you want it to look like a button then make it look like a button. Then add a target attribute to it. If that's still not working then post your current code. Everything that might be relevant. Not just the line with the link/button on it.
-
Composer not autoloading classes from vendor dir in index.php
requinix replied to JacobSeated's topic in PHP Coding Help
It's easier when you contain all your mailing work in one single location instead of spreading calls to it throughout your application. It's perfectly acceptable to create your own mailing class that uses PHPMailer to do the work. Don't worry about those files. It should be mentioned somewhere, but otherwise it's mostly implied. -
Composer not autoloading classes from vendor dir in index.php
requinix replied to JacobSeated's topic in PHP Coding Help
You're reading from some old documentation. PHPMailer\PHPMailer\PHPMailer looks weird but it is correct: the first "PHPMailer" is the organization, the second is the project, and the third is the class itself. https://github.com/PHPMailer/PHPMailer/blob/master/UPGRADING.md -
Don't use relative paths like anything that starts with ../ Use absolute paths. If fill_sidebar.php is in folder1 then write /xxx/folder1/fill_sidebar.php. If it's somewhere else then write /xxx/somewhere-else/fill_sidebar.php.
-
Unable to redirect my page after submitting a form
requinix replied to joshgom's topic in PHP Coding Help
If you have problems with some code then you have to post that code. Not the working code. The working code works. Working code doesn't help your non-working code. -
Converting grayscale image to pure black and white
requinix replied to DianaSimona's topic in PHP Coding Help
And what's the problem? I see some PHP code there which looks like it's on the right path. In fact it already has something to grayscale an image, so I would think that what you need to do is simply modify that to use black and white instead. -
Detect codepage to use, read it from system? (for ZIP files)
requinix replied to Sonnich's topic in PHP Coding Help
Make sure PHP is being run with the correct locale, then retrieve it. Note that's not a complete answer. You'll need to investigate and test a little. -
The temp dir really ought to be writable by PHP. You and/or your client should complain to the "ISP" or whoever manages their PHP setup to allow for that. Worst case: write to someplace other than /tmp. Like a dedicated log directory for your application. Oh. And this is something that should be configurable.
-
How about you try describing what you want with a few more words? Maybe even an example or two?
-
Look at the documentation for session_destroy() to see how to destroy a session.
-
Extensions are not freebies. Most of them come with particular requirements that you must have installed. So you tell me, does it make sense to install Oracle database support on your server if your application has nothing to do with it? And all that software comes with additional risks of vulnerabilities and such. And some of them do come with some overhead even when not in use. And every time you want to update an extension you have to restart PHP. Installing and enabling extensions is easy. Don't be lazy. Get what you need, don't get what you don't need.
-
PHP 7.4 on Ubuntu 20.04
requinix replied to StevenOliver's topic in PHP Installation and Configuration
Given that Ubuntu Focal (20.04) uses PHP 7.4, installing it through apt will be easiest. That's the sort of thing you could probably have figured out yourself.- 5 replies
-
- php 7.4
- ubuntu 20.04
-
(and 1 more)
Tagged with:
-
And to be clear about potential confusion, the word "timestamp" has two meanings. The one I was using is a Unix timestamp, which is the number of seconds since January 1st 1970. So it's a number. The one gizmola is using is the TIMESTAMP type in the database, which converts easily between the numeric Unix timestamp and date strings.
-
PHP command line: enter data into executed function
requinix replied to Daniel290499's topic in PHP Coding Help
Then you would use the proc_* functions. They're complicated to understand and use (much more than this SSH thing I'm telling you about), but that is the best way to start up a process and send input to it (if you don't have any better alternatives). -
PHP command line: enter data into executed function
requinix replied to Daniel290499's topic in PHP Coding Help
Yes, and I'm telling you that's not the right answer. The right answer is to set up a private key and modify your SSH configuration so the whole prompting problem completely goes away. Unfortunately if you search for stuff like "git ssh" you'll find a number of places that don't give the best answer. Generate your private key (that you can search for), associate it with the Git account, then follow this article on how to set it up with SSH. But like I said, make sure you do this for the correct user account on the machine. Which is probably not your personal account. When done right, you (and by "you" I mean whatever the correct user account was) can tell git to clone from github.com, or pull from it, or push to it, or whatever else, and the authentication will be completely handled for you. No prompts. -
Zip on old systems (php 5.5), transfer to new system
requinix replied to Sonnich's topic in PHP Coding Help
There are a number of migration guides available to take you from 5.5 to 7.2. You should look through them for this upgrade process regardless of the encoding issue. Spoiler: you need to care about the default_charset at a minimum. The input/output/internal_encodings probably won't matter. -
Part of the way there. array_push could be useful except for one rather important limitation: you can't choose the array keys it uses. And since the keys are important here, array_push won't cut it. Also note that array_push is basically just a function version of the [] operator. As in array_push($array, $value) is the same as $array[] = $value. It does allow pushing multiple values at once, though, and sometimes that is useful.
-
Installing php extension not recogned
requinix replied to matthewbaynham's topic in PHP Installation and Configuration
What is the "lampstack" thing you seem to have installed? Ubuntu has a perfectly good LAMP stack available for installation through apt, and it takes care of all this cli-vs-webserver configuration stuff for you. -
PHP command line: enter data into executed function
requinix replied to Daniel290499's topic in PHP Coding Help
Entering a username and password is not the right approach. Set up the SSH settings on the machine to use proper authentication with a private key. This can happen automatically without any prompting. Note that this is a general git/SSH issue. Nothing to do with PHP. Just make sure that you're applying these settings to the same user that is running PHP - which is probably not the usual user you're used to but instead "apache" or "nginx" or "www-data" or something else. -
Zip on old systems (php 5.5), transfer to new system
requinix replied to Sonnich's topic in PHP Coding Help
1. You don't "get around" it. You fix it. Likely by updating some php.ini settings to match how 5.5 worked. Note that there were a lot of changes to how character encoding works in PHP so you cannot simply copy and paste settings. 2. This could be an encoding problem. Fix that first. -
That will add the $newArray array into the users array under a "0" key. As in $_SESSION[users] will be an array with an "id", "fname", "lname", and "0". The answer is array_merge/replace or careful use of the +/+= operator.