Skip to content

Instantly share code, notes, and snippets.

View webtechriser's full-sized avatar

Manzur Ahmed webtechriser

View GitHub Profile
<?php
//Connect to mySQL First
$connection = mysql_connect( 'localhost', 'user_123', 'password_123' );
//Select Database
mysql_select_db( 'database_123' );
//Reset password with SQL UPDATE Query
$SQL="UPDATE wp_users SET user_pass = MD5('newPassword') WHERE user_login = 'admin'";
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_123');
/** MySQL database username */
define('DB_USER', 'user_123');
/** MySQL database password */
define('DB_PASSWORD', 'password_123');
<?php
// Connect to mySQL First
$connection = mysql_connect( 'DB_HOST', 'DB_USER', 'DB_PASSWORD' );
// Select Database
mysql_select_db( 'DB_NAME' );
// Reset password with SQL UPDATE Query
$SQL = "UPDATE wp_users SET user_pass = MD5( 'newpassword123here') WHERE user_login = 'admin'";
@webtechriser
webtechriser / how_to_use_public_ip_function.php
Created February 11, 2020 08:15
How to use public IP function in PHP
<?php if( clear_from_blocked_ips() ) : ?>
<script>
alert('This content is not blocked for your IP address');
</script>
<?php endif; ?>
@webtechriser
webtechriser / get_public_ip_address.php
Created February 11, 2020 06:55
Get Public IP Address
<?php
/**
* Get Public IP Address
* Get the Public IP address of the client.
*
* @link http://stackoverflow.com/a/2031935/1743124
*
* @return string The IP Address.
*/
function get_public_ip_address(){