Jump to content

Cyto

Members
  • Posts

    69
  • Joined

  • Last visited

Posts posted by Cyto

  1. Hi,

     

    I have set a Rewriterule(works):

    RewriteRule ^([a-zA-Z0-9_+-]+).html$ search.php?q=$1&site_id=0

    Is it possible if I go to a link like this search.php?q=something&site_id=0 that it will go to something.html?

    Because some urls in search results are like search.php?q=something&site_id=0 instead of something.html.

     

    Cyto

  2. Hi,

     

    Lets say the script is searching something and finds some records and at the same time it updates his records for new ones. (I have succesfully done this, no issues here)

    I would like to show the new added records with timestamp. This is what I have so far:

    $sql = "SELECT * FROM records WHERE timestamp > (NOW() - INTERVAL 30 SECOND)";

     

    This code shows the old records again. I want it to show only records that are new added.

    If someone can help me. thanks.

     

    -Cyto

  3. Hi,

     

    I'm exploding a list of result that are separated with comma, but I have also comma's in the value from the list. Is it possible to explode without removing the comma of the values?

    Example of list:

    10,24,13,145 etc.

     

    Values are:

    10,24

    13,145

     

    P.S I didn't wanted to open a new topic. Is it also possible when I browse a file to upload. I can select any file(All Files). Can it be done so I can choose only image file types?

     

    Cyto

  4. Can you give me a example code, cant come out  :confused:

     

    Convert the times to seconds, do the math, and convert back.

     

    Using addition as a better example,

    0 * 3600 + 1 * 60 + 8.035 = 68.035
    0 * 3600 + 2 * 60 + 3.054 = 123.054
    
    123.054 + 68.035 = 191.089
    
    191.089 / 3600 = 0 remainder 191.089
    191.089 / 60   = 3 remainder 11.089
    
    so 00:01:08,035 + 00:02:03,054 = 00:03:11,089

  5. Hi,

     

    I have a function that returns the value of a array if it matches $string, but it only returns Test 1 instead of returning Test 1, Test 2. Can you someone see what I'm doing wrong?

    And it has to return N if nothing found.

     

    Code:

    function fes($string){
    
    $fes['Test 1']        = '104';
    $fes['Test 2']        = '104';
    
    return in_array($string, $fes) ? array_search($string, $fes) : 'N';
    
    }
    echo fes('104');
    

     

    Thx,

    Cyto

  6. What Thorpe is saying is that having two or more elements with the same ID is against W3C standards, use classes instead.

     

     

    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
       <head>
          <title>Test</title>
          <!-- META //-->
          <meta name="description" content="" >
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
          <!-- JQUERY //-->
          <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
          <script type="text/javascript">
          <!--
             $(document).ready(function() {
                $('[class^="d_"]').bind({
                   'mouseenter' : function() {
                      $('.'+ $(this).attr('class')).css({
                         color      : '#f00',
                         fontWeight : 'bold'
                      });
                   },
                   'mouseleave' : function() {
                     $('.'+ $(this).attr('class')).css({
                         color      : '#000',
                         fontWeight : 'normal'
                      });
                   }
                });
             });
          //-->
          </script>
       </head>
       <body>
          <span class="d_22">Test</span>
          <span class="d_23">Test</span>
          <span class="d_22">Test</span>
          <span class="d_23">Test</span>
          <span class="d_22">Test</span>
          <span class="d_23">Test</span>
       </body>
    </html>
    

     

    Ok, thx.

  7. Hey,

     

    I'm trying to hover a id element with the same name, example:

    id="C_22" equeals id="C_22" both get class hlh

     

    I got this so far, but it only hovers 1 element with the same id. I want both to have the class hlh, only one gets it.

    var hlhid = $('[id^="D_"]');
    $(hlhid).hover(
      function () {
      if(this == this){
        $(this).addClass("hlh");
      }
      }, 
      function () {
      if(this == this){
        $(this).removeClass("hlh");
      }
      }
    );

     

    Cyto

  8. I would like to check multiple rows from array with elseif. It's working if i add it manually, but i would like it to check all of the rows in a single elseif. Code(First if is nothing, just a example).

    Row is a array filled with numbers like: 3-3, 2-2 etc.

     

    if("2-2" == $row["0"]){
      echo BLUE;
    }elseif($dnumber == $row["0"]){
      echo RED;
    }else{
      echo WHITE;
    }
    

     

×
×
  • 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.