advertisement

Weblog:   Charts with PHP and Flash, and a port to Perl
Subject:   PHP Cleanup (+ Remoting)
Date:   2004-09-28 10:45:56
From:   sklar
As a minor point, to save a little PHP face here, the code you posted above could be expressed in PHP as:


$params .= 'rows=" . count($value) . '&cols=' . count($value[0]) . '&';
for ($r=0; $r $params .= "r$r" . join(';',$value[$r]) . '&';
}


Which is not all that different than the Perl.


But as to the more important point of the liabilities of graphing in SWF, could some of the problems be solved with Flash Remoting?


That is, instead of passing all the data as URL parameters, you pass a URL to the SWF app and then have it retrieve the data. You can send arbitrary amounts of data that way.


You still have to deal with the data protection issues, but it seems like that'd be a problem in any client-side visualization app.

Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • Nathan Torkington photo PHP Cleanup (+ Remoting)
    2004-09-28 10:55:31  Nathan Torkington [Reply | View]

    Yeah, I knew there was a cleaner way to express it (we should send those guys a freebie of PHP Cookbook :-). I'd thought about turning it into an XML service, but the big problem is still data protection (which, as you say, is a problem for any client-size graphing app).

    I'm back to looking at server-side charting software. I wish there were a Perl XS wrapper to Ploticus, and may eventually wish my way into a text editor to make it so.

    Thanks! --Nat
  • David Sklar photo PHP Cleanup (+ Remoting)
    2004-09-28 10:46:31  David Sklar [Reply | View]

    Argh. The < in my PHP gets eaten. View Source to see my handiwork. :(
    • PHP Cleanup (+ Remoting)
      2004-09-29 11:22:57  aristotle [Reply | View]

      Or use &lt; to escape it, or use code tags, or maybe both. Since this silly commenting system has no preview button, I'm posting all permutations in one go…

      Escape:

      $params .= 'rows=" . count($value) . '&cols=' . count($value[0]) . '&';
      for ($r=0; $r<count($value);$r++){
      $params .= "r$r" . join(';',$value[$r]) . '&';
      }

      Code tags:


      $params .= 'rows=" . count($value) . '&cols=' . count($value[0]) . '&';
      for ($r=0; $r<count($value);$r++){
      $params .= "r$r" . join(';',$value[$r]) . '&';
      }
      </code>

      Code tags and escapes:


      $params .= 'rows=" . count($value) . '&cols=' . count($value[0]) . '&';
      for ($r=0; $r<count($value);$r++){
      $params .= "r$r" . join(';',$value[$r]) . '&';
      }
      • PHP Cleanup (+ Remoting)
        2004-09-29 11:24:25  aristotle [Reply | View]

        Heh, sigh. This O'ReillyNet blogging system blows chunks.

Showing messages 1 through 4 of 4.
-->