Search found 361 matches

by Michalio
Tue Mar 21, 2023 3:44 am
Forum: PHP Installation
Topic: How to install extensions
Replies: 1
Views: 81

Re: How to install extensions

Verify the version of the php, you can check the location with all modules for current version going to /etc/php/8.1/conf.d/
by Michalio
Thu Mar 09, 2023 3:30 pm
Forum: PHP coding => General
Topic: Debugger
Replies: 3
Views: 264

Re: Debugger

Did you read my post about debugging?
You can also try phpstorm (there is a trial version) to test debugging (I never used that), but probably there is not more automated for debugging.
For mysql you can use official client - mysql workbench
by Michalio
Thu Mar 09, 2023 3:26 pm
Forum: PHP coding => General
Topic: Open File Explorer from Web App
Replies: 3
Views: 186

Re: Open File Explorer from Web App

I know that you cannot open the folder locally, but with the API you can list the files from cloud and if the sync is enabled then the file list will be the same on cloud as on local folder and if you edit one file then it should be dowloaded by the onedrive app
by Michalio
Wed Mar 08, 2023 11:20 pm
Forum: PHP General
Topic: Table function edit
Replies: 1
Views: 148

Re: Table function edit

To get the user data you are using:

Code: Select all

get_userdata($history_value->userid)
To make your changes you need to read this: https://developer.wordpress.org/reference/classes/wp_user/

Additionaly you can get the user once, because the code get it twice
by Michalio
Wed Mar 08, 2023 10:36 pm
Forum: PHP coding => Mail
Topic: require(..\_lib\vendor\phpmailer\phpmailer): failed to open stream: No such
Replies: 1
Views: 142

Re: require(..\_lib\vendor\phpmailer\phpmailer): failed to open stream: No such

Use slashes instead of backslashes and verify that the path is correct. Try to use realpath function
by Michalio
Wed Mar 08, 2023 10:32 pm
Forum: PHP coding => Mail
Topic: PHP Fatal error: Uncaught Error: Call to undefined method PHPMailer::setFrom()
Replies: 1
Views: 46

Re: PHP Fatal error: Uncaught Error: Call to undefined method PHPMailer::setFrom()

What version of phpmailer do you use?
Yo need also set the sender (the smtp for example).
Please show the whole logs for the current request
by Michalio
Wed Mar 08, 2023 10:22 pm
Forum: PHP coding => General
Topic: Open File Explorer from Web App
Replies: 3
Views: 186

Re: Open File Explorer from Web App

Use their API to connect and manipulate files. There is php package to do that:
https://github.com/krizalys/onedrive-php-sdk
by Michalio
Wed Mar 08, 2023 10:17 pm
Forum: PHP coding => General
Topic: Problem addressing php back to div
Replies: 3
Views: 169

Re: Problem addressing php back to div

Why you are using javascript here? you can put the result of the test.php directly into the div
by Michalio
Mon Mar 06, 2023 10:31 am
Forum: PHP coding => Mail
Topic: mail(): headers parameter must be string or array in /home/acifinan/public_html/application.php on line 40
Replies: 3
Views: 72

Re: mail(): headers parameter must be string or array in /home/acifinan/public_html/application.php on line 40

Did you consider ro use phpmailer or other package to sendi g the emails?
You are declaring the $header variable only when you have uploaded file otherwise the $header is undefined.
Please also consider sending emails from the queue instead directly while the request
by Michalio
Mon Mar 06, 2023 10:16 am
Forum: PHP General
Topic: Inconsistent results from bulit-in function $_SERVER
Replies: 1
Views: 60

Re: Inconsistent results from bulit-in function $_SERVER

It depends on http server, the $_SERVER may be different on built in http server, on apache or nginx, because each of them uses different api (builtin, apache-php or php-fpm).
by Michalio
Mon Mar 06, 2023 10:07 am
Forum: PHP coding => General
Topic: EXIF - Samsung Camera
Replies: 1
Views: 165

Re: EXIF - Samsung Camera

Are you using built in functions or dedicated package for that?
by Michalio
Mon Mar 06, 2023 10:06 am
Forum: PHP coding => General
Topic: PHP code error with version 8
Replies: 1
Views: 183

