Posts

Showing posts from October, 2018

update with multiple tables in mysql.

UPDATE personal INNER JOIN social ON social.personal_id = personal.per_id SET personal.email = ' palismahendra@gmail.com ', social.facebook = ' pal@facebook.com ' WHERE personal.per_id = 1

dropdown selected show when value exist in database.

<select class="membership_type_dropdown">                              <option value="0" selected="selected" disabled>Membership Role</option>                                   <?php                                    $sql1="SELECT membership_type_id,membership_type FROM `membership_type`";                                    $result1=mysqli_query($con,$sql1);                                    $num_rows1=mysqli_num_rows($result1);                             ...

add custom fields for specific page template in wordpress.

/*Custom filed for specific page templae (sub service page)   */ add_action('add_meta_boxes', 'add_product_meta'); function add_product_meta() {     global $post;     if(!empty($post))     {         $pageTemplate = get_post_meta($post->ID, '_wp_page_template', true);         if($pageTemplate == 'servicepage.php' )         {             add_meta_box(                 'product_meta',                 'Service Information',                 'display_product_information',                 'page',                 'normal',                 'high');         }     } } function di...

redirect to www using htaccess

RewriteEngine On RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don't put www. here. If it is already there it will be included, if not # the subsequent rule will catch it. RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Now, rewrite any request to the wrong domain to use www. # [NC] is a case-insensitive match RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

redirection using htaccess

---------- for www------- RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] for --- http to https RewriteEngine On RewriteCond %{SERVER_PORT} !=443 RewriteCond %{HTTP_HOST} ^(www\.)?jainayurveda\.com$ [NC] RewriteRule ^(.*)$ "https\:\/\/www\.jainayurveda\.com\/$1" [R=301,L]