Jump to content

zenag

Members
  • Posts

    443
  • Joined

  • Last visited

Posts posted by zenag

  1. not a big problem..
    .....................
    .................................
    document.getElementById('numOfRowsSubmit').setAttribute("value",numOfRows);
             //return true;
             //submit form
             frm.submit();
          }
       }
    ----> just remove this brace }
    
    
    

  2. $doomed = array();
    $doomed[] = '1225294183';
    $doomed[] = '1224689938';
    $doomed[] = '1170862952';
    $serialz=serialize($doomed);
      $encode=urlencode($serialz);
      
       
    ?> <a href="http://www.web_site/Blog/archive.php?x=<?php echo $encode ?>">pass</a>
    
    

    in archive.php

     

     

     

    
    if($_GET)
    {
    $arr = unserialize(urldecode(stripslashes($_GET['x'])));
    print_r($arr);
    }
    

  3. use multisort...

    
    
    $breadcrumbs[] = array(
                   'name'          => 'Computers',
                   'title_order'    => 3,
                   );
    		   
    $breadcrumbs[] = array(
                   'name'          => 'Computers',
                   'title_order'    => 2,
                   );
    $breadcrumbs[] = array(
                   'name'          => 'Computers',
                   'title_order'    => 1,
                   );
    		   foreach ($breadcrumbs as $key => $row) {
        $title_order[]  = $row['title_order'];
       
    }
    
    
    $sort_order = SORT_ASC;
    array_multisort($title_order, $sort_order, $breadcrumbs); 
    print_r($breadcrumbs);			   
    		  
    
    

  4. ajax.php
    
    <?
    
    $VALUE=$_POST['val'];  
    
    
    
    
    $con=mysql_connect("localhost","root","");
    mysql_select_db("db",$con);
    $total="select count(*) as count from table2 where fieldname='".$VALUE."'";
    $totalcount=mysql_result(mysql_query($total),0);
    $perpage=2;
    $limitstart=$_POST['pagenumber'] * $perpage;
    $limitend=$perpage;
    $totalpage=ceil($totalcount/$perpage);
    $sql=mysql_query("select * from table2 where fieldname='".$VALUE."' LIMIT ".$limitstart.",".$limitend);
    
    
    ?>
    <table><? while($row=mysql_fetch_array($sql))
    {?><tr><td><? echo $row["password"];?></td></tr><? }
    ?><tr><td><a href="javascript:ajaxRequest('ajax.php','<? echo $_POST['val']?>','<? echo $_POST['pagenumber']-1?>')">Previous</a></td><td>Page: <? echo $_POST['pagenumber']+1?>/<? echo $totalpage?></td><td><a href="javascript:ajaxRequest('ajax.php','<? echo $_POST['val']?>','<? echo $_POST['pagenumber']+1?>')">Next</a></td></tr></table>
    
    
    
    

     

    just download prorotype.js from google and paste it in ur directory

     

     

     

     

     

     

  5. u can try it with prototype.js...here's an example .try it out...

    main.php
    
    
    
    <?
    $con=mysql_connect("localhost","root","");
    mysql_select_db("db",$con);
    
    $sql=mysql_query("select fieldname,id from table1");
    
    ?><script type="text/javascript" src="prototype.js"></script>
    
    <table><tr><td> <div id="display"></div>  <select  onChange="ajaxRequest('ajax.php',this.value,0)"name=""><? while($row=mysql_fetch_object($sql)){ ?><option value="<? echo $row->fieldname;?>"><? echo $row->fieldname;?></option><? }?></select></td></tr><tr><td></td></tr></table>
    
    <script type="text/javascript">  
       /* ajax.Request */  
       function ajaxRequest(url,data,pagenumber) { 
      
          var aj = new Ajax.Request(  
         url, {  
          method:'post',   
          parameters:{"val": data,"pagenumber":pagenumber},   
         onComplete: getResponse  
          }  
       );  
    }  
    /* ajax.Response */  
    function getResponse(oReq) {  
        $('display').innerHTML = oReq.responseText;  
    }  
      </script> 
    
    
    
    

  6. try this..

    
    <?
    
    $a = array( 2, 29, 54, 77);
    $b = array( 66, 72, 102, 107 );
    
    sort($a);
    for ($i=0; $i <count($a); $i++)
    { //prints the array elements
      $aa[]= $a[$i];
    }
    sort($a);
    for ($i=0; $i <count($b); $i++)
    { //prints the array elements
      $bb[]= $b[$i];
    }
    
    
    
    
    $j=0;
    
    while($j<=count($aa)+2)
    {
    
    $take=array_pop($aa);
    $new=array();
    array_push($new,$take);
    
    //print_r($aa);
    //print_r($bb);
    
    if( $take < current($bb))
    {
      $val=current($bb);
      $keys=key($bb);
    unset($bb[$keys]);
      reset($bb);
      
    }else
    {
    
    
      for ($i=0; $i <count($bb); $i++)
    { //prints the array elements
    
    if(next($bb)>$take)
    {
    
    $val=current($bb);
    $keys=key($bb);
    unset($bb[$keys]);
    reset($bb);
    break;
    }
    }
    
    }
    
    
    array_push($new,$val);
    $result[]=$new;
    $j++;
    
    }
    
    
    
    ?>
    <pre><? echo print_r($result);?></pre>
    
    
    
    
    

  7. sorry 've done a small mistake...here u go try this out..its working for me..

    $sqlt=mysql_query("select * from sip");
    while($rowr=mysql_fetch_array($sqlt))
    {
    $t[]=$rowr['trunk'];
    }
    
    $sql="select * from astcdr where lastapp<>'WaitExten'";
    foreach($t as $v)
    {
    $sql.=" and callednum <> '".$v."'";
    }
    $sqlquery=mysql_query($sql);
    while($row=mysql_fetch_array($sqlquery))
    {
    echo $row['accountcode']."  ".$row['callednum'];
    echo "<br>";
    }
    
    

  8. can try this.....

    $sqlt=mysql_query("select * from sip");
    while($rowr=mysql_fetch_array($sqlt))
    {
    $t[]=$rowr['trunk'];
    }
    
    $sql=mysql_query("select * from astcdr where lastapp<>'WaitExten'");
    foreach($t as $v)
    {
    $sql.=" and callednum <> '".$v."'";
    }
    while($row=mysql_fetch_array($sql))
    {
    echo $row['accountcode']."  ".$row['callednum'];
    echo "<br>";
    }
    
    
    

  9. upload another  .png file and try this code

    <?php
    echo "header.png:<br />\n";
    $exif = exif_read_data('header.png', 'IFD0');
    echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />\n";
    
    $exif = exif_read_data('header.png', 0, true);
    echo "test2.jpg:<br />\n";
    foreach ($exif as $key => $section) {
        foreach ($section as $name => $val) {
            echo "$key.$name: $val<br />\n";
        }
    }
    ?>
    
    

  10. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title><script LANGUAGE="JavaScript">
    function displayHTML(printContent) {
    var inf = printContent;
    win = window.open("print.html", 'popup', 'toolbar = no, status = no');
    win.document.write(inf);
    win.document.close(); // new line
    }
    </script>  
    </head>
    
    <body>
    <div id="printarea">Hello how r u? ...</div><a href="javascript:void(0);" onclick="displayHTML(document.getElementById('printarea').innerHTML)">Print Preview</a>
    </body>
    </html>
    
    
    

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