document.getElementById('myh1').innerHTML='Profile for ' + document.getElementById('t0').innerHTML + ' ' + document.getElementById('t1').innerHTML; var oaemail=document.getElementById('aemail'); if (oaemail) { oaemail.href=oaemail.href.replace('=Profile&', '=' + encodeURIComponent('A ' + document.getElementById('myh1').innerHTML) + '&'); } ";
if ($j == (-1 + sizeof($things_to_ask))) $suffix="";
$retval="\n" . '' . $suffix . "\n";
$prefix="";
return $retval;
}
function webdisplay($h) {
global $fullname, $sn;
if ($h != '') {
if (file_exists(dirname(__FILE__) . "/interactive_becomes_web.htm")) unlink(dirname(__FILE__) . "/interactive_becomes_web.htm");
file_put_contents(dirname(__FILE__) . "/interactive_becomes_web.htm", $h);
if (file_exists(dirname(__FILE__) . "/interactive_becomes_web.html")) unlink(dirname(__FILE__) . "/interactive_becomes_web.html");
//sleep(1);
exec("ksh -c \"perl -p -e 's/ /Profile for " . $fullname . "/g' " . dirname(__FILE__) . "/interactive_becomes_web.htm\" > " . dirname(__FILE__) . "/interactive_becomes_web.html");
//sleep(1);
exec("python -mwebbrowser http://" . $sn . "/interactive_becomes_web.html");
//exec("python -mwebbrowser http://" . $sn . "/interactive_becomes_web.htm");
}
}
if (strlen($_SERVER['QUERY_STRING']) > 0 || !isset($argv[0])) {
if (strpos($_SERVER['QUERY_STRING'], "reask=") !== false || strlen($_SERVER['QUERY_STRING']) == 0) {
for ($i=0; $i ";
$html="" . $idea . "
Parameter | Value |
---|
" . get_line($things_to_ask[$i], $i) . "
" . $astr . "";
} else {
$html=str_replace("", "" . get_line($things_to_ask[$i], $i) . " ", $html);
}
}
if ($html != "") {
$html=adddragdrop($html);
if (!$sc) {
webdisplay($html);
} else if ($sc == "") {
webdisplay($html);
} else {
echo $html;
}
}
} else {
$bits=explode("&", $_SERVER['QUERY_STRING']);
for ($i=0; $i ";
$html="" . $idea . "
Parameter | Value |
---|
" . $things_to_askithing . " | " . str_replace("\n","",$line) . " |
" . $astr . "";
} else {
$astr="
";
$html="" . $idea . "
Parameter | Value |
---|
" . $things_to_askithing . " | " . str_replace("\n","",$line) . " |
" . $astr . "";
}
} else {
if ($fullname == $lastline) $fullname.=(" " . str_replace("\n","",$line));
if (strpos($subbits[1], "%20") === false) {
$html=str_replace("'>Refresh", "&" . str_replace(" ","_",$things_to_askithing) . "=" . urlencode(str_replace("\n","",$line)) . "'>Refresh", str_replace("'>Email", urlencode("&" . str_replace(" ","_",$things_to_askithing) . "=") . urlencode(str_replace("\n","",$line)) . "'>Email", str_replace("", "" . $things_to_askithing . " | " . str_replace("\n","",$line) . " | ", $html)));
} else {
$html=str_replace("'>Refresh", "&" . str_replace(" ","_",$things_to_askithing) . "=" . $subbits[1] . "'>Refresh", str_replace("'>Email", urlencode("&" . str_replace(" ","_",$things_to_askithing) . "=") . $subbits[1] . "'>Email", str_replace("", "" . $things_to_askithing . " | " . str_replace("\n","",$line) . " | ", $html)));
}
}
$lastline=str_replace("\n","",$line);
}
if ($html != "") {
$html=adddragdrop($html);
if ($_SERVER['SERVER_NAME'] == "www.rjmprogramming.com.au" || $_SERVER['SERVER_NAME'] != '') {
echo str_replace(" ","Profile for " . $fullname, $html);
} else {
webdisplay($html);
}
}
}
} else if (isset($argv[0])) {
$lastline="";
$html="";
echo "PHP Interactive Input becomes Web Output\n\n";
while ($ithing < sizeof($things_to_ask)) {
echo "What is your " . $things_to_ask[$ithing] . "? Type nothing to stop, else we present this information to you on a web page: ";
$handle = fopen ("php://stdin","r");
$line = fgets($handle);
if (trim($line) == '') {
echo "Bye now\n";
if ($html != "") {
$html=adddragdrop($html);
webdisplay($html);
}
exit;
} else if ($html == "") {
$fullname.=str_replace("\n","",$line);
$astr="
";
$html="" . $idea . "
Parameter | Value |
---|
" . $things_to_ask[$ithing] . " | " . $line . " |
" . $astr . "";
} else {
if ($fullname == $lastline) $fullname.=(" " . str_replace("\n","",$line));
$html=str_replace("'>Refresh", "&" . str_replace(" ","_",$things_to_ask[$ithing]) . "=" . urlencode(str_replace("\n","",$line)) . "'>Refresh", str_replace("'>Email", urlencode("&" . str_replace(" ","_",$things_to_ask[$ithing]) . "=") . urlencode(str_replace("\n","",$line)) . "'>Email", str_replace("", "" . $things_to_ask[$ithing] . " | " . str_replace("\n","",$line) . " | ", $html)));
}
$lastline=str_replace("\n","",$line);
echo "\n";
echo "Thank you, continuing...\n";
$ithing++;
}
if ($html != "") {
$html=adddragdrop($html);
webdisplay($html);
}
}
?>
|