Re: PHP code error with version 8

I am not sure what the code should return, but try to use strlen function instead of count
by Michalio
Tue Feb 28, 2023 1:48 am
Forum: PHP coding => General
Topic: Index error how to fix
Replies: 1
Views: 173

Re: Index error how to fix

After you declare the $product variable print it:

Code: Select all

echo '<pre>;
print_r($product);
echo '</pre>';
by Michalio
Fri Feb 24, 2023 6:31 am
Forum: PHP coding => General
Topic: make a colum fixed width
Replies: 1
Views: 179

Re: make a colum fixed width

you can use the same attributes/styles for <td> and <th>:

Code: Select all

<td width="100">
<th width="100">
<th style="width:100px">
by Michalio
Wed Feb 22, 2023 9:35 am
Forum: PHP coding => General
Topic: php function edit without code duplication
Replies: 1
Views: 182

Re: php function edit without code duplication

move these function to the classes, if you want to change one function (method in the class) just create a new class and extends the parent class with overriding one method that you want to change class ParentClass { public function getRandomChar() { return chr($this->getRandomNumber(32, 126)); } pu...
by Michalio
Tue Feb 21, 2023 1:29 am
Forum: Your Scripts
Topic: string2array and array2string
Replies: 8
Views: 11938

Re: string2array and array2string

Previous post was posted 17 years ago, in that time OP could know somebody, get married, have a child and the child could growth enough to be know that no one should reply to old threads such like this one
by Michalio
Tue Feb 21, 2023 12:35 am
Forum: JavaScript
Topic: Check Age
Replies: 1
Views: 302

Re: Check Age

Please share the github (or other website where the code is available) next time. I pushed the code to github to browse the code much more simplier: https://github.dev/Public-PHP-Projects/CheckAge Let's check the code in work: https://htmlpreview.github.io/?https://raw.githubusercontent.com/Public-P...
by Michalio
Mon Feb 20, 2023 7:55 am
Forum: PHP General
Topic: php 7.4 and php 8.1
Replies: 2
Views: 913

Re: php 7.4 and php 8.1

try to change the default version of php for the account, sometimes you will need to restart the http server. Are you using apache, nginx iis or other?
by Michalio
Mon Feb 20, 2023 7:53 am
Forum: PHP coding => General
Topic: building a new table
Replies: 1
Views: 213

Re: building a new table

What of script are you using to perform this sql query?
by Michalio
Mon Feb 20, 2023 7:52 am
Forum: PHP coding => General
Topic: Cronjob for PHP
Replies: 1
Views: 205

Re: Cronjob for PHP

why can not you get the date in PHP?
by Michalio
Mon Feb 20, 2023 7:49 am
Forum: PHP coding => General
Topic: Beginner error (need help)
Replies: 1
Views: 268

Re: Beginner error (need help)

the class EnlacesPaginas have method named enlacesPaginasModel tha is not static, so to use this method you need to create an instance of the class EnlacesPaginas and then you need to call the method from the class instance like this: $instance = new EnlacesPaginas(); $instance->enlacesPaginasModel(...
by Michalio
Mon Jan 30, 2023 12:15 pm
Forum: PHP coding => General
Topic: php time not updating
Replies: 1
Views: 260

Re: php time not updating

You need to execute the php file if you want to execute the code.
You can use simply

Code: Select all

<?php
echo time();
If you want to use one script for writing the date to another one you need to open both in right order
by Michalio
Mon Jan 30, 2023 11:41 am
Forum: PHP coding => General
Topic: php error
Replies: 2
Views: 1344

Re: php error

Try to change the server variable to set correct url.

You can also try to use the GET method for test the connection and then use the POST method
by Michalio
Thu Jan 26, 2023 12:54 pm
Forum: PHP coding => General
Topic: Recreate datatable on button click
Replies: 8
Views: 1303

Re: Recreate datatable on button click

You need to send the data from search form to the backend by the post method (you can also use ajax request). Then you need to create a sql query to find results that you want to display. Please read this article about create a search field: https://pbphpsolutions.com/php-mysql-search-database-and-d...