Skip to content

Instantly share code, notes, and snippets.

View MrJSdev's full-sized avatar
🎯
Loading JS

Riyaz Khan MrJSdev

🎯
Loading JS
View GitHub Profile
@MrJSdev
MrJSdev / registration-template.php
Created March 26, 2017 18:07
save user data on MySQL database
<?php wp_insert_user( $userdata ) ?>
@MrJSdev
MrJSdev / registration-template.php
Created March 26, 2017 19:01
PHP code of Registration Form
<?php
$success = '';
$error = '';
global $wpdb, $PasswordHash, $current_user, $user_ID;
if(isset($_POST['task']) && $_POST['task'] == 'register' ) {
$password1 = $wpdb->escape(trim($_POST['password1']));
$password2 = $wpdb->escape(trim($_POST['password2']));
$first_name = $wpdb->escape(trim($_POST['first_name']));
@MrJSdev
MrJSdev / registration-template.php
Last active March 26, 2017 19:25
HTML Code of Registration Form
<form method="post">
<h3>Don't have an account?<br /> Create one now.</h3>
<p><label>Last Name</label></p>
<p><input type="text" value="" name="last_name" id="last_name" /></p>
<p><label>First Name</label></p>
<p><input type="text" value="" name="first_name" id="first_name" /></p>
<p><label>Email</label></p>
<p><input type="text" value="" name="email" id="email" /></p>
<p><label>Username</label></p>
<p><input type="text" value="" name="username" id="username" /></p>
@MrJSdev
MrJSdev / registration-template.php
Last active March 26, 2017 19:15
Full Code of Registration Form that I posted blog article on http://extracatchy.net
<?php
/*
Template Name: Login Page
*/
the_post()
get_header()
?>
<div class="wrapper">
<span class="pln">cd </span><span class="pun">~</span><span class="str">/Desktop/</span><span class="pln">
sudo chown </span><span class="pun">-</span><span class="pln">R root</span><span class="pun">:</span><span class="pln">wheel </span><span class="pun">./</span><span class="skimlinks-unlinked"><span class="typ">AppleIntelCPUPowerManagementInfo</span><span class="pun">.</span><span class="pln">kext</span></span><span class="pln">
sudo chmod </span><span class="pun">-</span><span class="pln">R </span><span class="lit">755</span> <span class="pun">./</span><span class="skimlinks-unlinked"><span class="typ">AppleIntelCPUPowerManagementInfo</span><span class="pun">.</span><span class="pln">kext</span></span><span class="pln">
sudo kextload </span><span class="pun">./</span><span class="skimlinks-unlinked"><span class="typ">AppleIntelCPUPowerManagementInfo</span><span class="pun">.</span><span class="pln">kext</span></span>
<span class="pln">sudo kextunload </span><span class="skimlinks-unlinked"><span class="typ">AppleIntelCPUPowerManagementInfo</span><span class="pun">.</span><span class="pln">kext</span></span>
<form role="search" method="get" class="search-form" action="<?php echo home_uhrl( '/' ); ?>">
<div class="input-group search-form">
<input type="search" class="form-control"
placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder' ) ?>"
value="<?php echo get_search_query() ?>" name="s"
title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
<span class="input-group-addon"> <button type="submit" class="search-btn"> <i class="fa fa-search" aria-hidden="true"></i> </button></span>
</div>
@MrJSdev
MrJSdev / style.css
Created March 27, 2017 19:34
Styling Boostrap Search Form with CSS. Uploading on http://extracatchy.net/wordpress-search-form-bootstrap/
.search-form .input-group-addon{
padding: 0;
background-color: #fff;
}
.search-form .form-control{
border-radius: 0px;
}
.search-btn{
border:none;
padding: 5px 10px;
@MrJSdev
MrJSdev / convert_number_to_words.php
Last active November 29, 2022 08:30
Do you want to convert numbers into words try the following code
<?php
function convert_number_to_words($number) {
$hyphen = '-';
$conjunction = ' and ';
$separator = ', ';
$negative = 'negative ';
$decimal = ' point ';
$dictionary = array(
0 => 'zero',
@MrJSdev
MrJSdev / example.php
Created March 28, 2017 08:21
dispaly numbers into words example
<?php echo convert_number_to_words(123456789);
// one hundred and twenty-three million, four hundred and fifty-six thousand, seven hundred and eighty-nine
echo convert_number_to_words(123456789.123);
// one hundred and twenty-three million, four hundred and fifty-six thousand, seven hundred and eighty-nine point one two three
echo convert_number_to_words(-1922685.477);
// negative one million, nine hundred and twenty-two thousand, six hundred and eighty-five point four seven seven
// float rounding can be avoided by passing the number as a string