Showing posts with label web programming. Show all posts

WordPress User Password Reset

You’ve lost access to your site and you don’t know how to get in again. Normally you can reset your WordPress password in the dashboard or request a new one via email. WordPress stores user passwords in hashed form in the database. You can not find out what saved passwords are. In this post, we’ll walk you through a few quick and easy steps on how to change or reset WordPress password. There are several ways to reset a WordPress dashboard password.

WordPress User Password Reset

If you don't have access to your email or your WordPress site isn't sending emails correctly, then changing the WordPress admin password directly from the database via phpMyAdmin might be the only solution you have.

How to change WordPress password from PhpMyAdmin?

How to Reset WordPress Passwords from cPanel?
1
  1. Login to the cPanel dashboard of your WordPress hosting account.
  2. Click on the phpMyAdmin icon under the database section.
  3. On the left-hand side, click on the database WordPress is associated with.
  4. Click "wp_users" table located on the left. You can have a table prefix added. In this case, it may be named slightly differently, such as "wp_pre_users".
  5. You will now see the rows in your WordPress users table. Click on the "Edit" button next to the username where you want to change the password.
  6. Select MD5 in the "Function" column, type in your new strong password into the "user_pass" box and click "Go".
1

How to change WordPress user password via PHP?

How to change WordPress user password with PHP?
1 If you don't have access to your server's database or don't want to write and run a query, you have another solution. If you can access your server via FTP, you can simply change WordPress user passwords.
  1. Download the PHP file to your computer.
    WordPress User Password Reset
  2. Upload the PHP file via FTP to the root directory on your server where WordPress is running.
  3. Open the address by typing the path of the PHP file into the browser. Example: https://example.com/wordpress-user-password-reset-tool.php
  4. You will see the database name where WordPress is installed, the database user, the database password, the table prefix, and the table listing all WordPress users.
  5. Click the "Reset" button for the user whose password you want to change. When the page is opened after clicking, the user's password will be reset directly. A new password with random numbers like "AtakanAu_01234567" will be determined.
  6. If you want, press the "Back" button to return to the listing page for another password reset, or press the "Login" button to log in to the WordPress administration panel with the username and new password in the tab that will open.
1

Create an admin user in WordPress Database via PHP

As a developer, you may need to create a new administrative user in the database to access the site. For example, this is required when exporting a WordPress database, but you are not provided with login credentials for the admin user.

Of course, you can access it through the database. However, many developers are not very comfortable with MySQL and the process is rather slow compared to what I'm going to show you. Here is the easy way to create a new WordPress admin account:

  1. Upload the above PHP file to your server and open it in your browser.
  2. Enter a value for the required "Login" field. You can optionally write "Nicename", "email" and "Display name" parameters.
  3. After clicking the "Create" button, a new administrator account will be created with the username you specified in the "Login" field. A new password with random numbers like "AtakanAu_01234567" will be determined.
WordPress User Password Reset
WordPress User Password Reset
Share:

Yandex Disk API PHP example

Yandex.Disk is a service for storing files on remote Yandex servers and sharing them with others. Data can be accessed by logging in from any device connected to the internet.

Yandex.Disk API allows software developers to access personal files and upload data to the cloud from any device. REST API uses HTTP requests to synchronize data in Yandex.Disk between different devices and platforms.

You can download and upload files to your cloud storage space on Yandex.Disk via the REST API commands. First you need to start by getting an OAuth access token for your App. You can evaluate the Yandex.Disk API using the convenient interface to send requests via Sandbox

Yandex Disk API PHP example


How to get an Yandex OAuth token?

1) Add a new application to the Yandex OAuth server.

2) Give your app a name. For example: "My web appliction"

3) In order for your application to be used with PHP, check the "Web services" box.

4) Click "Set URL for development" for "Callback URI #1:"
Yandex Disk API PHP example

5) Check the boxes under "Yandex.Disk REST API" for the permissions required by your application.
Yandex Disk API PHP example

6) Click the "Create App" button.
Yandex Disk API PHP example

7) Replace "c0XXXXXXXXXXXXXXXXXXXXXXXXXXXX00" with your "ID" number in the link address below. Open this link address with the browser in which you are logged in to Yandex.

https://oauth.yandex.com/authorize?response_type=token&client_id=c0XXXXXXXXXXXXXXXXXXXXXXXXXXXX00


Done! Here is your token string:

Yandex Disk API PHP example


Use my Github code:

GitHub Yandex.Disk PHP
Share:

Vultr Azure karşılaştırması

What is Vultr?

What is Vultr
1

Vultr is a service company that rents you a computer that you can manage. You can use the computer you will have as a web server, CDN, etc. You can use it for whatever purpose you want and install the operating system you want. There are system resources reserved only for you. This allows you to publish a website much faster than other shared servers.

1
Vultr gives you options ready to install many operating systems. However, it does not take responsibility for how you will use the operating system you will run on the rented computer, and does not assist you with the installation steps, system settings, problems and solutions that may occur during use.

Test

In order to use it in an application, a web server using PHP needed to connect to an MsSQL database on a server in Turkey. We tried this scenario on 3 different servers. Average response times were as follows.

Server features:

Azure:
~40 USD / monthly - Standard Small App Service Hours - Azure App Service (Free trial account)

Vultr #1
20 USD / monthly - 60 GB SSD, 2 CPU, 4 GB Memory, 3 TB Bandwidth - Windows

Vultr #2
5 USD / monthly - 25 GB SSD, 1 CPU, 1 GB Memory, 1 TB Bandwidth - CentOS 7


Sorgular:


Query Number of rows Number of columns
SQL #1 SELECT * FROM STOKLAR WHERE id = 1 1 194
SQL #2 SELECT isim FROM STOCKS 1515 1
SQL #3 SELECT * FROM STOCKS 1515 194

 

Values:

 

sqsrv Vultr #1 Vultr #2 Azure
SQL #1 130 800 1100
SQL #2 500 1200 2300
SQL #3 6400 10000 19000




pdo Vultr #1 Vultr #2 Azure
SQL #1 170 650 1300
SQL #2 550 1400 2700
SQL #3 6200 9500 19000

 

 

  Note: Lower value is better performance.

 

 

Result:

MicroSoft Azure offers worse service at a higher price compared to Vultr.
Share:

Mini AJAX File Upload Multiple Form - atakanau


Bu çözüm şu adresteki yazılım dosyaları temel alınarak geliştirildi: Mini AJAX File Upload Form
Tek bir sayfada, birden fazla dosya yükleme giriş alanları kullanılabilir. Yüklenecek dosya "Araştır" butonu ile seçilebilir. Ayrıca dosya yükleme işlemi, dosya giriş alanına sürüklenip bırakarak da yapılabilir. Her bir dosya giriş alanı farklı PHP dosyasını AJAX ile çağırır. Bu da dosyaları farklı dizinlere yükleyebilme imkanı sağlar. Sayfa yenilendiğinde yüklenmiş olan dosyalar listelenir. Yüklenmiş olan dosyalar sayfa üzerindeki buton ile silinebilir.

Multiple file upload input fields can be used on a single page. The file to be uploaded can be selected with the "Browse" button. It can also be upload by dragging and dropping files into the file input area. Each file entry field calls a different PHP file with AJAX. This allows files to be uploaded to different directories. When the page is refreshed, already uploaded files are listed. The uploaded files can be deleted with the button on the page.

  Download
Share:
Subscribe to: Posts (Atom)