Jump to content

EHTISHAM

Members
  • Posts

    18
  • Joined

  • Last visited

Posts posted by EHTISHAM

  1. links in header looks like..

    <link rel="icon" href="images/favicon.ico">
    <link rel="shortcut icon" href="images/favicon.ico" />
    <link rel="stylesheet" href="css/style.css">
    <script src="js/jquery.js"></script>
    <script src="js/jquery-migrate-1.1.1.js"></script>
    <script src="js/jquery.easing.1.3.js"></script>
    <script src="js/script.js"></script> 
    <script src="js/superfish.js"></script>
    <script src="js/jquery.equalheights.js"></script>
    <script src="js/jquery.mobilemenu.js"></script>
    <script src="js/tmStickUp.js"></script>
    <script src="js/jquery.ui.totop.js"></script>
    <script src="js/validjs.js"></script>
    
    
    <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
    
    
    <link rel="stylesheet" href="css/homestyle.css">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    
    <link href="css/side-slider.css" rel="stylesheet" type="text/css" media="screen">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <script src="js/jquery.side-slider.js"></script>
    

    if i comment the below jq library..

    <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
    

    then my stuck-container works on scroll down the page.. but my "username checker" plugin does not work.. :(

     

    and... VICE-VERSA...

     

    Please help me to get out of this prob...

  2. If you want to do it before the user submits the form, use JavaScript. When a select box is checked, increment a variable. When the user tries to select the fifth checkbox, pop up an alert box and uncheck the last selection. Of course, you'll have to decrement the variable when a select box is deselected.

    Will you please share the code of java script function to do this..

  3.  

    Unchecked boxes aren't submitted at all, so you just have to count the elements of $_POST['pr'] (if you're using the POST method):

    if (isset($_POST['pr']) && count($_POST['pr']) > 4)
    {
        echo 'You can select at most 4 options.';
    }
    

    I have to do it before submit the form.. any idea?

  4. I have to wonder if

    foreach ($res as $res)

     

    will work.  You are supplanting the $res variable with a new value so you lose the rest of the array!

     

    Try

    foreach ($res as $item)

    instead and then manipulate $item

    it works.. thanks for sharing knowledge..  i'll change $res to $item..

     

    How to set limit of selection of dynamically created checkboxes...??

  5. Limit selection of check box

     

    My code looks like...

    foreach($res as $res)
        echo '<div class="ediv"><input type="checkbox" class="echeck" name="pr[]" value="'.trim($res['product']).'"/>'.trim($res['product']).'</div>';
    

    How to set limit of selection of dynamically created checkboxes...??

  6. loading image during ajax process not working properly:

     

    my code smthing like this...

     

    div to show content and loading image-

    <div id="adS" style="float: left; width: 70%">
        <div id="loading-image" style="background-image: url('images/processing.gif'); display: none;">
    
    
        </div>
    </div>

    jquery code-

    $(function() {
    
    
            $("#lets_search").bind('submit',function() {
              var gen = $("input[name='radGen']:checked").val();
              var mt = $('#selMtQ').val();
              var agf = $('#agf').val();
              var agt = $('#agt').val();
              var rel = $('#religQ').val();
              var cast = $('#selCstQ').val();
              $('#loading-image').show();
               $.post('adSearch.php',{gen:gen,mt:mt,agf:agf,agt:agt,rel:rel,cast:cast}, function(data){
                 $("#adS").html(data);
                 $('#loading-image').hide();
               });
               return false;
            });
          });

    The loading image show only one time on click event.. not every time when i click search li... :(

     

    Need help...

  7.  

    you age conditions should be

     

    if (trim($ageFrom) != '') {
        $where[] = sprintf ("(age >= '%s')", $mysqli->real_escape_string($ageFrom));
    }
    if (trim($ageTo) != '') {
        $where[] = sprintf ("(age <= '%s')", $mysqli->real_escape_string($ageTo));
    }

     

    thanks but still it shows error... 

     

    Notice: Undefined variable: mysqli in C:\xampp\htdocs\xyz.com\classes\action.php on line 421

     

    Fatal error: Call to a member function real_escape_string() on a non-object in C:\xampp\htdocs\xyz.com\classes\action.php on line 421

     

     

     

    i am using PDO..

  8.  

    Thanks.. This works..  but may be i have prob in datatype..

     

    my code smthing like this...

     

    if(isset($_POST['btnSearch']))
    {
    $gen = $_POST['radGen'];      ------- (varchar)
    $ageFrom = $_POST['txtAgeFrom'];      -------(varchar)
    $ageTo = $_POST['txtAgeTo'];     -------- (varchar)
    $mt = $_POST['selMotherTongueQ'];  --------(varchar)
    $relig = $_POST['selReligionQ']; ---------(int)
    $cast = $_POST['selCasteQ'];  ---------(int)
     
    $where = array();
    $whereclause = '';
     
    if (trim($ageFrom) != '') {
        $where[] = sprintf ("(age = '%s')", $mysqli->real_escape_string($ageFrom));
    }
    if (trim($ageTo) != '') {
        $where[] = sprintf ("(age = '%s')", $mysqli->real_escape_string($ageTo));
    }
    if (trim($mt) != '') {
        $where[] = sprintf ("(mother_tongue = '%s')", $mysqli->real_escape_string($mt));
    }
    if (trim($relig) != '') {
        $where[] = sprintf ("(religion_id = '%s')", $mysqli->real_escape_string($relig));
    }
    if (trim($cast) != '') {
        $where[] = sprintf ("(caste_id = '%s')", $mysqli->real_escape_string($cast));
    }
    // etc
     
    if (count($where) > 0) {
        $whereclause = 'WHERE ' . join(' AND ', $where);
    }
     
    $q = "SELECT u.user_id,u.name,u.gender,u.age,u.religion_id,r.religion,u.caste_id,c.caste,u.gautra,u.mangalik,u.mother_tongue,u.country_id,cnt.country,u.state_id,st.state,u.city,ed.work_area,ed.annual_income,uad.pro_pic_path,uad.about_user_desc,dp.p_desc FROM tbluserbasic u left join tblreligion r on u.religion_id=r.religion_id left join tblcaste c on u.caste_id=c.caste_id left join tblusereducation ed on u.user_id=ed.user_id left join tblcountry cnt on u.country_id=cnt.country_id left join tblstate st on u.state_id=st.state_id left join tbluseradditional uad on u.user_id=uad.user_id left join tbldesiredpartner dp on u.user_id=dp.user_id " . $whereclause;
     
    ..............
    .....
    }

     

    and i have to make query having where condition like this..

     

    WHERE (u.gender='$gen' AND (u.mother_tongue='$mt') AND u.religion_id='$relig' AND u.caste_id='$cast' AND u.age BETWEEN $ageFrom AND $ageTo)

  9.  

    I use something like this

    $where = array();
    $whereclause = '';
    
    if (trim($gender) != '') {
        $where[] = sprintf ("(gender = '%s')", $mysqli->real_escape_string($gender));
    }
    if (trim($mother_tongue) != '') {
        $where[] = sprintf ("(mother_tongue = '%s')", $mysqli->real_escape_string($mother_tongue));
    }
    
    // etc
    
    if (count($where) > 0) {
        $whereclause = 'WHERE ' . join(' AND ', $where);
    }
    
    $sql = "SELECT * FROM tbluser " . $whereclause;
    

    Thanks.. This works..  but may be i have prob in datatype..

     

    my code smthing like this...

     

    if(isset($_POST['btnSearch']))
    {
    $gen = $_POST['radGen'];      ------- (varchar)
    $ageFrom = $_POST['txtAgeFrom'];      -------(varchar)
    $ageTo = $_POST['txtAgeTo'];     -------- (varchar)
    $mt = $_POST['selMotherTongueQ'];  --------(varchar)
    $relig = $_POST['selReligionQ']; ---------(int)
    $cast = $_POST['selCasteQ'];  ---------(int)
     
    $where = array();
    $whereclause = '';
     
    if (trim($ageFrom) != '') {
        $where[] = sprintf ("(age = '%s')", $mysqli->real_escape_string($ageFrom));
    }
    if (trim($ageTo) != '') {
        $where[] = sprintf ("(age = '%s')", $mysqli->real_escape_string($ageTo));
    }
    if (trim($mt) != '') {
        $where[] = sprintf ("(mother_tongue = '%s')", $mysqli->real_escape_string($mt));
    }
    if (trim($relig) != '') {
        $where[] = sprintf ("(religion_id = '%s')", $mysqli->real_escape_string($relig));
    }
    if (trim($cast) != '') {
        $where[] = sprintf ("(caste_id = '%s')", $mysqli->real_escape_string($cast));
    }
    // etc
     
    if (count($where) > 0) {
        $whereclause = 'WHERE ' . join(' AND ', $where);
    }
     
    $q = "SELECT u.user_id,u.name,u.gender,u.age,u.religion_id,r.religion,u.caste_id,c.caste,u.gautra,u.mangalik,u.mother_tongue,u.country_id,cnt.country,u.state_id,st.state,u.city,ed.work_area,ed.annual_income,uad.pro_pic_path,uad.about_user_desc,dp.p_desc FROM tbluserbasic u left join tblreligion r on u.religion_id=r.religion_id left join tblcaste c on u.caste_id=c.caste_id left join tblusereducation ed on u.user_id=ed.user_id left join tblcountry cnt on u.country_id=cnt.country_id left join tblstate st on u.state_id=st.state_id left join tbluseradditional uad on u.user_id=uad.user_id left join tbldesiredpartner dp on u.user_id=dp.user_id " . $whereclause;
     
    ..............
    .....
    }
  10. From what I've gathered you're saying that:

    SELECT * FROM tbluser WHERE gender='male' AND mother_tongue='Tamil' AND religion_id='3' AND caste_id='374' AND (age BETWEEN 50 AND 70);
    

    Could be:

    SELECT * FROM tbluser WHERE gender='' AND mother_tongue='' AND religion_id='' AND caste_id='374' AND (age BETWEEN 50 AND 70);
    

    Do I have that right?

    as i mentioned earlier... the database use doesn't have any null value.. So if user doesn't enter any value in any field then the query results null.... so if gender is null the whole query results Null.. :(

  11.  

    If the user doesn't specify a value then leave that condition out of the WHERE clause. So if no value is supplied for "mother_tongue" then the WHERE clause will be

    WHERE gender='male'  AND religion_id='3' AND caste_id='374' AND (age BETWEEN 50 AND 70)

    but how i can modify the query dinamically.. and skip that particular and condition.. i guessed that something like if else condition may be use..

  12. How to use optional AND or skip AND condition in mySQL query when user enter submit null value for that condition..


     


    SELECT * FROM tbluser WHERE gender='male' AND mother_tongue='Tamil' AND religion_id='3' AND caste_id='374' AND (age BETWEEN 50 AND 70);


     


    the database use doesn't have any null value.. So if user doesn't enter any value in any field then the query results null....


     


    I am using this query for searching bride grooms in my matrimonial site(PHP)..


     


    If anyone know how to come out from this prob.. help me..


     


    Thanks..


  13. How to use optional AND or skip AND condition in mySQL query when user enter submit null value for that condition..

     

    SELECT * FROM tbluser WHERE gender='male' AND mother_tongue='Tamil' AND religion_id='3' AND caste_id='374' AND (age BETWEEN 50 AND 70);

     

    the database use doesn't have any null value.. So if user doesn't enter any value in any field then the query results null....

     

    I am using this query for searching bride grooms in my matrimonial site(php)..

     

    If anyone know how to come out from this prob.. help me..

     

    Thanks..

  14. [attachment=3740:prob1.jpg]
    

    why a question mark "?" appears after each text box??

     

    code smthing like this....

    <html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    </head>
    <body><br />
        <input type="text" id="t1" onblur="checkt1()" name="txtt1" />​<span id="t1Div" class="errorPrint"></span><br />
        <input type="text" id="t2" onblur="checkt2()" name="txtt2" />​<span id="t2Div" class="errorPrint"></span>
    </body>
    </html>
    

    post-178398-0-40217000-1440267331_thumb.jpg

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.