Source of: dupe_v2.php


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>HPGL Output</title>
</head>
<body>

<?php

// duplicates hpgl patterns on the y axis

$y_limit  = round($_POST['y_limit']);
$y_spacing  = $_POST['y_spacing'];
$my_text = @file_get_contents($_FILES['my_text']['tmp_name']) ;
echo
"<pre>\nSP1;\n\n";
$my_text2 = explode ("\n", $my_text);
$ymax = $y_spacing;
$y_count = 0;
while (
$y_count < $y_limit) {
reset($my_text2);
while (!
is_null($key = key($my_text2) ) ) {
if (
preg_match ("/(p[ud])(-?\d+) (-?\d+)/i", $my_text2[$key], $match)) {
echo
$match[1]. $match[2]. " " .($match[3]+$ymax*$y_count).";\n";
}
next($my_text2);
}
$y_count = $y_count+1;
echo
"\n";
}
echo
"SP0;\n</pre>\n";
?>

</body>
</html>