cron a lot in conjunction with PHP to manage my jobs on the server. So, as many PHP programmers know, the
lynx text-based browser is an invaluable tool. You may encounter a situation where you’ll need to feed data from one PHP file to another via GET or POST. This code grabs dynamic POST Data from a URL and feeds it to another page using
lynx -post_data switch.
lynx -dump "http://my.server.com/post/data/generator.php" | lynx -dump -post_data "http://my.server.com/post/data/consumer.php"
http://my.server.com/post/data/generator.php will create a data package that can be consumed by PHP via the regular request variables (e.g.
$_GET and, in this case,
$_POST). For example, if you wanted to provide a list of e-mails to be fed to your
consumer.php page, you could build your string to be something like:
consumer.php side, it would look like (via
Array (  => email@example.com  => firstname.lastname@example.org  => email@example.com )
-get_data could be used in place of
-post_data if you’re more prone to use