Jump to content

darkfreaks

Members
  • Posts

    4,953
  • Joined

  • Last visited

Posts posted by darkfreaks

  1. fixed it up for you, had several syntax errors causing issues also using count() instead of num_row()

    <?php
    $columns = 2;
    
    if(isset($_GET['member'])) {
    	
    $display = ceil(count($_GET['member']));
    $rows =  ($display / $columns);
    while ($row = $display) {
    $data[] = $row;
    }
    echo "<table border='1'>";
    for($i = 0; $i < $rows; $i++) {
    echo "<tr>";
    for($j = 0; $j < $columns; $j++) {
    if(isset($data[$i + ($j *  $row)])) {
    echo "<td>".$data[$i + ($j *  $row)]."</td>";
    $count = $count+1;
    }
    }
    echo "</tr>";
    }
    }
    ?>
    
  2.  

    f I understood it right you are doing an XMLHttpRequest to a different domain than your page is on. So the browser is blocking it as it usually allows a request in the same origin for security reasons.

     

    Regular web pages can use the XMLHttpRequest object to send and receive data from remote servers, but they're limited by the same origin policy. Extensions aren't so limited. An extension can talk to remote servers outside of its origin, as long as it first requests cross-origin permissions.

     

    example of how to do an offsite request using CORS: http://www.html5rocks.com/en/tutorials/cors/

  3. should read up on how sign()  and verify() work before you attempt to fool around with it.

     

     

    http://search.cpan.org/~vipul/Crypt-RSA-1.99/lib/Crypt/RSA/SS/PKCS1v15.pm

    Here's an example of how to create signatures and verify signatures with this library:
    * <code>
    * <?php
    * include 'Crypt/RSA.php';
    *
    * $rsa = new Crypt_RSA();
    * extract($rsa->createKey());
    *
    * $plaintext = 'terrafrost';
    *
    * $rsa->loadKey($privatekey);
    * $signature = $rsa->sign($plaintext);
    *
    * $rsa->loadKey($publickey);
    * echo $rsa->verify($plaintext, $signature) ? 'verified' : 'unverified';
    * ?>
    * </code>
    
    
  4. add this to the main functions in MPDF

     

     

     

    function getPageCount() {
    return count($this->pages);
    }

     

     

    then add a html-parser such string:

     

    $html = str_replace('{PAGECNT}', $this->getPageCount(), $html);

     

    then you can insert  {PAGECNT} in your parsed html to get the page count.

  5. like Req said you can't place PHP inside a .html file. like as mentioned you can do it entirely in JavaScript. or you might be able to get away with using Ajax which is a combination of PHP & JavaScript.

    <script>$(function() {$( "#datepicker" ).datepicker(({ dateFormat: "yy-mm-dd" }));
    
    });
    
    </script>
     
    <form action="action.php">
    </form>
    

    then in action.php you can process  your form and compare.

  6. Here's a simple function for formatting phone numbers with 7 to 10 digits in a more European (or Swedish?) manner:

     
    function formatPhone($num) {
    $num = preg_replace('/[^0-9]/', '', $num);
    $len = strlen($num);
    
    if($len == 7) $num = preg_replace('/([0-9]{2})([0-9]{2})([0-9]{3})/', '$1 $2 $3', $num);
    elseif($len == 8) $num = preg_replace('/([0-9]{3})([0-9]{2})([0-9]{3})/', '$1 - $2 $3', $num);
    elseif($len == 9) $num = preg_replace('/([0-9]{3})([0-9]{2})([0-9]{2})([0-9]{2})/', '$1 - $2 $3 $4', $num);
    elseif($len == 10) $num = preg_replace('/([0-9]{3})([0-9]{2})([0-9]{2})([0-9]{3})/', '$1 - $2 $3 $4', $num);
    
    return $num;
    }

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