Wednesday, 20 July 2016

Dynamic dropdown from database via Jquery

HTML File

 <tr>
            <th  scope="row">Select Brand:</th>
            <td>
            <select class="form-control" onChange="GetModel($brand)" id="brand" name="brand">
            <option value="">Select </option>
            <?php GetBrand(); ?>    
            </select>
            </td>
          </tr>
          <tr>
            <th scope="row">Phone Model</th>
            <td>
<div class="Xform-group">
<!-- <label class="control-label col-md-3">2</label>-->
<div class="Xcol-md-9">
<!-- <textarea class="wysihtml5 form-control" rows="6"  name="job_description" placeholder="Job Description" required></textarea>  -->
 <select class="form-control input-large" id="model" name="model">
      
          </select>
        </div>
</div>
</td>
          </tr>



Jquery for this 


<script>
$(document).ready(function(e) {
$("#brand").change(function(){
// alert('this is working');
$("#model").load("dynamic_data.php?brand=" + $("#brand").val());
});
});

</script>


dynamic_data.php


<?php 
include('db_config.php');
$brand = mysqli_real_escape_string($db,$_GET['brand']);
echo $brand;
$qry = "SELECT * FROM mobile_model WHERE brand = '$brand';";
$run = mysqli_query($db,$qry);

while($res = mysqli_fetch_array($run))
{
?>
    <option value="<?php echo $res['model_id'];  ?>">
    <?php
echo $res['model_name'];
?>
</option>

    <?php
}

?>

Sunday, 10 July 2016

Saturday, 9 July 2016

Solved : how to Increase size of wordpress | Plugin not opening correctly due to limit exceeded |

Change the limit Size in this file:

http://Localhost/domainName/wp-includes/default-constants.php


Before:

// set memory limits
if ( !defined('WP_MEMORY_LIMIT') ) {
if ( is_multisite() ) {
define('WP_MEMORY_LIMIT', '64M');
} else {
define('WP_MEMORY_LIMIT', '40M');
}
}

Change this to this:

// set memory limits
if ( !defined('WP_MEMORY_LIMIT') ) {
if ( is_multisite() ) {
define('WP_MEMORY_LIMIT', '128M');
} else {
define('WP_MEMORY_LIMIT', '40M');
}
}


And Save it .
and you have Done it Enjoy!.

Solved: How to delay a div with time ?


//Include Jquery Library
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>


<script>
$(document).ready(function() {
    $('#DivId').delay(2000).fadeIn(1000);
});

</script>

Note* : Make sure you did
style="display:none;" of that Div 

Tuesday, 5 July 2016

Solved: Wordpress Image URL not working

UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://localhost/wordpress', 'http://itplsoft.com/wordpress/');

Saturday, 2 July 2016

Bootstrap code embedded to wordpress

function enqueue_my_scripts() {
wp_enqueue_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', array('jquery'), '1.9.1', true); // we need the jquery library for bootsrap js to function
wp_enqueue_script( 'bootstrap-js', '//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js', array('jquery'), true); // all the bootstrap javascript goodness
}
add_action('wp_enqueue_scripts', 'enqueue_my_scripts');

Font Awesome embed code

<script src="https://use.fontawesome.com/d5837faf63.js"></script>


1Copy this code & place in your HTML's <head>
2Use any of Font Awesome 605+ icons in your project's UI